HDU6424 Rikka with Time Complexity
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 ;
}
HDU6424 Rikka with Time Complexity的更多相关文章
- 杭电多校第九场 hdu6424 Rikka with Time Complexity 数学
Rikka with Time Complexity Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K ( ...
- 2018 Multi-University Training Contest 9 Solution
A - Rikka with Nash Equilibrium 题意:构造一个$n * m$的矩阵,使得$[1, n * m]$ 中每个数只出现一次,并且纳什均衡只出现一次. 思路:从大到小的放置,每 ...
- Instant Complexity - POJ1472
Instant Complexity Time Limit: 1000MS Memory Limit: 10000K Description Analyzing the run-time comple ...
- Runtime Complexity of .NET Generic Collection
Runtime Complexity of .NET Generic Collection I had to implement some data structures for my compu ...
- Examples of complexity pattern
O(1):constant - the operation doesn't depend on the size of its input, e.g. adding a node to the tai ...
- 2016暑假多校联合---Rikka with Sequence (线段树)
2016暑假多校联合---Rikka with Sequence (线段树) Problem Description As we know, Rikka is poor at math. Yuta i ...
- 空间复杂度是什么?What does ‘Space Complexity’ mean? ------geeksforgeeks 翻译
这一章比较短! 空间复杂度(space complexity)和辅助空间(auxiliary space)经常混用,下面是正确的辅助空间和空间复杂度的定义 辅助空间:算法需要用到的额外或者暂时的存储空 ...
- 三部曲二(基本算法、动态规划、搜索)-1004-Instant Complexity
Instant Complexity Time Limit : 2000/1000ms (Java/Other) Memory Limit : 20000/10000K (Java/Other) ...
- hdu.5203.Rikka with wood sticks(数学推导:一条长度为L的线段经分割后可以构成几种三角形)
Rikka with wood sticks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/O ...
随机推荐
- java中java.util.Date和java.sql.Date之间的关系和使用选择
关系: java.util.Date是java.sql.Date的父类 区别:(java.sql.Date包含年月日信息,java.util.Date包含年月日时分秒) 1:“规范化”的java.sq ...
- 前端004/React常用UI组件
每天进步一点点〜 Ant Design of React //蚂蚁金服设计平台.需要应用何种类型组件可参考API React + mobx + nornj 开发模式文件说明: [1].A.t.html ...
- shell命令传参数(参数长度不定)
脚本 sudo echo "[mysqlMaster<$1>]" >> /home/admin/hostrecord count= ];do >> ...
- centos解决Could not find a version that satisfies the requirement pip3 (from versions: none)及No matching distribution found for pip3问题
python环境:python 3.8 报错信息: WARNING: pip is configured with locations that require TLS/SSL, however th ...
- Sobel硬件实现的硬件代码分析(三)
#include "xaxivdma.h" #include "xaxivdma_i.h" #include "xhls_sobel.h" ...
- 08-js流程控制、循环、元素操作
# js流程控制 > 流程控制用于基于不同的条件来执行不同的动作. ### if语句 >if... else ... >if ... else if ... else... > ...
- spark复习笔记(6):数据倾斜
一.数据倾斜 spark数据倾斜,map阶段对key进行重新划分.大量的数据在经过hash计算之后,进入到相同的分区中,zao
- Route的exact属性
exact是Route下的一个属性,react路由会匹配到所有能匹配到的路由组件,exact能够使得路由的匹配更严格一些. exact的值为bool型,为true时表示严格匹配,为false时为正常匹 ...
- day02-css
技术分析 HTML的块标签: div标签: 默认占一行,自动换行 span标签: 内容显示在同一行 CSS概述: Cascading Style Sheets : 层叠样式表 主要用作用: 用来美化我 ...
- 2018-2-13-win10-uwp-读写csv-
title author date CreateTime categories win10 uwp 读写csv lindexi 2018-2-13 17:23:3 +0800 2018-2-13 17 ...