## Search found 39 matches

Sun Sep 03, 2006 3:51 pm
Forum: Volume 110 (11000-11099)
Topic: 11078 - Open Credit System
Replies: 12
Views: 6016
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.
Sun Aug 13, 2006 6:08 pm
Forum: Volume 110 (11000-11099)
Topic: 11065 - A Gentlemen's Agreement
Replies: 19
Views: 8752
Take a look at problem 11069. Part of it can also be used for this problem.
Tue May 30, 2006 6:44 pm
Forum: Volume 8 (800-899)
Topic: 896 - Board Game
Replies: 4
Views: 1893
Ok. I will do that.

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

### 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...
Tue Mar 21, 2006 1:26 am
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 18098
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.
Tue Mar 21, 2006 1:18 am
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 18098
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 ...
Mon Mar 20, 2006 9:24 pm
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 18098
I solved it with Aho-Corasik during the actual contest and I don't think a number of KMP's will be fast enough.
Mon Mar 20, 2006 8:37 pm
Forum: Volume 110 (11000-11099)
Topic: 11019 - Matrix Matcher
Replies: 43
Views: 18098
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...
Mon Mar 20, 2006 1:29 am
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8965
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...
Sun Mar 19, 2006 5:17 pm
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8965
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...
Sun Mar 19, 2006 4:44 pm
Forum: Volume 110 (11000-11099)
Topic: 11012 - Cosmic Cabbages
Replies: 29
Views: 8965
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)
Thu Feb 02, 2006 1:47 pm
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32381
Try this:

Code: Select all

``````Input:
5 5 6 7 8 16
``````
Thu Jan 26, 2006 5:43 pm
Forum: Volume 109 (10900-10999)
Topic: 10985 - Rings'n'Ropes
Replies: 11
Views: 4343
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.
Fri Oct 07, 2005 10:50 pm
Forum: Volume 109 (10900-10999)
Topic: 10923 - Seven Seas
Replies: 28
Views: 11922
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.
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: 4160
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...