Just fixed the problem related to the wrong output in those test cases (checking a > l too soon).
Still gets TLE anyways.
Using
while not eof (input) do
as...
input line one
-- output result
input line two
-- output result
input ...
-- output result
Also tried while a > 0 TLE also.
Search found 9 matches
- Sun Oct 19, 2003 8:22 pm
- Forum: Volume 6 (600-699)
- Topic: 694 - The Collatz Sequence
- Replies: 46
- Views: 21954
- Sun Oct 19, 2003 7:54 pm
- Forum: Volume 6 (600-699)
- Topic: 694 - The Collatz Sequence
- Replies: 46
- Views: 21954
694 output
Working on 694. Running locally, the output isn't the expected (as presented on the problem descrip. page). Some examples:
3 100
expected: 8
program: 8
34 100
expected: 14
program: 14
75 250
expected: 3
program: 4 WRONG
101 304
expected: 26
program: 26
101 303
expected: 1
program: 2 WRONG
Also ...
3 100
expected: 8
program: 8
34 100
expected: 14
program: 14
75 250
expected: 3
program: 4 WRONG
101 304
expected: 26
program: 26
101 303
expected: 1
program: 2 WRONG
Also ...
- Sun Oct 19, 2003 5:27 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318271
- Sun Oct 19, 2003 4:36 pm
- Forum: Algorithms
- Topic: Find the simplest...
- Replies: 3
- Views: 2243
- Wed Oct 15, 2003 2:08 am
- Forum: Algorithms
- Topic: Find the simplest...
- Replies: 3
- Views: 2243
- Wed Oct 15, 2003 1:24 am
- Forum: Algorithms
- Topic: Find the simplest...
- Replies: 3
- Views: 2243
Find the simplest...
Hi.
Imagine there's somekind of maze and you need to find the best way to go from point A to point X.
How can/should the problems like that be aproached?
Example:
A guy needs to go from A to X. Between those two points there are two types
of obstacles * and "." He can go in any direction ...
Imagine there's somekind of maze and you need to find the best way to go from point A to point X.
How can/should the problems like that be aproached?
Example:
A guy needs to go from A to X. Between those two points there are two types
of obstacles * and "." He can go in any direction ...
- Sun Oct 12, 2003 3:29 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318271
- Sun Oct 12, 2003 2:33 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318271
- Sun Oct 12, 2003 2:13 am
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 318271
Re: Always WA in 100 [Pascal]
In http://acm.uva.es/problemset/pascal.html it saysOmShanti wrote:I don't know what is wrong:[pascal]program program100;
const
Niesk=0;
var
tab: array[1..1000000] of qword;
i,j,k,h,p: longint;
max,printed: qword;
[/pascal]
Can that be the reason for the error?Do NOT use LongInt type!