随笔分类 - STL-map
摘要:A sequence a1,a2,…,an is called good if, for each element ai, there exists an element aj (i≠j) such that ai+aj is a power of two (that is, 2d for some
阅读全文
摘要:Shuffle'm Up Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14471 Accepted: 6633 Description A common pastime for poker players at a poker
阅读全文
摘要:【链接】: "CF" 【题意】:从一堆数中选一个最大子集,使得任意两个数相减的绝对值都是2的幂。 【分析】:首先很难的一点,需要想到子集最多只能有三个,四个及以上的子集一定不存在(可以证明)。当有三个元素时,则必有其中两对元素之差相等。 【代码】: include using namespace s
阅读全文
摘要:【链接】: "CF988C" 【题意】:在n个序列中任选两个序列,两个序列都除去他们中的一个数,使的总和相同 【分析】:map mp,从0~m遍历删除第i个数,mp[sum a[i]]={j+1,i+1}; 其中key是记录删掉某个数的剩下的数,value是一对以行列号用来确定位置以方便输出。若删掉
阅读全文
摘要:【链接】: "CF987A" 【分析】:运用map 【代码】: include include include include using namespace std; define N 100010 define M 2005 const int INF = 0x3f3f3f3f; define
阅读全文
摘要:``` Problem B: Averyboy找密码 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 83 Solved: 29 [Submit][Status][Web Board] Description Averyboy获得了一个串只由大小写字母组成的密码,他现在要想办法解开密码的key,这个密码的key就是其中每个字母出现的次数的中位数。他...
阅读全文
摘要:D. Almost Difference time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Let's denote a func
阅读全文
摘要:C. Boxes Packing time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Boxes Packing time li
阅读全文
摘要:C. Registration system time limit per test 5 seconds memory limit per test 64 megabytes input standard input output standard output A new e-mail servi
阅读全文
摘要:1095 Anigram单词 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 收藏 关注 1095 Anigram单词 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 1095 Anigram单词 基准时间限制:1 秒 空间限制
阅读全文