摘要: To The MaxTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4437 Accepted Submission(s): 2099Problem DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater loc 阅读全文
posted @ 2012-05-18 21:45 剑不飞 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 19122Accepted: 6659DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, k=1,N, and for 阅读全文
posted @ 2012-05-15 21:44 剑不飞 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#define N 1000005using namespace std;int position[N];int main(){ memset(position,0,sizeof(position)); position[1]=0; int next=1; int i,j; for(i=2;i<N;i++) { if(position[i]) continue; for(j=i;j<N;j+=i) { position[j]=next; } next++; } int m; while(scanf("%d",&am 阅读全文
posted @ 2012-04-28 21:54 剑不飞 阅读(423) 评论(0) 推荐(0) 编辑
摘要: How many prime numbersTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3302 Accepted Submission(s): 1074Problem DescriptionGive you a lot of positive integers, just to find out how many prime numbers there are.InputThere are a lot of cases. In eac. 阅读全文
posted @ 2012-04-28 20:35 剑不飞 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 公式 p+q-gcd(p,q)就是所求值#include#include#includeusing namespace std;int gcd(int n,int m){ if(m==0) return n; gcd(m,n%m);}int main(){ int m,n; while(cin>>m>>n) { cout<<m+n-gcd(m,n)<<endl; }} 阅读全文
posted @ 2012-04-28 17:48 剑不飞 阅读(86) 评论(0) 推荐(0) 编辑
摘要: Transformations A square pattern of size N x N (1 #include #include #include #define N 15 using namespace std; char map[N][N]; char _map[N][N]; int main() { freopen("transform.in","r",stdin); freopen("transform.out","w",stdout); int m; while(scanf("%d&quo 阅读全文
posted @ 2012-04-28 13:48 剑不飞 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Milking CowsThree farmers rise at 5 am each morning and head for the barn to milk three cows. The first farmer begins milking his cow at time 300 (measured in seconds after 5 am) and ends at time 1000. The second farmer begins at time 700 and ends at time 1200. The third farmer begins at time 1500 a 阅读全文
posted @ 2012-04-27 20:46 剑不飞 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2000 Accepted Submission(s): 1423Problem Description假设有x1个字母A, x2个字母B,..... x26个字母Z,同时假设字母A的价值为1,字母B的价值为2,..... 字母Z的价值为26。那么,对于给定的字母,可以找到多少价值 #include using namespace std; int f[55],word[27],cun[55]. 阅读全文
posted @ 2012-04-25 20:17 剑不飞 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3001 Accepted Submission(s): 1868Problem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits 阅读全文
posted @ 2012-04-25 17:32 剑不飞 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3266 Accepted Submission(s): 1519Problem DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a gri 阅读全文
posted @ 2012-04-25 16:21 剑不飞 阅读(150) 评论(0) 推荐(0) 编辑