SGU 126 Boxes(模拟题|二进制)】的更多相关文章

Translate:Sgu/126 126. 盒子 time limit per test: 0.5 sec. memory limit per test: 4096 KB 有两个盒子. 第一个盒子里有A 个球, 第二个里面有B 个球 (0 < A + B < 2147483648). 允许把球在两个盒子间移动. 从一个盒子向另一个盒子移动球的数目必须等 于接受盒子现有的球的数量. 你需要搞清楚, 最后球能不能都移动到一个盒子里 Input 第一行两个整数 A 和 B, 空格分隔. Outpu…
<传送门> 126. Boxes time limit per test: 0.25 sec. memory limit per test: 4096 KB There are two boxes. There are A balls in the first box, and B balls in the second box (0 < A + B < 2147483648). It is possible to move balls from one box to anothe…
题目地址:http://acm.sgu.ru/problem.php?contest=0&problem=126 /* 找规律,智商不够,看了题解 详细解释:http://blog.csdn.net/ahfywff/article/details/7432524 */ #include <cstdio> #include <cmath> #include <cstring> #include <string> #include <iostrea…
题意:较大的容量减较小的容量,较小的容量翻倍.问操作几回其中一个空. 开始用set判重,重复就不可行.不过状态最多有2e18种.不仅爆内存,还超时.然后找规律.发现只有比例为1:1,1:3,1:7,3:5,1:15,3:13,5:11,7:9......这样才行.也就是化简以后相加是2^k. #pragma comment(linker,"/STACK:1024000000,1024000000") #include <iostream> #include <cstd…
Problem K. UTF-8 Decoder 题目连接: http://opentrains.snarknews.info/~ejudge/team.cgi?SID=c75360ed7f2c7022&all_runs=1&action=140 Description UTF-8 is a character encoding capable of encoding all possible characters, or code points, in Unicode. Nowadays…
模拟题 PAT (Advanced Level) Practice 模拟题 目录 1008 Elevator (20) 1042 Shuffling Machine (20) 1046 Shortest Distance (20) 1051 Pop Sequence (25) 1117 Eddington Number (25) 1128 N Queens Puzzle (20) 1008 Elevator (20) #include<cstdio> int main() { int N; s…
Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 64795   Accepted: 19978 Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an old knotted message, profes…
Crossword Answers Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 869   Accepted: 405 Description A crossword puzzle consists of a rectangular grid of black and white squares and two lists of definitions (or descriptions). One list of de…
Prison Transfer Time Limit: 1000MS   Memory Limit: 262144KB   64bit IO Format: %I64d & %I64u Submit Status Description The prison of your city has n prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer c of t…
The Android University ACM Team Selection Contest Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述  Now it's 20000 A.D., and the androids also participate in the ACM Inter-national Collegiate Programming Contest (ACM/ICPC). In order to sele…