导航

2013年8月15日

摘要: 点击打开链接九的余数时间限制:3000ms | 内存限制:65535KB难度:3描述现在给你一个自然数n,它的位数小于等于一百万,现在你要做的就是求出这个数整除九之后的余数。输入第一行有一个整数m(1char str[1000100];int main(){ int num; int sum; int i; scanf("%d" , &num); getchar(); while(num--) { sum = 0; scanf("%s" , str); for(i = 0 ; str[i] ; i++) { sum += str[i] -  阅读全文

posted @ 2013-08-15 15:15 勇敢的炮灰 阅读(165) 评论(0) 推荐(0)

摘要: 点击打开链接D.D-CityDescriptionLuxer is a really bad guy. He destroys everything he met.One day Luxer went to D-city. D-city has N D-points and M D-lines. Each D-lineconnects exactly two D-points. Luxer will destroy all the D-lines. The mayor of D-city wantsto know how many connected blocks of D-city left 阅读全文

posted @ 2013-08-15 14:25 勇敢的炮灰 阅读(168) 评论(0) 推荐(0)

摘要: 点击打开链接A+B Problem II时间限制:3000ms | 内存限制:65535KB难度:3描述I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.A,B must be positive.输入The first line of the input contains an integer T(1#include#include#include using namespace std;char str[2][1002];int 阅读全文

posted @ 2013-08-15 13:57 勇敢的炮灰 阅读(121) 评论(0) 推荐(0)

摘要: A. TutorDescriptionLilin was a student of Tonghua Normal University. She is studying at University ofChicago now. Besides studying, she worked as a tutor teaching Chinese to Americans. So,she can earn some money per month. At the end of the year, Lilin wants to know hisaverage monthly money to decid 阅读全文

posted @ 2013-08-15 13:46 勇敢的炮灰 阅读(178) 评论(0) 推荐(0)

摘要: /*高精度除低精度求商模板*//*大数除法 ------除数为int范围*/#include#define N 1000using namespace std;void division(char * src,int n){ int len = strlen(src),i,k,t=0,s=0; char dest[N]; bool flag = true; //商是否有了第一个有效位,防止商首部一直出现0 for(i=0,k=0; i0 || t==0) //余数为0要修改商 { dest[k++] = t... 阅读全文

posted @ 2013-08-15 12:35 勇敢的炮灰 阅读(197) 评论(0) 推荐(0)