Search found 28 matches

by kn
Sat Jun 09, 2007 12:20 pm
Forum: Volume 4 (400-499)
Topic: 439 - Knight Moves
Replies: 33
Views: 11090

Jan wrote:Try the case.

Input:

Code: Select all

a2 b1
Output:

Code: Select all

To get from a2 to b1 takes 2 knight moves.
Hope it helps.
finally I figured out my silly bug...THX Jan, again :)
but after I changed it...still WA...:(

Code: Select all

ACed...
Two silly bugs...concerning indexes...sigh=.=
by kn
Thu Jun 07, 2007 10:51 pm
Forum: Volume 4 (400-499)
Topic: 439 - Knight Moves
Replies: 33
Views: 11090

No runtime error now
bfs should work well now, yet another bug occur....
by kn
Fri May 18, 2007 11:41 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 23206

Try this case input 10 output 10 is the sum of 3 and 7. the difference between the two primes must be positive. After knowing that I had this misconception (not knowing that the diff must be +ve =.=) And wrongly thought that 1 is considered as a prime number in this question... Finally...AC!! THX V...
by kn
Sat May 12, 2007 9:33 pm
Forum: Volume 103 (10300-10399)
Topic: 10311 - Goldbach and Euler
Replies: 98
Views: 23206

HI.....
I used bitwise sieve, and it seems that my program can sieve all those prime numbers....

I wonder why the following piece of code receives a WA...

Code: Select all

AC!! THX VERY MUCH!
THX FOR THE CORRECT I/O!
by kn
Thu May 10, 2007 3:04 pm
Forum: Volume 5 (500-599)
Topic: 516 - Prime Land
Replies: 23
Views: 6563

1. I usually use gets() and strtok() to parse this kind of input.. 2. floating point exception usually caused by "divide by zero".. and I think your program has the chance to get it.. I used "strtok" successfully to remove that complicated part.. Yes, floating pt exception is caused by "division by...
by kn
Mon Apr 30, 2007 9:50 pm
Forum: Volume 5 (500-599)
Topic: 524 - Prime Ring Problem
Replies: 74
Views: 19234

Well, 2 even numbers can never be neighbours;
2 odd numbers can never be neighbours.
by kn
Mon Apr 30, 2007 9:45 pm
Forum: Volume 5 (500-599)
Topic: 516 - Prime Land
Replies: 23
Views: 6563

Being a newbie, this time I encounter "FLOATING POINT EXCEPTION" According to the question, we have to read an unknown number of pairs of inputs (prime, exponent)... By which I mean, I cannot determine the total number of inputs before hand... I have to use "getchar()" to read the whole line, until ...
by kn
Fri Apr 27, 2007 7:22 pm
Forum: Volume 3 (300-399)
Topic: 369 - Combinations
Replies: 101
Views: 17446

[CORRECT!!] (intput) 100 90 100 50 99 40 100 6 20 5 18 6 0 0 (output) 1591253560 445776180 445776180 1192052400 15504 18564 (THE TEST DATA WHICH SOMEBODY TOLD ME IS CORRECT) 8) Well, it's just because the online judge does not use large test cases.. In fact, C(100, 50) = 824774048748168690076042183...
by kn
Thu Apr 26, 2007 4:18 pm
Forum: Volume 1 (100-199)
Topic: 129 - Krypton Factor
Replies: 25
Views: 2548

For input... 69 3 72 3 0 0 Which outputs are correct? ABAC ABCA CBAB CABA CABC ACBA CABA CBAB CABA CABC ACBA BCAB ACBA BCAC BACA BACB[*nospace]\n 64\n ABAC ABCA CBAB CABA CABC ACBA CABA CBAB CABA CABC ACBA BCAB ACBA BCAC BACA BACB[*nospace]\n ABC\n 67 ABAC ABCA CBAB CABA CABC ACBA CABA CBAB CABA CAB...
by kn
Thu Apr 26, 2007 3:08 pm
Forum: Volume 9 (900-999)
Topic: 918 - ASCII Mandelbrot
Replies: 11
Views: 3856

Your advice helps...thx...:D

Yet.. I'm confused by the dimension...
There should be sth wrong in the for loop...
making me receiving WA..

Code: Select all

ACed[code]
by kn
Wed Apr 25, 2007 1:22 pm
Forum: Volume 9 (900-999)
Topic: 918 - ASCII Mandelbrot
Replies: 11
Views: 3856

Sorry, one silly question:
For the iteration,
Z = Z^2 + C

what is C?
I have read through the question for several times
but still can't figure out what C is...
by kn
Wed Apr 25, 2007 11:11 am
Forum: Volume 1 (100-199)
Topic: 129 - Krypton Factor
Replies: 25
Views: 2548

PE for 129

Sorry for opening new threads... I tried for 1x times, still got PE please help me... here's my piece of code #include <stdio.h> #include <stdio.h> #define MAX_LENGTH 1000 /* MAX LENGTH OF SEQ */ int L; int n; int index=0; int counter=0; char seq[MAX_LENGTH+1]; void recursion(); void printseq(); mai...
by kn
Mon Apr 23, 2007 12:39 am
Forum: Volume 1 (100-199)
Topic: 129 - Krypton Factor
Replies: 25
Views: 2548

129 PE

I tried for 1x times, still got PE please help me... #include <stdio.h> #include <stdio.h> #define MAX_LENGTH 1000 /* MAX LENGTH OF SEQ */ int L; int n; int index=0; int counter=0; char seq[MAX_LENGTH+1]; void recursion(); void printseq(); main(){ int i; while(scanf("%d", &n)!=EOF){ scanf("%d", &L);...

Go to advanced search