Search found 22 matches

by jhonny_yang
Fri Dec 17, 2004 5:48 pm
Forum: Volume 4 (400-499)
Topic: 489 - Hangman Judge
Replies: 52
Views: 15260

confuse 489 with online judge

#include <stdio.h> #include <string.h> int main() { int n,i,j,count; char target[256],source[256]; while (scanf("%d\n",&n)==1){ if (n<0)break; gets(target); gets(source); for (j=0;source[j];j++){ if(source[j]==' '){ for (count=j+1;source[count];count++){ source[count-1]=source[count]; } source[coun...
by jhonny_yang
Fri Dec 17, 2004 5:25 pm
Forum: Volume 4 (400-499)
Topic: 450 - Little Black Book
Replies: 57
Views: 6764

Larry wrote:Why did you write your own qsort?

Not saying it's wrong, but more chances to be wrong..
changes my qsort will solve the prob ?
by jhonny_yang
Thu Dec 16, 2004 5:23 pm
Forum: Volume 4 (400-499)
Topic: 450 - Little Black Book
Replies: 57
Views: 6764

450 Grazy

I almost get grazy about this easy problem [c] #include <stdio.h> #include <string.h> typedef struct{ char name[80]; char country[80]; char department[80]; char homephone[80]; char workphone[80]; char campusbox[80]; }DataStruct; void Swap(DataStruct *a, DataStruct *b) { DataStruct temp; strcpy(temp....
by jhonny_yang
Thu Dec 16, 2004 5:21 pm
Forum: Volume 103 (10300-10399)
Topic: 10370 - Above Average
Replies: 62
Views: 19726

Thx

little joey wrote:There can be as many as 1000 students in a class, but you only reserve memory for 500.
Change it and you'll get AC.
hiks ... thx bro. It's experience ... find it about month
by jhonny_yang
Wed Dec 15, 2004 3:38 pm
Forum: Volume 103 (10300-10399)
Topic: 10370 - Above Average
Replies: 62
Views: 19726

10370 WA Why ???

I got this wrong but i already seek it for month didnt found what is the bug : [c] #include <stdio.h> int main() { long n,jlhMurid,i,jk,ehm[500],average,nilai; scanf("%ld",&n); for (i=0;i<n;i++){ scanf("%ld",&jlhMurid); nilai=0;average=0; for (jk=0;jk<jlhMurid;jk++){ scanf("%ld",&ehm[jk]); average+=...
by jhonny_yang
Mon Nov 22, 2004 6:25 pm
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 16452

printf ("<need one space> Case %lld: A = %lld, limit = <you add more space>%lld, number of terms = %lld",no,begin,limit,count);

i found the error look at space
by jhonny_yang
Fri Nov 19, 2004 5:21 pm
Forum: Volume 102 (10200-10299)
Topic: 10220 - I Love Big Numbers !
Replies: 18
Views: 7838

Re: TLE 10220.

Zhao Le wrote:Can any one tell me the way how can speed up the #10220?

I got TLE. :(
using array only 10000 , save the result into the array. that's linear time
by jhonny_yang
Fri Nov 19, 2004 5:20 pm
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 63575

why this problem comes to prime number? that's a faktorial .. using bignum library to solve this prob. it's easy
by jhonny_yang
Fri Nov 12, 2004 6:40 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 30313

Re: OH CRAP!

your method is too slow .............and "TIMELIMITEXCEEDED" is happened :x :x :x OH! CRAP~~~~~~ I'm using ... method typedef struct{ int low,high; int Number,Sequence; } Data; Data Buff[1000]; I save all in buff and the counting it. It's more fast. Another trick : 3*n+1 -> but the limit is integer...
by jhonny_yang
Fri Nov 12, 2004 8:48 am
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 24555

Re: Cul de sac.

Today i try to using sqrt() like find the prime number 100 = 10 * 10 it's impossible divide the number large than 10 in this case. So you can add the range below than sqrt(). and then do this : if (number%divisor==0){ Counter++; if (number/divisor!=divisor)Counter++; } that so solve like 2*50 and n...
by jhonny_yang
Fri Nov 12, 2004 5:22 am
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 24555

Re: Cul de sac.

Today i try to using sqrt() like find the prime number 100 = 10 * 10 it's impossible divide the number large than 10 in this case. So you can add the range below than sqrt(). and then do this : if (number%divisor==0){ Counter++; if (number/divisor!=divisor)Counter++; } that so solve like 2*50 and no...
by jhonny_yang
Fri Oct 15, 2004 5:21 pm
Forum: Volume 4 (400-499)
Topic: 443 - Humble Numbers
Replies: 82
Views: 7811

Ghust_omega wrote:Hi !! jhonny_yang i summit your code like you posted here and gives AC try to summit the source code on-line

Hope it Helps
Keep posting !! :D
It's Really Strange ... Then So much my code will like this hiks ... Can you explain what's going on ?
by jhonny_yang
Tue Oct 05, 2004 5:32 pm
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 24555

294 WA

Please give me some input ... Dunno why is error [c] #include <stdio.h> #include <io.h> #include <fcntl.h> int main() { unsigned long atas,bawah,bilangan; int n,i,j,hasil,max,jlh; scanf("%d",&n); for (jlh=0;jlh<n;jlh++){ scanf("%ld %ld",&bawah,&atas); max=0;bilangan=0; for (i=bawah;i<=atas;i++) { ha...
by jhonny_yang
Tue Oct 05, 2004 5:29 pm
Forum: Volume 4 (400-499)
Topic: 443 - Humble Numbers
Replies: 82
Views: 7811

Cry for 443

Can Any body tell what is my wrong ? [c] #include <stdio.h> unsigned long Min(long Hasil2, long Hasil3, long Hasil5, long Hasil7) { long Temp[4],max; int i; Temp[0]= Hasil2; Temp[1]=Hasil3; Temp[2]=Hasil5; Temp[3]=Hasil7; max=Temp[0]; for (i=1;i<4;i++){ if (Temp <max){ max=Temp ; } } return max; } i...
by jhonny_yang
Sun Oct 03, 2004 10:29 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 60917

Re: 10035 Error?

give space at your all output : cout << count << " carry operations." << endl; to cout << count << " carry operations.<space>" << endl; but it AC(P.E) my program is P.E too i don't know why ? But i'm not change your program and accepted maybe cause of your email. please try at //@END_OF_SOURCE_CODE...

Go to advanced search