脑洞题目
文章平均质量分 82
GKHack
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #246 (Div. 2) 432C Prime Swaps(脑洞)
C. Prime Swapstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have an array a[1], a[2], ..., a[n], con原创 2016-07-12 13:28:57 · 798 阅读 · 0 评论 -
BestCoder Round #64 (div.2) HDOJ5586 Sum(脑洞)
SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 671 Accepted Submission(s): 355Problem DescriptionThere is a number sequen原创 2015-12-03 23:43:25 · 872 阅读 · 0 评论 -
Codeforces Round #313 (Div. 2) 560C Gerald's Hexagon(脑洞)
C. Gerald's Hexagontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald got a very curious hexagon for h原创 2015-12-17 22:42:00 · 1075 阅读 · 0 评论 -
Codeforces Round #337 (Div. 2) 610C Harmony Analysis(脑洞)
C. Harmony Analysistime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe semester is already ending, so Dani原创 2015-12-29 00:58:43 · 974 阅读 · 0 评论 -
Codeforces Round #337 (Div. 2) 610B Vika and Squares(脑洞)
B. Vika and Squarestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVika has n jars with paints of distinct原创 2015-12-29 00:47:03 · 868 阅读 · 0 评论 -
BestCoder Round #62 (div.2) HDOJ5562 Clarke and food(脑洞)
Clarke and foodTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 501 Accepted Submission(s): 292Problem DescriptionClarke is a原创 2015-11-18 10:23:01 · 953 阅读 · 0 评论 -
Codeforces Round #332 (Div. 2) 599C Day at the Beach(脑洞)
C. Day at the Beachtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Squidward, Spongebob and Patric原创 2015-11-23 11:02:07 · 1294 阅读 · 0 评论 -
Codeforces Round #105 (Div. 2) 148C Terse princess(脑洞)
C. Terse princesstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output«Next please», — the princess called and c原创 2015-12-08 20:20:27 · 990 阅读 · 0 评论 -
Codeforces Round #331 (Div. 2) 596ABC题解
题目链接: 点击打开链接A: 给出n个点的坐标, 问你这n个点能不能确定一个矩形, 如果可以求出面积, 不可以则输出-1.脑洞题, n为1输出-1, 其他情况则求面积, 若面积为0则不能确定, 注意数据初始化, 为此wa了一发.AC代码:#include "iostream"#include "cstdio"#include "cstring"#include "原创 2015-11-17 08:37:35 · 1298 阅读 · 0 评论 -
BestCoder Round #58 (div.2) HDOJ5494 5495 5496 5497题解
题目连接: 点击打开链接A: 模拟题, 从小到大排序后求a的前m个和与b的后m个和作比较即可.AC代码:#include "iostream"#include "cstdio"#include "cstring"#include "algorithm"using namespace std;const int MAXN = 505;int n, m, a[MAXN]原创 2015-11-15 13:09:28 · 1036 阅读 · 0 评论 -
Educational Codeforces Round 2 600C Make Palindrome(脑洞)
C. Make Palindrometime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA string is called palindrome if it read原创 2016-01-22 10:31:56 · 973 阅读 · 0 评论 -
Codeforces Round #334 (Div. 2) 604C Alternative Thinking(脑洞)
C. Alternative Thinkingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputKevin has just recevied his disappo原创 2016-01-22 11:08:01 · 678 阅读 · 0 评论 -
Educational Codeforces Round 3 609C Load Balancing(脑洞)
C. Load Balancingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the school computer room there are n s原创 2016-01-23 16:53:52 · 583 阅读 · 0 评论 -
Manthan, Codefest 16 633D Fibonacci-ish(脑洞+stl)
D. Fibonacci-ishtime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYash has recently learnt about the Fibonac原创 2016-02-28 09:11:48 · 789 阅读 · 0 评论 -
BestCoder Round #43B HDOJ5265 pog loves szh II(脑洞)
pog loves szh IITime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2346 Accepted Submission(s): 677Problem DescriptionPog and Sz原创 2016-02-27 22:36:22 · 531 阅读 · 0 评论 -
UVALive 7512 November 11th(脑洞)
题目链接:点击打开链接给出坏凳子的位置, 座位不能挨着坐, 问最多可以做多少人, 以及最少可以坐多少人使得不能再有可以坐的位置.最多可以坐多少人, 只要中间空一个即可, 本题wa点在最少坐的人数, 中间空两个也可以... 比如.S..S.所以空的位置大于2时, 分母为3.AC代码:#include "iostream"#include "cstdio"#include "cst原创 2016-03-29 17:04:08 · 817 阅读 · 0 评论 -
Codeforces Round #344 (Div. 2) 631C Report(脑洞+stl)
C. Reporttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEach month Blake gets the report containing main原创 2016-03-04 16:51:06 · 997 阅读 · 2 评论 -
UVALive 7410 Kingdom of Black and White(脑洞 + stl)
题目链接:点击打开链接给出一个由01构成字符串, 可以修改字符一次, 问连续的0或1最大的平方和是多少.题目即求最长的0串或者1串, 先求出给出字符串的平方和, 遍历一次, 分两种情况, 一种是当前为1, 一种是一般情况. 当前为1时, 要判断前一段与后一段和是否大于最大. 求出最多增长加到ans即可.AC代码:#include "iostream"#include "cst原创 2016-03-29 16:54:57 · 471 阅读 · 0 评论 -
Codeforces Round #342 (Div. 2) 625C K-special Tables(脑洞)
C. K-special Tablestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPeople do many crazy things to stand ou原创 2016-02-13 10:52:09 · 772 阅读 · 0 评论 -
Codeforces Round #342 (Div. 2) 625B War of the Corporations(stl)
B. War of the Corporationstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA long time ago, in a galaxy far原创 2016-02-13 10:25:58 · 653 阅读 · 0 评论 -
Educational Codeforces Round 4 612C Replace To Make Regular Bracket Sequence(脑洞)
C. Replace To Make Regular Bracket Sequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given st原创 2016-01-29 09:43:17 · 448 阅读 · 0 评论 -
Codeforces Round #297 (Div. 2) 525C Ilya and Sticks(脑洞)
C. Ilya and Stickstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the evening, after the contest Ilya w原创 2015-12-23 23:36:30 · 773 阅读 · 0 评论 -
Codeforces Round #250 (Div. 2) 437C The Child and Toy(脑洞贪心)
C. The Child and Toytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn Children's Day, the child got a toy原创 2015-08-31 20:34:40 · 1486 阅读 · 0 评论 -
Codeforces Round #329 (Div. 2) 593AB题解
题目链接: 点击打开链接A: 给出n个字符串, 要求从中挑选数个字符串构成一个长串最长, 该长串又一个或两个字母组成.模拟题, 遍历n个字符串, 每次遍历通过两个字符a, b判断该字符串是否由一个或两个字母组成, 若是则数组中加上此字符串长度. 最终求最大长度时, 如果字母相同, 则此时长度为dp[i][j]一半.AC代码:#include "iostream"#in原创 2015-11-10 00:07:51 · 917 阅读 · 0 评论 -
HDOJ1003 Max Sum(脑洞)
题目链接:t组样例,每组样例开始是n,后n个数字组成一个数组。问你连续的哪些数之和最大。每读入一个数字加到tmp上,代表当前数之和,若tmp比ans大则更新ans,同时更新起始和结束的点。若tmp为负则更新起点为j+1,且tmp重置为0。保证了ans能取得最大。AC代码:#include "iostream"#include "cstdio"#inc原创 2015-09-25 23:10:14 · 1095 阅读 · 0 评论 -
Codeforces Round #319 (Div. 2) 577C Vasya and Petya's Game(筛选法)
C. Vasya and Petya's Gametime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya and Petya are playing a simp原创 2015-09-14 21:01:47 · 1151 阅读 · 0 评论 -
Codeforces Round #322 (Div. 2) 581A 581B 581C
581A链接:点击打开链接给你a只红袜子,b只蓝袜子,问你可以组成多少对颜色不同的袜子以及剩下多少对单色袜子。小小的脑洞,答案分别为a, b最小值以及a - b绝对值的一半。AC代码:#include "iostream"#include "cstdio"#include "cstring"#include "algorithm"using na原创 2015-09-29 10:51:14 · 1519 阅读 · 0 评论 -
Codeforces Round #320 (Div. 2) 579B Finding Team Member(脑洞)
题目链接:点击打开链接给你一个n,接下来的2n - 1行第i行给你i - 1个数字,代表了队员i, j合作的分数,问你两个队员之间怎样组队可以使得分数最高。用一个结构体存储数据,x代表第一个人,y代表第二个人,读入后按照分数由高到低排序,最后保存答案就好~AC代码:#include "iostream"#include "cstdio"#include原创 2015-09-22 08:13:03 · 1277 阅读 · 0 评论 -
Codeforces Round #320 (Div. 2) 579A Raising Bacteria(脑洞)
题目链接:点击打开链接给你一个盒子里面的细菌数,每个细菌可以分裂成两个细菌,问你最初盒子里面有几个细菌。相当于问你这个数的二进制表示中有几个1.AC代码:#include "iostream"#include "cstdio"#include "cstring"#include "algorithm"using namespace std;int原创 2015-09-19 20:25:45 · 1245 阅读 · 0 评论 -
Codeforces Round #319 (Div. 2) 577A Multiplication Table(脑洞)
A. Multiplication Tabletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet's consider a table consisting of原创 2015-09-12 09:13:28 · 1197 阅读 · 0 评论 -
Codeforces Round #318 574C Bear and Elections(脑洞)
C. Bear and Pokertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLimak is an old brown bear. He often play原创 2015-08-30 08:43:52 · 994 阅读 · 0 评论 -
Codeforces Round #251 (Div. 2) 439D Devu and his Brother(脑洞)
D. Devu and his Brothertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDevu and his brother love each other原创 2015-08-29 14:19:13 · 862 阅读 · 0 评论 -
Codeforces Round #251 (Div. 2) 439C Devu and Partitioning of the Array(脑洞)
C. Devu and Partitioning of the Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDevu being a small kid原创 2015-08-29 09:57:52 · 1008 阅读 · 0 评论 -
BestCoder Round #54 (div.2) HDOJ5430 Reflect(欧拉函数+脑洞)
ReflectTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 274 Accepted Submission(s): 162Problem DescriptionWe send a light from原创 2015-09-07 06:53:39 · 952 阅读 · 0 评论 -
Codeforces Round #201 (Div. 2) 347A Difference Row(脑洞)
A. Difference Rowtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou want to arrange n integers a1, a2, ..原创 2015-08-28 19:05:10 · 901 阅读 · 0 评论 -
BestCoder Round #54 (div.2) HDOJ5428 The Factor(脑洞)
The FactorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 495 Accepted Submission(s): 154Problem DescriptionThere is a sequen原创 2015-09-06 01:09:09 · 130 阅读 · 0 评论 -
Codeforces Round #328 (Div. 2) 592ABC题解
题目链接:A: 给出8*8的一个棋盘, W为A的棋子, B为B的棋子. 每个棋子只能向上或者向下走, 且不能覆盖或者跳跃棋子, 问你最终谁获胜.模拟题, 遍历每一列, 记录最考上的W以及最靠下的B的位置.AC代码:#include "iostream"#include "cstdio"#include "cstring"#include "algorithm"usi原创 2015-11-10 00:43:21 · 1103 阅读 · 0 评论 -
Codeforces Round #327 (Div. 2) 591ABC题解
题目链接:点击打开链接A: 两个人在两端相向而行, 第一次碰面后掉头, 到端点后又掉头, 问第二次碰面时候距离左端点的距离.脑洞题目, 第二次和第一次碰面在同一个地方, 要求精度在1e-4以内, 输出5位小数即可.AC代码:#include "iostream"#include "cstdio"#include "cstring"#include "algorithm原创 2015-11-09 23:48:27 · 1046 阅读 · 0 评论 -
Codeforces Round #324 (Div. 2) 584ABCD题解
题目链接:点击打开链接A:给你一个n、t,让你输出长度为n且可以整除t的数。注意到t的范围是1~10,把10特判一下,其他的情况直接输出n个t就好。AC代码:#include "iostream"#include "cstdio"#include "cstring"#include "algorithm"using namespace std;int n, t;原创 2015-10-10 10:46:34 · 985 阅读 · 0 评论 -
Codeforces Round #326 (Div. 2) 588ABC题解
题目链接:点击打开链接A: 给出n天的需求和肉的价格, 问你满足每天的需求需要花费的最少买肉价格是多少.脑洞题目, 因为肉价格是已知的, 所以对每个上升的子序列需求求和, 乘以最低价格, 然后累加起来就是答案.AC代码:#include "iostream"#include "cstdio"#include "cstring"#include "algorithm"原创 2015-10-22 00:54:41 · 1094 阅读 · 0 评论