J - Two Buttons Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 520B Description Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button a…
点击打开链接 Borg Maze Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7097 Accepted: 2389 Description The Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used t…
Exclusive or 题目链接: http://acm.hust.edu.cn/vjudge/contest/121336#problem/J Description Given n, find the value of Note: ♁ denotes bitwise exclusive-or. Input The input consists of several tests. For each tests: A single integer n (2≤n<10^500). Output…
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1336 There is an interesting calculator. It has 3 rows of buttons. Row 1: button 0, 1, 2, 3, ..., 9. Pressing each button appends that digit to the end of the display. Row 2: button +0, +1, +2, +3, ...…
题目链接 Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone was a trap, and he tried…
- Eddy's research II Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description As is known, Ackermann function plays an important role in the sphere of theoretical computer science. However, in the other h…
水灾(sliker.cpp/c/pas) 1000MS 64MB 大雨应经下了几天雨,却还是没有停的样子.土豪CCY刚从外地赚完1e元回来,知道不久除了自己别墅,其他的地方都将会被洪水淹没. CCY所在的城市可以用一个N*M(N,M<=50)的地图表示,地图上有五种符号:“. * X D S”.其中“X”表示石头,水和人都不能从上面经过.“.”表示平原,CCY和洪水都可以经过.“*”表示洪水开始地方(可能有多个地方开始发生洪水).“D”表示CCY的别墅.“S”表示CCY现在的位置. CCY每分…
题目链接 Problem Description There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When you at floor i,if you press the button "UP…
转自:http://www.cnblogs.com/kevince/p/3887827.html 首先声明一下,这里的规律指的是循环,即找到最小循环周期. 这么一说大家心里肯定有数了吧,“不就是next数组性质的应用嘛”,没错,正是如此. 在ACM的比赛中有些时候会遇到一些题目,可以或必须通过找出数据的规律来编写代码,这里我们专门来讨论下 如何运用KMP中next数组的性质 来寻找一个长数组中的最小循环周期. 先来看一道题 ZOJ 3785 What day is that day? Time…
题目 n枚硬币排成一个圈.Alice和Bob轮流从中取一枚或两枚硬币.不过,取两枚时,所取的两枚硬币必须是连续的.硬币取走之后留下空格,相隔空格的硬币视为不连续.Alice开始先取,取走最后一枚硬币的获胜.当双方都采取最有策略时,谁会获胜? 分析 不管,先爆搜找规律. #include<bits/stdc++.h> using namespace std; typedef unsigned long long ll; ; int a[maxn], n; map<ll, int>mp…
这个题我看了,都是推荐的神马双向广搜,难道这个深搜你们都木有发现?还是特意留个机会给我装逼? Open the Lock Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3014 Accepted Submission(s): 1323 Problem Description Now an emergent task for you…
2014多校 第八题 1008 2014 Multi-University Training Contest 8 4952 Number Transformation Number Transformation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 85 Accepted Submission(s): 31 Problem Descr…
http://codeforces.com/contest/456/problem/B CF#260 div2 B Fedya and Maths Codeforces Round #260 B. Fedya and Maths time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Fedya studies in a gymnasi…
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 45648 Accepted: 14310 Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,00…