Search found 26 matches

Wed Sep 07, 2005 8:29 am
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 42657

10013:pls help RTE

i don't understand why RTE i used array size larger than 1000000 : #include<stdio.h> #include<string.h> int main() { char ch[1000010]; long int i,j[1000010],k[1000010],n,carry,m; scanf("%ld",&n); for(;n>0;n--){ scanf("%ld",&m); for(i=0;i<=m;i++) ch ='0'; carry=0; for(i=0;i<m;i++) scanf("%ld %ld",&j ...
Tue Sep 06, 2005 10:40 pm
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 35260

530:confused WA?

i used long double n dividebygcd but why WA: #include<stdio.h> #include<math.h> long double gcd(long double a,long double b) { if(fmod(a,b)==0) return b; else return gcd(b,fmod(a,b)); } int main() { long double g,i,j,k,n,mul,div; double up,down; scanf("%Lf %Lf",&n,&k); while(n!=0 && k!=0){ up=1;down...
Sat Aug 20, 2005 3:07 pm
Forum: Volume 101 (10100-10199)
Topic: 10190 - Divide, But Not Quite Conquer!
Replies: 105
Views: 25060
ya thanx- i got AC
Tue Aug 16, 2005 9:27 pm
Forum: Volume 101 (10100-10199)
Topic: 10191 - Longest Nap
Replies: 75
Views: 30105

10191-why all the time WA

i think my code outputs correctly . but why WA? any1 pls help me? #include<stdio.h> #include<string.h> int main() { int i,j,k,n,m=0,t1[102],t2[102], max; char time1[102][6],time2[102][6],app[256]; while(scanf("%d",&n)!=EOF){ max=0; for(i=1;i<=n;i++) {scanf("%s %s",time1 ,time2 );gets(app); } strcpy(...
Sat Aug 13, 2005 1:13 pm
Forum: Volume 101 (10100-10199)
Topic: 10190 - Divide, But Not Quite Conquer!
Replies: 105
Views: 25060
the difference is only 4 the imput "64 1" . i changed my code this way n it gives same output as u. so why WA. #include<stdio.h> #include<math.h> int main() { long n,m,i,j,kk,kkk,p; double k,l; while(scanf("%ld %ld",&n,&m)!=EOF){p=1; if(n==1 || m==1 || n==0 || m==0) {printf("Boring\n");continue;} fo...
Fri Aug 12, 2005 9:47 pm
Forum: Volume 101 (10100-10199)
Topic: 10190 - Divide, But Not Quite Conquer!
Replies: 105
Views: 25060

10190-pls pls help!

i made more than 20 submissions 4 this pob. i dont find the mistake why it gets WA.any1 pls help me: #include<stdio.h> #include<math.h> int main() { long n,m,i,j,kk,kkk,p; double k,l; while(scanf("%ld %ld",&n,&m)!=EOF){p=1; if(n==1) {printf("Boring\n");continue;} else if(m==0 || n==0) {printf("Borin...
Sun Jul 10, 2005 10:00 pm
Forum: Volume 4 (400-499)
Topic: 400 - Unix ls
Replies: 93
Views: 18720
i think i outputted correctly.so why WA: #include<stdio.h> #include<string.h> int main(void) { char str[100][61],temp[61]; int c,r,i,j,k,n,s,t,ma,len[100],max; while(scanf("%d",&n) !=EOF){max=0; for(i=0;i<n;i++) {scanf("%s",str ); if(max<strlen(str )) max=strlen(str );} for(i=0;i<n-1;i++){ for(j=i+1...
Sun Jul 10, 2005 9:28 pm
Forum: Volume 4 (400-499)
Topic: 400 - Unix ls
Replies: 93
Views: 18720

400-WA any1 pls help

i had been stack in this prob. 4 many days.can any1 pls help me. what's wrong: #include<stdio.h> #include<string.h> int main(void) { char str[100][61],temp[61]; int c,r,i,j,k,n,s,t,len[100],max; while(scanf("%d",&n) !=EOF){max=0; for(i=0;i<n;i++) {scanf("%s",str ); if(max<strlen(str )) max=strlen(st...
Thu Jun 30, 2005 3:46 pm
Forum: Volume 4 (400-499)
Topic: 424 - Integer Inquiry
Replies: 96
Views: 21432

424-pls help

can any1 pls help me abt 424-integer inquiry my code below : #include<stdio.h> #include<string.h> int main(void) { char p[101][101],q[101][101],res[101]; int i,j,t,max,len[100],sum=0,c=0,k=0; for(i=0;;i++) {scanf("%s",&p );if(strcmp(p ,"0\0")==0) break; } max=i; for(i=0;i<max;i++) len =strlen(p ); f...
Sat Jun 25, 2005 8:57 pm
Forum: Volume 4 (400-499)
Topic: 499 - What's The Frequency, Kenneth?
Replies: 93
Views: 11633

499-PLS help

i dont understantd why my code outputs somethin strange for inputin 1st samp in. for 1st time. but when 2nd time i input somethin it outputs correctly. some 1 pls explain me whats wrong ? #include<stdio.h> int main(void) { char a[200],str[200],max; int i,j,k; while(gets(str)!=NULL){ max=0; for(i='a'...
Mon May 09, 2005 10:29 pm
Forum: Volume 103 (10300-10399)
Topic: 10324 - Zeros and Ones
Replies: 179
Views: 46071

10324-pls help me

can anyone pls explain me some things: 1. what does it mean by "input may be with end of file"? 2. what does gets(gets(str)) means? 3.what's wrong with my code : #include<stdio.h> #include<string.h> int main(void) { char str[1000000],ch; long int i,j,c,flag,temp,count=0,p,q; gets(str); while(str[0]!...
Mon May 09, 2005 10:29 pm
Forum: Volume 103 (10300-10399)
Topic: 10324 - Zeros and Ones
Replies: 179
Views: 46071

10324-pls help me

can anyone pls explain me some things: 1. what does it mean by "input may be with end of file"? 2. what does gets(gets(str)) means? 3.what's wrong with my code : #include<stdio.h> #include<string.h> int main(void) { char str[1000000],ch; long int i,j,c,flag,temp,count=0,p,q; gets(str); while(str[0]!...
Mon May 09, 2005 2:48 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 23575

10327-CE

i dont understand why CE with this simple sortin code.anyone pls help. #include<stdio.h> #include<conio.h> int main() { int i,j,count,temp,c; unsigned long a[1000]; while(scanf("%d",&c)!=EOF){ count=0; for(i=0;i<c;i++) scanf("%lu",&a ); for(i=0;i<c;i++){ for(j=i+1;j<c;j++){ if(a >a[j]){ temp=a[j]; a...
Fri May 06, 2005 8:50 pm
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 64312
yeah!!thanx i got AC
Fri May 06, 2005 3:00 pm
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 64312

10200-TLE pls help

i dont understand why i got TLE all the time when dealin with prime numbers.pls anyone tell me whats wrong with my code for 10200 : #include <stdio.h> #include <math.h> int isprime(long num); int main() { int a,b,i,prime,tot; long res,j,n; double per,t,p; while(scanf("%d %d",&a,&b)!=EOF){ prime=0; f...