Search found 57 matches

by pavelph
Sat Jan 31, 2004 10:56 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 77709

Sorry, I know java very and very bad. All that I can help you is my algo: 1) read input to array a[1..n] of integer 2) create other array b[1..n] of boolean for i=1 to n-1 do if |a[i] - a[i+1]|>=n then /Not jolly/ else b[|a[i] - a[i+1]|]:=true for i=1 to n-1 if not b[i] then /Not jolly/ else {if b[i...
by pavelph
Sat Jan 31, 2004 6:43 pm
Forum: Volume 5 (500-599)
Topic: 572 - Oil Deposits
Replies: 39
Views: 16010

572 - Oil Deposits

I use algorithm that 1) read input to g: array [1 .. n, 1 .. n] of boolean where g[i, j]=true if [i, j]='@'. 2) for this problem graph consists of nodes(=g) and two nodes [i1, j1] & [i2, j2] joined if |i1-12|<=1 and |j1-j2|<=1. 3) for this graph I start BFS. I think that it is right algorithm. But I...
by pavelph
Sat Jan 31, 2004 4:49 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 77709

Hm... You have very big code and I can't understand it. Please write steps of algo that you program do.
by pavelph
Fri Jan 30, 2004 7:35 pm
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 39883

No, I think that Sohel has problem in other way ( in my program I used array [1 .. 500] and get AC).
Sohel, maybe your program write zeros at the begin of line or at the end of it.
by pavelph
Tue Jan 27, 2004 8:02 pm
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 31224

Oh, yes, of course :) It's really very easy.
Thank you very much, now I have got AC on 10533 in 5 sec. :wink:
by pavelph
Mon Jan 26, 2004 9:08 pm
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 31224

TLE :(

Hi! I have TLE on this problem, but I don't know how I can make my program faster. I have algo that: 1) get_primes_numbers (Eratosphean) 2) get_digit_primes_numbers It makes d: array [1 .. 1000000] of boolean and d =true if i - digit prime. And this two procedures works <1 sec. !!! It means that ver...
by pavelph
Mon Jan 26, 2004 2:46 pm
Forum: Volume 4 (400-499)
Topic: 496 - Simply Subsets
Replies: 48
Views: 9073

I have AC on this problem and if you want I can help you:
give me some inputs and I will give you right outputs.
by pavelph
Sun Jan 25, 2004 7:40 pm
Forum: Volume 105 (10500-10599)
Topic: 10573 - Geometry Paradox
Replies: 33
Views: 11778

I think that with <const t> and different <Radius of big circle> we will have different answers :-?
by pavelph
Sat Jan 24, 2004 11:48 pm
Forum: Volume 105 (10500-10599)
Topic: 10515 - Powers Et Al.
Replies: 124
Views: 29195

I know the trick of finding the repeated sequence of [the last digit of m] poweres n to get the same correct answer, but could anyone please explain why the last two digits of n is enough? You can explain (on paper) that all periods of last digit are 1, 2 or 4 - for different digit. And it is enoug...
by pavelph
Sat Jan 24, 2004 10:27 pm
Forum: Volume 105 (10500-10599)
Topic: 10573 - Geometry Paradox
Replies: 33
Views: 11778

10573 - Help please

As I understand if in input "t" then write “Impossible.” else write area of grey part. Am I right???
by pavelph
Sun Jan 18, 2004 12:48 pm
Forum: Volume 6 (600-699)
Topic: 623 - 500!
Replies: 187
Views: 43157

:)

It's very funny: the name of problem is 500!, but you must to solve 1000! :) I had got 3 WA before find that input can has nubers>500. :roll:
by pavelph
Wed Jan 14, 2004 10:57 pm
Forum: Volume 1 (100-199)
Topic: 122 - Trees on the level
Replies: 103
Views: 9808

WA

Why WA? My program doesn't build tree, it only sort strings (like 'LR', 'LLL' etc). I think it is enough to solve this problem. But my program has some bug. Please help me to find it. [pascal] Program acm122; {About BIN trees} const kolichestvo = 300; type types = array [0 .. kolichestvo] of string;...
by pavelph
Wed Jan 14, 2004 7:17 pm
Forum: Volume 4 (400-499)
Topic: 497 - Strategic Defense Initiative
Replies: 144
Views: 20741

Multiple input

I have already siad that this problem have multiple input. If you didn't know what it meens you can see it at http://acm.uva.es/problemset/minput.html
by pavelph
Mon Jan 12, 2004 7:40 pm
Forum: Volume 4 (400-499)
Topic: 497 - Strategic Defense Initiative
Replies: 144
Views: 20741

Hi, kiha. You can't use only readln becouse this problem have multiple input! and if you don't check that s<>'' then program reads all input file as one case and of course you will have WA. About algo of this problem you can read here: http://www.comp.nus.edu.sg/~stevenha/programming/prog_dp1.html c...
by pavelph
Mon Jan 12, 2004 12:46 am
Forum: Volume 4 (400-499)
Topic: 497 - Strategic Defense Initiative
Replies: 144
Views: 20741

About VAL

Val(s: string, n: integer, code: integer) is procedure that do:
n:=integer(s).
Example: If s='123' then n -> 123;
If s -- integer than code = 0
else code = position where were error.
n can be also byte, longint, real etc

Go to advanced search