Search found 39 matches

by krijger
Sun Sep 03, 2006 3:51 pm
Forum: Volume 110 (11000-11099)
Topic: 11078 - Open Credit System
Replies: 12
Views: 5905

Note that the first integer in the input is the number of cases. The input description does not explicitely state this. Treating it as the 'n' of the first case (and reading input until EOF) gives the right answer for all example cases, but will get WA on the judge.
by krijger
Sun Aug 13, 2006 6:08 pm
Forum: Volume 110 (11000-11099)
Topic: 11065 - A Gentlemen's Agreement
Replies: 19
Views: 8642

Take a look at problem 11069. Part of it can also be used for this problem.
by krijger
Tue May 30, 2006 6:44 pm
Forum: Volume 8 (800-899)
Topic: 896 - Board Game
Replies: 4
Views: 1860

Ok. I will do that.

I figured out it is a sort of nim game, but with lots of special cases.
by krijger
Tue May 30, 2006 5:45 am
Forum: Volume 8 (800-899)
Topic: 896 - Board Game
Replies: 4
Views: 1860

896 Board Game

After working on it for quite a long time, I still get WA on this problem. I've written a brute-force solver and for lengths up to 15, the answers match. I seriously suspect a bug in the input format / testdata, or there must be very tricky cases, which only show at lengths > 15. Could someone check...
by krijger
Tue Mar 21, 2006 1:26 am
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17901

I don't know. Haven't tried that. But if there are 'worst cases' in the jury-input (something like all A) I think it will.
by krijger
Tue Mar 21, 2006 1:18 am
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17901

Well that's were I used bitmasks. The i-th row of the pattern can end at (x,y) in the matrix iff i==0 or the (i-1)-th row of the pattern can end at (x-1,y). You can do this quickly with bitmasks: canhere=matchcurrow&((canprevrow<<1)|1). The problem is that you have 100 rows, and this won't fit in a ...
by krijger
Mon Mar 20, 2006 9:24 pm
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17901

I solved it with Aho-Corasik during the actual contest and I don't think a number of KMP's will be fast enough.
by krijger
Mon Mar 20, 2006 8:37 pm
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 17901

During the actual contest, I got accepted with a program which assumes all characters are 'a'-'z'. By the way, the time limit is quite tight. During the contest, I got AC in about 2.5 seconds (when the time limit was 5 seconds), with a pretty highly optimized algorithm. (it runs in linear time and u...
by krijger
Mon Mar 20, 2006 1:29 am
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8841

You're trying to find the i and j for which this function is maximal: |xi-xj|+|yi-yj|+|zi-zj| Suppose you know i, what do you know about j? (hint: there are 8 cases) Have I understood right that you propose to find vertexes that form сonvex polyhedron and then find maximum distance between this poi...
by krijger
Sun Mar 19, 2006 5:17 pm
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8841

Hi little joey. I am indeed 'Erik-Jan Krijgsman' from Holland and actually, I am part of the Dutch team that goes to the world finals ('MessedUp'). Yesterday we (me and one of my teammates, the other couldn't come) did a practice session for the world finals and it went pretty well, allthough we hop...
by krijger
Sun Mar 19, 2006 4:44 pm
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8841

You're trying to find the i and j for which this function is maximal:

|xi-xj|+|yi-yj|+|zi-zj|

Suppose you know i, what do you know about j? (hint: there are 8 cases)
by krijger
Thu Feb 02, 2006 1:47 pm
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 31507

Try this:

Code: Select all

Input:
5 5 6 7 8 16
by krijger
Thu Jan 26, 2006 5:43 pm
Forum: Volume 109 (10900-10999)
Topic: 10985 - Rings'n'Ropes
Replies: 11
Views: 4290

Yes, I have a O(N^3+NM) algorithm without bitmasks. But it is not really a variation of floyd's. It requires you to precalculate for every pair of nodes u,v how many edges incident to u are on a shortest path from u to v.
by krijger
Fri Oct 07, 2005 10:50 pm
Forum: Volume 109 (10900-10999)
Topic: 10923 - Seven Seas
Replies: 28
Views: 11681

My AC program also gives the same answers as Emilio's.

btw. In case 4 you can escape if you allow the ship to go 'outside the area', but I don't see how you can escape in case 6.
by krijger
Sat May 28, 2005 12:48 am
Forum: Other words
Topic: To the top finishers in the III Local Contest in Murcia
Replies: 10
Views: 4069

I use a base file with quite a lot of #includes, macro's, typedefs, etc. (77 unwrapped lines, 2211 non-space chars). I also have some code for bignums, max-flow, etc. but I didn't use any of that for this contest. The code sizes for my solutions, minus the size of my template (i.e. essentially the a...

Go to advanced search