Search found 67 matches

by Erik
Mon Feb 26, 2007 4:56 pm
Forum: Volume 111 (11100-11199)
Topic: 11184 - Joyful Ride
Replies: 11
Views: 7262

He gave already:
Hadi wrote:You might like to try to find a pattern for 4*k and 4*k+3 :wink:
by Erik
Tue Feb 20, 2007 4:31 pm
Forum: Volume 111 (11100-11199)
Topic: 11170 - Cos(NA)
Replies: 22
Views: 13544

Hi,

it is also possible to express sin((N-1)A) as derivation of cos((N-1)A). This introduces another sin(A) when derivating the polynomial in cos(A) for cos((N-1)A).
Thus the sin(A)^2 begomes (1-cos(A)^2). This way only the last polynomial is needed.

Cu, Erik :)
by Erik
Sun Feb 18, 2007 4:18 pm
Forum: Volume 111 (11100-11199)
Topic: 11174 - Stand in a Line
Replies: 9
Views: 3715

Hi,

I had the exactly same idea.
Now you just have to think about what happens if you evaluate the recursive calls to solve!

Cu, Erik :)
by Erik
Sun Feb 18, 2007 3:51 pm
Forum: Volume 111 (11100-11199)
Topic: 11174 - Stand in a Line
Replies: 9
Views: 3715

Hi, I don't actually understand what your code means. But I can tell you I broke the problem down to a simple mathematical equation. The challenge then is evaluating it fast (it includes a factorial). My final (for now) solution is in O(n) for each test case, but it requires some calculations involv...
by Erik
Mon Jan 01, 2007 11:45 pm
Forum: Bugs and suggestions
Topic: 231
Replies: 1
Views: 1413

231

Hi,

recently the additional blank line at the end of the test case was correctly cut away.
But in the problem list for volume II there still is the exclamation mark with the hint:
You should write a blank line after the last case if you want to avoid Presentation Error. I'm sorry.
Cu, Erik :)
by Erik
Sun Oct 15, 2006 9:51 pm
Forum: Volume 3 (300-399)
Topic: 342 - HTML Syntax Checking
Replies: 31
Views: 12913

Hi,

I got it accepted.
The correct answers are

Code: Select all

Test Case 1
line 1: bad character in tag name.
Test Case 2
line 1: bad character in tag name.
Cu, Erik :)
by Erik
Sun Oct 15, 2006 8:05 pm
Forum: Volume 3 (300-399)
Topic: 342 - HTML Syntax Checking
Replies: 31
Views: 12913

Hi,

what should be the output for

Code: Select all

2
hi<BL
U> go </BLU> too
1
<A
0
Cu, Erik :)
by Erik
Sun Oct 15, 2006 11:26 am
Forum: Algorithms
Topic: USACO Sweet Butter
Replies: 3
Views: 2612

Hi,

you should use adjacency list instead of a matrix.
Using a matrix you kill the performance boost of the heap. This way each dijkstra is O(V^2) and hence the overall performance O(V^3).
With the list you get O(V*E*log V).

Cu, Erik :)
by Erik
Sat Oct 14, 2006 10:07 am
Forum: Algorithms
Topic: USACO Sweet Butter
Replies: 3
Views: 2612

Hi,

I solved that one with Dijkstra and a simple binary Heap. My program needed 0.16 seconds for case #7 and the last case #10 took 0.65.
Somewhere you must have some very inefficient part in your code. Maybe it's reading the input?

Cu, Erik :)
by Erik
Sun Oct 08, 2006 8:39 am
Forum: Volume 6 (600-699)
Topic: 661 - Blowing Fuses
Replies: 67
Views: 20726

Hi,

this is a multiple input problem. There are many testcases in it. Hence if you break from the loop that way, you might read wrong data when processing the next testcase.

Cu, Erik :)
by Erik
Tue Oct 03, 2006 8:46 pm
Forum: Off topic (General chit-chat)
Topic: Jubilee: 5,000,000 submissions
Replies: 1
Views: 6985

Jubilee: 5,000,000 submissions

Congratiulations to acm.uva.es!
Today the 5,000,000th submission reached the judge: http://acm.uva.es/problemset/statusjudge.php?h=5000000
And guess what: it got Accepted.

So let's go for the next million ;)
by Erik
Sun Oct 01, 2006 11:04 am
Forum: Algorithms
Topic: One question about Tree
Replies: 3
Views: 2043

Hi, proof by induction. It is trivial to construct the tree for n=2. Now suppose we want to construct tree for n>2. There must be some i (1<=i<=n) so that d_i>1. Because if all d_i where 1, the sum of d_i is n which can't equal 2*(n-1), as n>2. There also must be some j (1<=j<=n) so that d_j=1. Beca...
by Erik
Sat Sep 30, 2006 9:56 am
Forum: Bugs and suggestions
Topic: Empty lines in input for problem 202
Replies: 1
Views: 1286

Empty lines in input for problem 202

Hi, problem description for 202 says: Each line of the input file consists of an integer numerator, which is nonnegative, followed by an integer denominator, which is positive. None of the input integers exceeds 3000. End-of-file indicates the end of input. But in fact, there are empty lines. This m...
by Erik
Mon Sep 11, 2006 9:27 am
Forum: Volume 100 (10000-10099)
Topic: 10089 - Repackaging
Replies: 41
Views: 14957

Hi,

could anyone please post some test data?

Cu, Erik :)
by Erik
Thu Sep 07, 2006 2:04 pm
Forum: Volume 105 (10500-10599)
Topic: 10505 - Montesco vs Capuleto
Replies: 73
Views: 37613

Hi,

In all testcases you have wrong there are non-bipartite graphs.
So obviously you handle these the wrong way.

Cu, Erik :-)

Go to advanced search