Search found 85 matches

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

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...
by medv
Wed Feb 18, 2004 8:40 am
Forum: Volume 103 (10300-10399)
Topic: 10399 - Optimus Prime
Replies: 14
Views: 5145

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 ...
by medv
Tue Dec 23, 2003 6:31 pm
Forum: Volume 105 (10500-10599)
Topic: 10502 - Counting Rectangles
Replies: 24
Views: 11918

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?
by medv
Sun Sep 21, 2003 7:47 pm
Forum: Volume 105 (10500-10599)
Topic: 10534 - Wavio Sequence
Replies: 44
Views: 7669

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...
by medv
Sat Aug 30, 2003 8:52 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 78703

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...
by medv
Mon Jul 28, 2003 9:49 pm
Forum: Volume 105 (10500-10599)
Topic: 10523 - Very Easy !!!
Replies: 63
Views: 22597

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.
by medv
Fri Jun 27, 2003 7:21 pm
Forum: Volume 105 (10500-10599)
Topic: 10500 - Robot maps
Replies: 45
Views: 13546

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...
by medv
Sat Jun 21, 2003 8:17 pm
Forum: Volume 6 (600-699)
Topic: 636 - Squares (III)
Replies: 7
Views: 3435

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...
by medv
Sat Jun 21, 2003 6:47 pm
Forum: Volume 104 (10400-10499)
Topic: 10445 - Make Polygon
Replies: 35
Views: 14466

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] - ...
by medv
Mon Jun 02, 2003 2:13 pm
Forum: Volume 5 (500-599)
Topic: 533 - Equation Solver
Replies: 6
Views: 2214

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...
by medv
Sun May 04, 2003 2:45 pm
Forum: Volume 103 (10300-10399)
Topic: 10303 - How Many Trees?
Replies: 19
Views: 3120

Thank you!

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

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.
by medv
Fri May 02, 2003 4:47 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31146

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...
by medv
Fri May 02, 2003 11:28 am
Forum: Volume 103 (10300-10399)
Topic: 10303 - How Many Trees?
Replies: 19
Views: 3120

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...
by medv
Tue Oct 29, 2002 8:47 pm
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 43817

Accepted 545

Cleaned

Go to advanced search