poj-1218 THE DRUNK JAILER 喝醉的狱卒】的更多相关文章

自己去看看原题; 题目大意: 就是一个狱卒喝醉了,他第一趟吧所有的监狱都带开,第二趟把能把二整除的监狱关闭,第三趟操作能把三整除的监狱; 求最后能逃跑的罪犯数 输入第一个数是代表 测试数据组数 每个数据代表狱卒来回的次数 当作开关问题即可 #include<iostream> using namespace std; int main() { int n; cin>>n; while(n--) { int a; int aa[120]={1}; cin>>a; int…
THE DRUNK JAILER Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 25124   Accepted: 15767 Description A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked…
THE DRUNK JAILER Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23358   Accepted: 14720 Description A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked…
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/sr19930829/article/details/37727417 THE DRUNK JAILER Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23246   Accepted: 14641 Description A certain prison contains a long hall of n cells, e…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2188 题目大意:n为5-100之间的一个数,代表有多少间牢房,刚开始所有房间打开,第一轮2的倍数的房间(打开的关上,关上的打开),第二轮3的倍数,第四轮4的倍数......n轮,最后有几间牢房打开的 . 解题思路:开灯问题,跟HDU 2053差不多,只要牢房编号是完全平方数,那囚犯就可以逃出去.这里有解释:http://www.cnblogs.com/fu3638/p/7507239.html sq…
THE DRUNK JAILER Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 24918   Accepted: 15632 Description A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked…
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1337 杭电 http://poj.org/problem?id=1218清华 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1350浙江 原本以为小小的一道水题不值得去总结,但是发现却有好多方法,好神奇啊 方法一:数据挺小的模拟就好 #include<iostream> #include<algorithm> #…
http://poj.org/problem?id=1218 题意:门的状态有两种开或关,初始化为开,每次进行状态转换,第一次把门号是1的倍数的门状态转换,第二次把门号是2的倍数的门状态转换,......,第n次把状态是n的倍数的门状态转换,输出最后有几个门是开的状态. #include<stdio.h> #include<string.h> int main() { ],n; scanf("%d",&t); while(t--) { scanf(&qu…
Problem A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked. One night, the jailer gets bored and decides to play a game. For round 1 of the game, he takes a drink o…
一.Description A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked. One night, the jailer gets bored and decides to play a game. For round 1 of the game, he takes a d…