11325 - This Means War!

All about problems in Volume 113. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
User avatar
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

11325 - This Means War!

Post by rio » Tue Oct 30, 2007 11:45 am

This problem looks simple, and the coding was not so complex, but getting WA..
Re-read the problem description few times, but I think my interpretation of the game rule is correct..

Is there a tricky test case ?

Thanks in advance.
----
Rio

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo » Tue Oct 30, 2007 10:05 pm

The most tricky thing is the end condition:
Normally, when a war is started, the current and the next 3 cards of each player are discarded into the center.

Note that war can't be started with the very last card.
Otherwise if a war is started with the last i card i>=2, then the next min(i-2,3) cards are discarded.

Other than that, I just used backtracking with some greedy stuff.

User avatar
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio » Wed Oct 31, 2007 3:46 am

Thanks sclo. I got AC.

I am stupid :oops: I was discarding min(3,i-2) week cards when war occur.
After all, I noticed that this choice is not optimal, and also there was no need to actually discard.

----
Rio

Vendetta
New poster
Posts: 3
Joined: Fri Nov 09, 2007 1:07 pm

Post by Vendetta » Fri Nov 09, 2007 1:15 pm

would you please give me a random input and output ? :( (the bigger, the better)
i can't understand why i'm getting wrong answer

Vendetta
New poster
Posts: 3
Joined: Fri Nov 09, 2007 1:07 pm

Post by Vendetta » Sat Nov 10, 2007 5:52 am

got AC
a real stupid mistake :oops:

red_apricot
New poster
Posts: 48
Joined: Sun Jun 22, 2014 6:14 am

Re: 11325 - This Means War!

Post by red_apricot » Tue Oct 13, 2015 12:28 pm

The judge I/O is incomplete. For example, for input

Code: Select all

1
3S 7H KD 4S 6S AD 7D 4C AS JD 2H 3C 4H 2C 7C AH 5S 2D 6C 8S AC 5C 7S KS QC TD
my Accepted program outputs "no", but uvatoolkit yields "yes".

Post Reply

Return to “Volume 113 (11300-11399)”