HDU6424 Rikka with Time Complexity
2024-10-07 12:16:37
HDU6424 Rikka with Time Complexity
数学题~(真的数学题)
#include <bits/stdc++.h>
#define mp(_,__) make_pair(_,__) using namespace std;
int T,n,m;
int a[],b[];
pair <int,int> a1,a2,b1,b2;
pair <pair<int,int>,pair<int,int> > A,B;
int main(){
scanf("%d",&T);
while(T--)
{
scanf("%d%d",&n,&m);
memset(a,0x3f,sizeof(a));
memset(b,0x3f,sizeof(b));
for (int i = ;i < n;++i) scanf("%d",a+i);
for (int i = ;i < m;++i) scanf("%d",b+i);
a1 = mp(a[]+,0x3f3f3f3f),b1 = mp(b[]+,0x3f3f3f3f);
a[]++;b[]++;
if (a[] > a[]) swap(a[],a[]);
if (b[] > b[]) swap(b[],b[]);
a2 = mp(a[],a[]),b2 = mp(b[],b[]);
if (a1 > a2) swap(a1,a2);
if (b1 > b2) swap(b1,b2);
A = make_pair(a1,a2),B = make_pair(b1,b2);
if ( A == B) puts("");
else if (A > B) puts("-1");
else puts("");
}
return ;
}
最新文章
- jQuery全局Ajax事件处理器
- zeroclipboard浏览器复制插件使用记录
- 【BZOJ-1656】The Grove 树木 BFS + 射线法
- UITextView 显示不全的问题
- java中BigDecimal加减乘除基本用法
- ARM Linux 3.x的设备树(Device Tree)
- 斯坦福iOS7公开课1-3笔记及纸牌Demo
- Dev C++支持c++11标准的编译方法
- Hadoop 2 初探
- Mac Mysql5.7.11安装和卸载
- 【重构】m站重构思路
- Unity优化之纹理集
- 统计难题(trie树)
- C++开源代码项目汇总
- Object调用控件的办法
- android脚步---设置layout隐藏属性
- C/C++语言简介之程序结构
- 论文学习-系统评估卷积神经网络各项超参数设计的影响-Systematic evaluation of CNN advances on the ImageNet
- Python&#160;&#39;xxx&#39;&#160;codec&#160;can&#39;t&#160;decode&#160;byte&#160;xxx常见编码错
- not in 的优化