HDU5904 LCIS 水题
http://acm.hdu.edu.cn/showproblem.php?pid=5904://
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn=;
const double eps=1e-;
const int modn=;
int n,m;
int f1[*maxn]={};
int f2[*maxn]={};
int main(){
int T;scanf("%d",&T);
while(T-->){
scanf("%d%d",&n,&m);
memset(f1,,sizeof(f1));
memset(f2,,sizeof(f2));
int x,ma=,ans=,z;
for(int i=;i<=n;i++){
scanf("%d",&x);
f1[x]=f1[x-]+;
ma=max(x,ma);
}
for(int i=;i<=m;i++){
scanf("%d",&x);
f2[x]=f2[x-]+;
ma=max(x,ma);
}
for(int i=;i<=ma;i++){
z=min(f1[i],f2[i]);
ans=max(ans,z);
}
printf("%d\n",ans);
}
return ;
}
HDU5904 LCIS 水题的更多相关文章
- hdu-5904 LCIS(水题)
题目链接: LCIS Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- ACM :漫漫上学路 -DP -水题
CSU 1772 漫漫上学路 Time Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu Submit ...
- ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 154 Solved: 112[ ...
- [poj2247] Humble Numbers (DP水题)
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...
- gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,
1195: 相信我这是水题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 821 Solved: 219 Description GDUT中有个风云人 ...
- BZOJ 1303 CQOI2009 中位数图 水题
1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ...
- 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题
B - 大还是小? Time Limit:5000MS Memory Limit:65535KB 64bit IO Format: Description 输入两个实数,判断第一个数大 ...
- ACM水题
ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: ...
随机推荐
- String类的一些常用操作方法
package com.liveyc.framework.util; import java.io.UnsupportedEncodingException; import java.net.URLD ...
- vc 播放音乐
#include <vfw.h> #pragma comment(lib,"vfw32.lib") ● 简单实现 要实现一个播放器,首先要先建立一个MF ...
- 005zabbix3.0报错记录
一.问题描述 在zabbix_server添加变量时,出现了以下的报错,
- [转载]FFmpeg完美入门[4] - FFmpeg应用实例
1 用FFserver从文件生成流媒体 一.安装ffmpeg 在ubuntu下,运行sudo apt-get ffmpeg 安装ffmpeg,在其他linux操作系统下,见ffmpeg的编译过程(编译 ...
- scrollreveal(页面滚动显示动画插件支持手机)
scrollreveal.js是一款可以轻易实现桌面和移动浏览器元素随页面滚动产生动画的js插件.该插件通过配置可以在页面滚动,元素进入视口时产生炫酷的动画效果,同时还支持元素的3D效果,非常的实用. ...
- CGIC函数说明
CGIC函数说明 参考cgic函数说明_Embedded Resources Library Online (C)郝博士 cgiFormResultType cgiFormString( char * ...
- LightOJ - 1010 Knights in Chessboard(规律)
题目链接:https://vjudge.net/contest/28079#problem/B 题目大意:给你一个nxm的棋盘,问你最多可以放几个骑士让他们互相攻击不到.骑士攻击方式如下图: 解题思路 ...
- web 端 gantt组件选型
gantt - 甘特图 甘特图(Gantt chart)又称为横道图.条状图(Bar chart).其通过条状图来显示项目,进度,和其他时间相关的系统进展的内在关系随着时间进展的情况.以提出者亨利·L ...
- hdu 5468(dfs序+容斥原理)
Puzzled Elena Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
- STM32 磁场传感器HMC5883
一.IIC协议 默认(出厂) HMC5883LL 7 位从机地址为0x3C 的写入操作,或0x3D 的读出操作. 要改变测量模式到连续测量模式,在通电时间后传送三个字节:0x3C 0x02 0x00 ...