## Search found 85 matches

Tue Mar 02, 2004 5:04 pm
Forum: Volume 104 (10400-10499)
Topic: 10404 - Bachet's Game
Replies: 10
Views: 4637

### 10404 Bashe Game. TLE! Wy?

Bashe Game Wy TLE? How can I make my program more quicker? program p10404; const MAX = 1000000; MM = 10; var i,j,m,n:longint; a:array[1..MM] of longint; mas:array[0..MAX] of boolean; flag:boolean; begin while not eof do begin while eoln do readln; read(n,m); mas[0] := True; for i:=1 to m do read(a[i...
Wed Feb 18, 2004 8:40 am
Forum: Volume 103 (10300-10399)
Topic: 10399 - Optimus Prime
Replies: 14
Views: 5174

### 10399 - Optimus Prime. Help me with solution for large n

Hi everybody! I am trying to solve 10399 problem for two weeks already, but can't find algorithm for large n. For small n (when gap of composites of length n are in integers), the game can be solved efficiently. It's like Bashe game. If, for example, n = 10. The smallest p, for which p+1,...p+n are ...
Tue Dec 23, 2003 6:31 pm
Forum: Volume 105 (10500-10599)
Topic: 10502 - Counting Rectangles
Replies: 24
Views: 11935

### 10502 - Help me! How to count rectangles correctly?

How to count rectangles correctly?
One 1 - it's a rectangle. Tho adacent 1's is a rectangle.
And so on.

In

4
3
110
101
111
011

I counted 27 rectangles, but not 22

In

3
3
111
101
111

there are 20, but I counted 27.

Can smb tell me, how correctly to count rectangles?
Sun Sep 21, 2003 7:47 pm
Forum: Volume 105 (10500-10599)
Topic: 10534 - Wavio Sequence
Replies: 44
Views: 7707

### 10534 WA - Help me!

I run twice Longest Increasing sequence during O(n * log(n)), but get WA! Is there any tricks? Or where is my mistake? program p10534; const max = 10010; var n,i,j,mx,counter:integer; b,e,middle:integer; left,right,m,l,r:array[1..max] of integer; begin while not eof do begin readln(n); FillChar(m,Si...
Sat Aug 30, 2003 8:52 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 79379

### 10038 WA - help me!

I don't know why WA! program p10038; const max = 3010; var i,temp,n:integer; m:array[1..max] of integer; used:array[1..max] of boolean; flag:boolean; begin while not eof do begin read(n); for i:=1 to n do read(m[i]); for i:=1 to n do used[i] := False; flag := True; for i:=1 to n-1 do begin temp := m...
Mon Jul 28, 2003 9:49 pm
Forum: Volume 105 (10500-10599)
Topic: 10523 - Very Easy !!!
Replies: 63
Views: 22655

### 10523 - Very Easy !!!

I got WA. Help me!
I think my WA because of output

My test input:
3 3
4 4
0 100
1 100
19 50
19 150

My test output:
1.020000E+02
1.252000E+03
0.000000E+00
5.050000E+03
4.567182E+65
1.029086E+194

Am I right?
Thank you.
Fri Jun 27, 2003 7:21 pm
Forum: Volume 105 (10500-10599)
Topic: 10500 - Robot maps
Replies: 45
Views: 13583

### 10500 WA! Why?

I read everything what is told here about this problem, but got WA. Help me, WHY? program p10500; var moves,x,y,px,py,i,j:integer; map,robot:array[1..10,1..10] of char; ch:char; function canmove(xx,yy:integer):boolean; begin if ((xx < 1) or (yy < 1) or (xx > x) or (yy > y) or (robot[xx,yy] <> '?') o...
Sat Jun 21, 2003 8:17 pm
Forum: Volume 6 (600-699)
Topic: 636 - Squares (III)
Replies: 7
Views: 3442

### 636 - WA. Why?

Why WA? Help me, please! program p636; var s:string; b,i,base,len,n:longint; mas:array[1..100] of integer; begin while true do begin readln(s); len := length(s); if s = '0' then break; for i:=1 to len do mas[i] := Ord(s[i]) - Ord('0'); b := 2; for i:=1 to len do if mas[i] > b then b := mas[i]; for b...
Sat Jun 21, 2003 6:47 pm
Forum: Volume 104 (10400-10499)
Topic: 10445 - Make Polygon
Replies: 35
Views: 14521

### 10445 Why WA?

Why WA? Give me some tests or send me AC program, please! ------------------------------------------------------------- program p10445; var x,y:array[0..1000] of integer; i,n:integer; Sarea,angle,min,max:double; function tri(one,two,three:integer):integer; begin tri := (x[two] - x[one])*(y[three] - ...
Mon Jun 02, 2003 2:13 pm
Forum: Volume 5 (500-599)
Topic: 533 - Equation Solver
Replies: 6
Views: 2224

### 533 - Why WA? My Code seems correct

Hi! Please, tell me, why WA? Give me some tests where my program is wrong. Here is my code: program p533; var Stack: array[1..100] of double; Letter,crk:char; stroka:String; up,Eq,ptr,Stack_ptr:integer; b,c,x,x1:double; procedure Push(Number:double); begin Stack[Stack_ptr]:=Number; Inc(Stack_ptr); e...
Sun May 04, 2003 2:45 pm
Forum: Volume 103 (10300-10399)
Topic: 10303 - How Many Trees?
Replies: 19
Views: 3163

### Thank you!

Thank you very much!
I got accepted!
Do you have some difficults in solving? - I will help you (if I can)
Sun May 04, 2003 12:17 pm
Forum: Volume 103 (10300-10399)
Topic: 10303 - How Many Trees?
Replies: 19
Views: 3163

### My program seems correct - but WA

Thank you. Yes, my program gives correct solution when n=1000.
I tried to rewrite it in C, but also gets WA.

If you have accepted this problem, please - send me your solution.
Fri May 02, 2003 4:47 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31454

### 401 WA! Help me anyboby, please!

Why do I have WA? What's wrong in my program? Help me, please! My code is below. program p401; var palin,mirr:boolean; Rev:array[0..255] of integer; i:integer; s:string; function palindrome(s:string):boolean; var i,j:integer; begin i := 1; j := length(s); while (i <= j) do begin if s[i] <> s[j] then...
Fri May 02, 2003 11:28 am
Forum: Volume 103 (10300-10399)
Topic: 10303 - How Many Trees?
Replies: 19
Views: 3163

### 10303 Why WA???

Help me please to solve 10303. I use formula f(n) = 1/(n+1) * (2n choose n) = (n+2)*(n+3)*...*(2n) / (1*2*...*n). All my tests seems right. Why WA? I tried to change readln to read, integer to longint - but it didn't help me. Help me if you can. My code is here: program How_Many_Trees_10303; const m...
Tue Oct 29, 2002 8:47 pm
Forum: Volume 5 (500-599)