A Famous ICPC Team
时间限制:1000 ms | 内存限制:65535 KB
难度:2
描述
Mr. B, Mr. G, Mr. M and their coach Professor S are planning their way to Warsaw for the ACM-ICPC World Finals. Each of the four has a s...
分类:
其他好文 时间:
2014-08-10 15:44:00
阅读次数:
237
ST
时间限制:1000 ms | 内存限制:65535 KB
难度:1
描述
“麻雀”lengdan用随机数生成了后台数据,但是笨笨的他被妹纸的问题给难住了。。。
已知lengdan生成了N(1=
1,A a b c 表示给区间a到b内每个数都加上c;
2,S a b 表示输出区间a到b内的和;
3,Q a b 表示区间a到b内的奇数...
分类:
其他好文 时间:
2014-08-10 13:06:31
阅读次数:
227
题意:不解释。
策略:广搜。
解释一下为什么会是广搜,一个水杯只能向其他两个水杯倒水,不能向他自己倒水,这样一共有三个水杯也就是有6种情况,只需要一步一步的着就好了(数据没多大《100), 我们将每一次出现的水杯中的水数(就是有多少水)都标记下来,如果是以前没有出现过,那么就进队列,同时将此时的水杯数标记下来,说明该种情况已出现,一直找到想要找的状态为止,如果都找不到,就返回-1.
难点:我...
分类:
其他好文 时间:
2014-08-10 10:28:40
阅读次数:
211
CO-PRIME时间限制:1000ms | 内存限制:65535KB难度:3描述This problem is so easy! Can you solve it?You are given a sequence which contains n integers a1,a2……an, your t...
分类:
其他好文 时间:
2014-08-10 10:18:40
阅读次数:
250
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=46用类似于快速幂的方法做,注意1的时候是0;#include using namespace std;int main(){ int ase; int num; int r...
分类:
其他好文 时间:
2014-08-10 10:16:10
阅读次数:
317
完数?时间限制:1000 ms | 内存限制:65535 KB 难度:1描述 一个数如果恰好等于不等于它本身的所有因子之和,那么这个数就被称为"完数"。例如,6的因子为1,2,3,而6=1+2+3,因此,6是完数。要求给定一个整数n,请编写程序,确定n是否是完数。输入每组数据输入一个n(1int.....
分类:
其他好文 时间:
2014-08-09 21:09:09
阅读次数:
264
#include int main(){ int n,i,j,s,k,a[10000]; scanf("%d",&n); { s=0; k=0; for (j=1;jint main(){ int n,i,j,s; scanf("%d",&n...
分类:
其他好文 时间:
2014-08-09 21:07:39
阅读次数:
265
CO-PRIME
时间限制:1000 ms | 内存限制:65535 KB
难度:3
描述
This problem is so easy! Can you solve it?
You are given a sequence which contains n integers a1,a2……an, your task is to find how man...
分类:
其他好文 时间:
2014-08-09 18:46:38
阅读次数:
244
Compress String
时间限制:2000 ms | 内存限制:65535 KB
难度:3
描述
One day,a beautiful girl ask LYH to help her complete a complicated task—using a new compression method similar to Run Length Encod...
分类:
其他好文 时间:
2014-08-09 18:46:18
阅读次数:
284
题意:不解释。
策略:如题;
这道题可以用深搜也可以用广搜,我以前写的是用的深搜,最近在学广搜,就拿这道题来练练手。
代码:
#include
#include
#include
using std::queue;
bool vis[20][20];
const int dir[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};//四个方向
int map[9][9]...
分类:
其他好文 时间:
2014-08-09 11:38:27
阅读次数:
155