HDU5904 LCIS 水题
2024-10-19 09:00:50
http://acm.hdu.edu.cn/showproblem.php?pid=5904://
说是LCIS其实和LCIS没有一点儿关系的水题。
代码
#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 ;
}
最新文章
- 使用gulp-uncss清理多余无用css
- maven + eclipse + tomcat热部署
- 【读书笔记】iOS网络-使用Bonjour实现自组织网络
- MX4连接后adb无法识别解决方法
- 【Amazon Linux】免费搭建subversion服务器
- Swift 玩转gif
- HTTP调试 抓包 工具 Fiddle 简介 示例
- mycat(4)
- kibana 版本kibana-4.3.1 修改地图
- MVC5
- 时间转换(字符串转date 年月日时分秒 格式)
- 团队作业4——第一次项目冲刺 tHiRd DaY
- MyBatis 查询映射自定义枚举
- 第一天 Java语言概述
- Sublime text3 连接sftp/ftp(远程服务器)
- Java模拟耗时任务异步执行
- Linux学习笔记:【000】Linux系统入门
- PCL点云分割(3)
- PHP 类文件的自动加载机制 __autoload()
- 继承方法-->;原型的相互引用
热门文章
- 【CodeForces】626 F. Group Projects 动态规划
- VScode格式化ESlint
- tf.name_scope tf.variable_scope学习
- S3C6410 SPI全双工读写流程分析(原创)【转】
- TCP 建立的3次握手, 和关闭的4次握手
- 26_Python的内置函数
- vue单选,多选,多选的内容显示在页面可删除
- 用js实现登录的简单验证
- sshd_config OpenSSH SSH 进程配置文件配置说明
- mac os版本Intellij IDEA 搭建spring mvc的maven工程(新手教学)