Search found 69 matches

by jurajz
Thu Jul 24, 2008 11:20 pm
Forum: Volume 100 (10000-10099)
Topic: 10017 - The Never Ending Towers of Hanoi
Replies: 19
Views: 5559

Re: 10017 - The Never Ending Towers of Hanoi

Hi Nazmul Quader Zinnuree, I think, that your mistake is here: int stack[3][100] You use three rows (correct), but only 100 columns (incorrect). Problem statement says, that n is in range from 1 to 250, but it seems, that you assume only 100. Try to correct it and than you can try this three test ca...
by jurajz
Thu Jul 24, 2008 11:02 pm
Forum: Volume 114 (11400-11499)
Topic: 11459 - Snakes and Ladders
Replies: 33
Views: 15144

Re: 11459 - Snakes and Ladders

Robert Gerbicz wrote:Today there was a rejudge for the problem. Now I've got AC, proving that my posted algorithm is good. Among the 26 users who tried it there are 16 users who got AC.
Thank you Robert, I have AC too. But now I don't know, what is AC code. (I made 14 submissions, only one, 13th, is AC :D)
by jurajz
Sat Jun 28, 2008 8:25 am
Forum: Volume 114 (11400-11499)
Topic: 11459 - Snakes and Ladders
Replies: 33
Views: 15144

Re: 11459 - Snakes and Ladders

I tried solve this problem too. In my opinion it is straightforward, but I cannot find mistake in my code. Only 2 AC during contest and no AC here after 148 submission, maybe there is a mistake in problem description. :roll: I checked the input. I find out this: - No string length (string= set of co...
by jurajz
Thu Jun 26, 2008 8:44 am
Forum: Volume 9 (900-999)
Topic: 932 - Checking the N-Queens Problem
Replies: 18
Views: 9417

Re: 932 - Checking the N-Queens Problem

WARNING: Don't try to solve this problem with a Pascal program. I believe there is some problem with the I/O in Pascal with the input file. I tried the following extremely simple program: program hang932; var TC, i, j : Integer; car : Char; begin while eoln and not eof do readln; (* skip leading ne...
by jurajz
Thu Jun 26, 2008 8:39 am
Forum: Volume 9 (900-999)
Topic: 932 - Checking the N-Queens Problem
Replies: 18
Views: 9417

Re: 932 - Checking the N-Queens Problem

Thanks to RC's for his notice about more test cases. I have lot of WA's and when I made only one change - assuming more test cases, I have AC. The problem description should be revised for real...
by jurajz
Tue Jun 24, 2008 11:24 pm
Forum: Volume 114 (11400-11499)
Topic: 11451 - Water restrictions
Replies: 23
Views: 3400

Re: 11451 - Water restrictions

I solved it with bruteforce too ;) For my solution are important small values for number of sprinklers (10) and maximum total flow (10). Although I am 37th of 37 solvers, my time is not horrible (2.470 seconds, time limit for this problem is 5.000 seconds).
by jurajz
Sun Jun 22, 2008 9:26 pm
Forum: Volume 114 (11400-11499)
Topic: 11451 - Water restrictions
Replies: 23
Views: 3400

Re: 11451 - Water restrictions

According to my program, the solution is 19 with d = [ 1, 2, 1, 0, 1, 2 ]. With these, positions that are irrigated are: 1, 3, 4, 5, 7, 8, 9, 11, 12, 14, 15, 16, 18 and 19. total: 14 locations. Why the answer is 19? I 've misunderstood the problem... Can you please tell me what the problem wants an...
by jurajz
Sun Jun 15, 2008 8:15 pm
Forum: Volume 114 (11400-11499)
Topic: 11451 - Water restrictions
Replies: 23
Views: 3400

Re: 11451 - Water restrictions

>>>>jurajz some of ur testcases are not valid. Here maximum number of sprinklers is 10. Hi mmonish, you are right. I overlooked this restriction. I fixed this mistake. Here are another 30 random-generated test cases. Input: 30 13 1 10 8 2 10 7 2 3 4 5 6 8 9 7 1 2 1 4 2 2 1 15 3 10 11 12 4 4 1 1 17 ...
by jurajz
Sun Jun 15, 2008 1:24 pm
Forum: Volume 114 (11400-11499)
Topic: 11451 - Water restrictions
Replies: 23
Views: 3400

Re: 11451 - Water restrictions

Hi Rupak, there are thirty test cases, randomly generated (restrictions from problem description are hold). 30 10 5 3 4 5 7 9 6 2 1 4 1 1 17 6 3 4 9 11 14 15 2 2 3 2 1 2 1 20 16 2 3 4 5 6 8 9 10 11 12 14 15 16 17 18 19 7 1 2 2 1 1 4 1 5 5 3 1 5 2 1 2 1 11 1 9 5 1 5 3 2 3 4 5 1 1 1 15 11 3 4 5 6 7 8 ...
by jurajz
Sat Jun 07, 2008 1:35 am
Forum: Volume 104 (10400-10499)
Topic: 10401 - Injured Queen Problem
Replies: 19
Views: 10209

Re: 10401 - Injured Queen Problem

I think, that there is a mistake in input description. :-? Input description says, that "Each line expresses a certain board status". But it seems, that there are blank lines. I have many WA's. When I add one line in my program (skipping blank lines), I have AC. So if anybody has WA, beware of blank...
by jurajz
Thu May 22, 2008 11:49 pm
Forum: Volume 114 (11400-11499)
Topic: 11451 - Water restrictions
Replies: 23
Views: 3400

Re: 11451 - Water restrictions

Another WA during contest because of not so correct problem statement :-? I agree with andmej, from problem statement, if unique sprinkler is on position X, and c =0, then it will irrigate positions from X-0 to X+0, that means one position (position X), not nothing. I fixed my WA program from the co...
by jurajz
Mon Mar 03, 2008 12:37 am
Forum: Volume 111 (11100-11199)
Topic: 11149 - Power of Matrix
Replies: 42
Views: 20139

I don't read your code in parts of computation with matrices, but i think, I found, where may be a problem. Variable w is initially set on 0, after first test case is set on 1. This cause, that before each case except the first you write a blank line. But problem description says, that there have to...
by jurajz
Tue Feb 05, 2008 11:10 pm
Forum: Volume 8 (800-899)
Topic: 889 - Islands
Replies: 3
Views: 3410

One more problem can be here, when we try submit Pascal code. I submitted code in Pascal, I got TLE (3.000). I rewrite my code to C and have AC in 1.890. That means, the input is huge and Pascal I/O is too slow for testing input of this problem. Maybe my algorithm is not effective, but in C it is en...
by jurajz
Sat Jan 26, 2008 12:22 pm
Forum: Volume 114 (11400-11499)
Topic: 11401 - Triangle Counting
Replies: 19
Views: 10668

I used same method as you and have AC in 0.030. My precalculation is in O(n). If you have correct answer for n, then you can get correct answer for n+1 in O(1). Try to find it. If you used big int, it is not needed, int64 (in C/C++ long long) is enough. One warning to this problem: The input is term...
by jurajz
Fri Jan 04, 2008 10:34 pm
Forum: Volume 6 (600-699)
Topic: 631 - Microzoft Calendar
Replies: 11
Views: 6281

sluga wrote:Which years before doors are considered leap? Those like 4bd or those like 5bd? I am asking because for example, 5bd is 8 years before 4, which is a leap year.
I assumed, that leap years before doors are 4bd, 8bd, 12bd, ... and I got AC.

Go to advanced search