CSU OJ 1340 A Sample Problem】的更多相关文章

Description My girlfriend loves 7 very much, she thinks it is lucky! If an integer contains one or more 7, she will think it is lucky too! Input The first line has one integer T (1 <= T <= 100), means there are T test cases.    For each test case, t…
Description Given a positive integer n, find two non-negative integers a, b such that a2 + b2 = n. Input The first line contains the number of test cases T (1 <= T <= 1000). For each test case, there is only one line with an integer n (1 <= n <…
Description 有一个N*N的字符矩阵,从上到下依次记为第1行,第2行,……,第N行,从左至右依次记为第1列,第2列,……,第N列. 对于这个矩阵会进行一系列操作,但这些操作只有两类: (1) R: 将矩阵逆时针旋转90度: (2) P x y: 将此时第x行第y列的字符打印出来,其中1 <= x, y <= N.   Input 输入数据的第一行包含一个整数T (1 <= T <= 20),表示接下来一共有T组测试数据. 对于每组测试数据,第一行包含一个整数N (1 &l…
Description 有一个由M个整数组成的序列,每次从中随机取一个数(序列中每个数被选到的概率是相等的)累加,一共取N次,最后结果能被3整除的概率是多少? Input 输入包含多组数据.     对于每组测试数据,第一行包含两个整数M, N (1 <= M <= 100, 1 <= N <= 30),含义同上.接下来一行包含M个在[1, 100]范围内整数,依次描述了这个序列中的各个整数. Output 对于每组数据,用“Case X: Y”的格式输出答案,其中X表示是第几组测…
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1339 1339: 最后一滴血 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 319  Solved: 142[Submit][Status][Web Board] Description 在ACM/ICPC这样的程序设计竞赛中,最早解出一道题称为抢到FB(First Blood,第一滴血).现在ACM/ICPC世界总决赛甚至为每道题的FB设立了特别…
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1330 1330: 字符识别? Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 419  Solved: 296[Submit][Status][Web Board] Description 你的任务是写一个程序进行字符识别.别担心,你只需要识别1, 2, 3,如下: .*.  ***  *** .*.  ..*  ..* .*.  ***  ***…
Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23458    Accepted Submission(s): 10465 Problem Description A ring is compose of n circles as shown in diagram. Put natural numb…
1325: A very hard problem Time Limit: 3 Sec  Memory Limit: 160 MBSubmit: 203  Solved: 53[Submit][Status][Web Board] Description CX老湿经常被人黑,被黑得多了,自己也就麻木了.于是经常听到有人黑他,他都会深情地说一句:禽兽啊! 一天CX老湿突发奇想,给大家出了一个难题,并且声称谁能够准确地回答出问题才能继续黑他,否则他就要反击了. 这个难题就是: 给出两个数p和q,接下…
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1811 给你一棵树,每个节点有一个颜色.问删除一条边形成两棵子树,两棵子树有多少种颜色是有相同的. 启发式合并,小的合并到大的中.类似的题目有http://codeforces.com/contest/600/problem/E //#pragma comment(linker, "/STACK:102400000, 102400000") #include <algor…
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1804 中文题意就不说了. dfs从底到根回溯即可,看代码应该能清楚. //#pragma comment(linker, "/STACK:102400000, 102400000") #include <algorithm> #include <iostream> #include <cstdlib> #include <cstrin…