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的更多相关文章

  1. 杭电多校第九场 hdu6424 Rikka with Time Complexity 数学

    Rikka with Time Complexity Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K ( ...

  2. 2018 Multi-University Training Contest 9 Solution

    A - Rikka with Nash Equilibrium 题意:构造一个$n * m$的矩阵,使得$[1, n * m]$ 中每个数只出现一次,并且纳什均衡只出现一次. 思路:从大到小的放置,每 ...

  3. Instant Complexity - POJ1472

    Instant Complexity Time Limit: 1000MS Memory Limit: 10000K Description Analyzing the run-time comple ...

  4. Runtime Complexity of .NET Generic Collection

    Runtime Complexity of .NET Generic Collection   I had to implement some data structures for my compu ...

  5. 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 ...

  6. 2016暑假多校联合---Rikka with Sequence (线段树)

    2016暑假多校联合---Rikka with Sequence (线段树) Problem Description As we know, Rikka is poor at math. Yuta i ...

  7. 空间复杂度是什么?What does ‘Space Complexity’ mean? ------geeksforgeeks 翻译

    这一章比较短! 空间复杂度(space complexity)和辅助空间(auxiliary space)经常混用,下面是正确的辅助空间和空间复杂度的定义 辅助空间:算法需要用到的额外或者暂时的存储空 ...

  8. 三部曲二(基本算法、动态规划、搜索)-1004-Instant Complexity

    Instant Complexity Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 20000/10000K (Java/Other) ...

  9. 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 ...

随机推荐

  1. YOLOV3中Darknet中cfg文件说明和理解

    今天将要说明的是Darknet中的cfg文件,废话少说,直接干!(以cfg/yolov3.cfg为例,其它类似) [net]                        ★ [xxx]开始的行表示网 ...

  2. js 相关好文章推荐

    1.关于xmlhttprequest https://segmentfault.com/a/1190000004322487 2.XMLHttpRequest2 新技巧 https://www.htm ...

  3. python函数-基础知识

    一.含义函数是程序内的“小程序” 二.示例 #!/usr/bin/env python #coding:utf-8 def hello(): print('Hello world!') print(' ...

  4. 待补 http://acm.hdu.edu.cn/showproblem.php?pid=6602

    http://acm.hdu.edu.cn/showproblem.php?pid=6602 终于能够看懂的题解: https://blog.csdn.net/qq_40871466/article/ ...

  5. CentOS7 安装Postgresql 11+ 源码编译安装Postgis-2.5.2

    ####安装Postgresql-11yum install zlib-devel gcc makegroupadd postgresuseradd -g postgres postgrespassw ...

  6. C# System.Web.Caching.Cache类 缓存 各种缓存依赖

    原文:https://www.cnblogs.com/kissdodog/archive/2013/05/07/3064895.html Cache类,是一个用于缓存常用信息的类.HttpRuntim ...

  7. WinForm的RadioButton使用小技巧

    http://www.cnblogs.com/sjrhero/articles/1883155.html 当多个RadioButton同在一个容器里面的时候,多半的操作都是要得到其中一个的值这个时候我 ...

  8. Apache Mesos 官方文档 V1.0

    Apache Mesos 官方文档 V1.0 2016-11-07 中文版:http://mesos.mydoc.io/ gitBook :https://www.gitbook.com/book/m ...

  9. SSM中前台传数组。后台接受的问题

    当时写得时候,忘记考虑json的jar,做个记录. 第一步:先带入jar <dependency> <groupId>com.fasterxml.jackson.core< ...

  10. BZOJ2588 树上静态第k大

    题意翻译 给你一棵有n个结点的树,节点编号为1~n. 每个节点都有一个权值. 要求执行以下操作: U V K:求从节点u到节点v的第k小权值. 输入输出格式 输入格式 第一行有两个整数n和m(n,m≤ ...