11013 - Get Straight
Moderator: Board moderators
11013 - Get Straight
Why a solution which got Accepted during the online contest should get WA now?
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
I submit my code to the new system.
I had wait for 10 minutes and the new online-judge system still shows these information in "My Submissions" page:
I don't know what's wrong to my code or to the new online-judge system.
I had wait for 10 minutes and the new online-judge system still shows these information in "My Submissions" page:
Code: Select all
# Problem Verdict Language Run Time Memory Used Submission Time
5909477 Get Straight C++ 2007-09-10 06:53:50
Re: 11013 - Get Straight WA
I have passed all the random input from udebug. But I am still getting WA.
Can someone provide more random inputs?
Exchange TD
Exchange AD
The output from udebug is:
Exchange AC
Exchange 5H
Can someone tell me why is there a difference between my output and udebug's output? The expected value for both outputs are the same.
Can someone provide more random inputs?
- 7D TD 5C 4H AC
AD 8H TS JH 5H
#
Exchange TD
Exchange AD
The output from udebug is:
Exchange AC
Exchange 5H
Can someone tell me why is there a difference between my output and udebug's output? The expected value for both outputs are the same.
Re: 11013 - Get Straight
AC
Test Case that caused my code to fail.
AD AH AS KD KH
AC Output:
Stay
Hope this helps =)
Test Case that caused my code to fail.
AD AH AS KD KH
AC Output:
Stay
Hope this helps =)
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11013 - Get Straight
If there is more than one optimal strategy for a given deal, print any one of them. A special judge will evaluate your output.
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 37
- Joined: Wed Mar 14, 2012 11:57 am
- Location: Bangladesh
- Contact:
Re: 11013 - Get Straight
What is the output for:
I get "Stay" but on uDebug I get "Exchange 9H". According to my calculation staying is better than exchanging 9H. Am I missing something?
Code: Select all
JS 9H 9S JH QH
#
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11013 - Get Straight
If you stay with that input, you'll have a Dutch so end up losing 1.
If you exchange one of the 9's, you'll have a:
4/47 chance of getting a 8 and a Double Dutch, win 1
4/47 chance of getting a 10 and an Invite-the-Neighbours, win 10
3/47 chance of getting a Q and a Double Dutch, win 1
4/47 chance of getting a K and a Menage-a-Trois, win 3
Expected earning of: 4/47 * 1 + 4/47 * 10 + 3/47 * 1 + 4/47 * 3 - 2 = -35/47 = -.74 dollar, which is better than staying at -1.
If you exchange one of the 9's, you'll have a:
4/47 chance of getting a 8 and a Double Dutch, win 1
4/47 chance of getting a 10 and an Invite-the-Neighbours, win 10
3/47 chance of getting a Q and a Double Dutch, win 1
4/47 chance of getting a K and a Menage-a-Trois, win 3
Expected earning of: 4/47 * 1 + 4/47 * 10 + 3/47 * 1 + 4/47 * 3 - 2 = -35/47 = -.74 dollar, which is better than staying at -1.
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 13
- Joined: Thu Dec 06, 2012 4:07 pm
Re: 11013 - Get Straight
my program detect some invalid format in test data. the card maybe have a duplicate.
like this,
Can someone explain this ?
Some Input:
my WA program output
like this,
Code: Select all
4H 4H 5H 3H 3H
Some Input:
Code: Select all
4H 4C 5H 3H 3C
3H 4C TH 3C 4H
6C 8D TD 6H TH
6H 5H KS 4D 6D
KS QH AS 7D TD
2C AC 9H 6D JH
7H 2H 3H 5S 3D
4H 3H QS JC 7S
4C 7D 2C 5H KC
KH 3C 4H 3S QH
QC 9C TH 9S 5S
AH TH 3D 8C QS
TH JH QH KH AH
2H TC 5D 3S 6C
2S 5S 8D JC JH
AH 5H 9C 2D 5C
AH KH 3H 4H 5C
TH QH AH 3H 5H
Code: Select all
Stay
Stay
Stay
Exchange 6H
Exchange 7D
Exchange 6D
Exchange 3H
Exchange 7S
Exchange KC
Exchange 3S
Exchange 9S
Stay
Stay
Exchange TC
Stay
Stay
Exchange KH
Stay
?? Taiwan ! ??????????
Re: 11013 - Get Straight
My accepted output:
I didn't handle duplicates.
My code just count them as once. (But still regard them as 2 or more cards.)
For your input 4H 4H 5H 3H 3H
My program gives stay.
PS. I'm also from Taiwan. Nice to meet you.
Code: Select all
Stay
Stay
Stay
Exchange 6H
Exchange 7D
Exchange 6D
Exchange 3H
Exchange 7S
Exchange KC
Exchange 3C
Exchange 9C
Stay
Stay
Exchange TC
Stay
Stay
Exchange KH
Stay
My code just count them as once. (But still regard them as 2 or more cards.)
For your input 4H 4H 5H 3H 3H
My program gives stay.
PS. I'm also from Taiwan. Nice to meet you.
Life shouldn't be null.
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11013 - Get Straight
I ignore the suit and only look at the value of each card. You're right there are cases where cards are duplicated, but there are no cases where there are 5 cards with the same value.
Check input and AC output for thousands of problems on uDebug!