## Search found 57 matches

- 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...

- 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...

- Sat Jan 31, 2004 4:49 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10038 - Jolly Jumpers
- Replies:
**445** - Views:
**77709**

- Fri Jan 30, 2004 7:35 pm
- Forum: Volume 7 (700-799)
- Topic: 713 - Adding Reversed Numbers
- Replies:
**142** - Views:
**39883**

- Tue Jan 27, 2004 8:02 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10533 - Digit Primes
- Replies:
**108** - Views:
**31224**

- 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...

- Mon Jan 26, 2004 2:46 pm
- Forum: Volume 4 (400-499)
- Topic: 496 - Simply Subsets
- Replies:
**48** - Views:
**9073**

- Sun Jan 25, 2004 7:40 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10573 - Geometry Paradox
- Replies:
**33** - Views:
**11778**

- 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...

- 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???

- 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.

- 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;...

- 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

- 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...

- 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

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