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 ;
}

最新文章

  1. jQuery全局Ajax事件处理器
  2. zeroclipboard浏览器复制插件使用记录
  3. 【BZOJ-1656】The Grove 树木 BFS + 射线法
  4. UITextView 显示不全的问题
  5. java中BigDecimal加减乘除基本用法
  6. ARM Linux 3.x的设备树(Device Tree)
  7. 斯坦福iOS7公开课1-3笔记及纸牌Demo
  8. Dev C++支持c++11标准的编译方法
  9. Hadoop 2 初探
  10. Mac Mysql5.7.11安装和卸载
  11. 【重构】m站重构思路
  12. Unity优化之纹理集
  13. 统计难题(trie树)
  14. C++开源代码项目汇总
  15. Object调用控件的办法
  16. android脚步---设置layout隐藏属性
  17. C/C++语言简介之程序结构
  18. 论文学习-系统评估卷积神经网络各项超参数设计的影响-Systematic evaluation of CNN advances on the ImageNet
  19. Python&#160;&#39;xxx&#39;&#160;codec&#160;can&#39;t&#160;decode&#160;byte&#160;xxx常见编码错
  20. not in 的优化

热门文章

  1. Spring Boot 之 Redis
  2. 浅谈Java反射机制 之 使用类的 属性、方法和构造函数
  3. sqluldr2 oracle直接导出数据为文本的小工具使用
  4. vue 父子component生命周期
  5. js 获取屏幕宽高
  6. Java判断一个类里是否存在某个属性
  7. Git-第N篇碰见的一些问题
  8. UVA-10600.Contest and Blackout.(Kruskal + 次小生成树)
  9. WOJ#1243 蜥蜴 lizard
  10. 【题解】Cow Relays