|
|
Show all threads Hide all threads Show all messages Hide all messages | 40+ tests, just for your "thanks" | D4nick | 1488. ACM Poker | 13 Nov 2022 13:46 | 3 | AC QH 10H JC KC 4D AC AC 4D 5D AD 4C 5C JC 2H AC 5C 5D AD 5S 5H JC 2H AC 5C 5D AD 5S 5H JC 2H AD 5C 5D AD 5S 5H JC JH JD JS 8H JC 8C 8D 10H 8H 10H 10D 8D 9D 3D 3C 3H AH AS 2C 3D 4H 2D 3H 4S AH AH 8C QC JC JD 9D KD 3H 3H 8C QC KC JD 9D KD 3H 3H 10C QC KC JD 9D KD 3H 3H 5C 10C 10D 10S 9D 6D 3H 3H AC 10C 10D 10S 9D 6D 3H 3H AC 10C 9C 10S 9D 6D 3H 3H AC 10C 9C 10S 10D 6D 3H 4S AH AS AD AC 10C 10S 3H 4S AH AS AD AC 10C JC 3H 4S AH AS AD AC 10C JC 3H 4S AH QS KD AD KC JD 3H 4S AH QS KD AD KC JD 3H 4S AH AS KD AD AC QD 3H 4S AH AS 3D KS KC 2D 3H 4S AH AS 3D KS KC 2D 2H 2S AH AS 3D KS KC KD 2H 3H AH AS AD KS KC KD 2H 3H 3S 4C 5C 2S 4S 5S AH AD 3S 4C 5C AS AH 2C AH AD 3C 4C 5C AS AH 2C AH AD 3C 4C 5C 2S 7S 10S AH AH 4S 5D 8H 5S 7S 8D 3C 2D 4S 4D 4H 5S 5D 2H 2C 2D 4S 4D 4H 5S 5D 3H 3C 3D 4S 4D 4H 5S 5D 6H 6C 6D 4S 4D 4H 5S 5D 5H 5H 5H AH AS JS AC AD 10S KS KD AH AS KH AC AD 10S KS KD 3C 4C 5C 4S 5S 6S AH AH 3C 4C 5C 3S 4H 5D AH AH 2S 4S 5S 7D 4D 5D AH AH 3D 4D 5D 2S 3S 4S AH AH 4C 4D JS 4S 4H 3H 7S 7S 4C AC 2C 4S KD 6H 5C KH JS 8H JC 8C 8D 10H 8H 10H 10D 8D 9D 3D 3C 3H AH AS 2C 3D 4H 2D 3H 4S AH AH Sasha Dima Artyom Sasha Dima Sasha Dima Artyom Dima Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Sasha Dima Dima Dima Sasha Sasha Dima Sasha Sasha Dima Sasha Dima Dima Dima Dima Artyom Dima Sasha Dima Sasha Sasha Dima Sasha Dima Artyom | If you have WA @ 2 | 198808xc | 1488. ACM Poker | 21 Sep 2020 23:52 | 5 | Please notice the POINT: If both players have "two of a kind", then the ranks of paired cards are compared first, and if they are equal, then the ranks of the thirds cards are compared. I think this is the one easiest to have been ignored. (Sorry for my poor English) Hi, What about the scenario where both players have flush ? In texas holdem whosoever has higher highest card wins and if they are the same then it's a tie. So what should be the answer for the following test case. 4C 6C 8C 3H 4H 8H AS AD Mine is Artyom because both player's best hand is eight high flush (even though the next best card of sasha (6) is greater than next best card of dima (4)). Ok, the answer for previous test case is Sasha because Sasha's second card is higher than Dima's ( whose best hand is also flush) second highest card (as they both have the same hand). This turned out to be a little different from the normal texas holdem poker as there only the highest card matters which is correct because two players in texas holdem cannot have same high card for flush. But here its a different story. > This turned out to be a little different from the normal texas holdem poker as there only the highest card matters which is correct because two players in texas holdem cannot have same high card for flush. LOLWUT? | Remember straight is better than flush, it's not real pocker | D4nick | 1488. ACM Poker | 19 Sep 2020 23:51 | 1 | | WA 3 (question) | Combatcook | 1488. ACM Poker | 15 May 2016 15:42 | 1 | Can anybody give some useful tests to pass test 3? And what about that situation: there are two the same cards in Dima's sleeve and there is the same card in Dima's or Sasha's set? For example: AC QH 10H JC KC 4D AC AC Is that possible? UPD: as I understood, yes... though doesn't matter, AC now. Edited by author 15.05.2016 21:18 | Tip | Mihail | 1488. ACM Poker | 28 Apr 2015 01:19 | 1 | Tip Mihail 28 Apr 2015 01:19 Be careful to check if the two cards in Dima's sleeve are the same! | I need help | [LG]_Vendetta | 1488. ACM Poker | 15 Sep 2008 19:40 | 1 | Who know, why solution had Crash on 2nd test? Please give some test. | need help... wa 2 :( | [LG]_#\#@P$T[101]R | 1488. ACM Poker | 13 Sep 2008 04:28 | 5 | please give me some tests. thanks Edited by author 11.09.2008 23:35 what answer on test : 2C JS 5C JD 5D 2S 2C 5D I think that Artyom. But maybe Dima??? My AC solution says "Artyom" to Denis Koshman : please give me some useful tests. thanks. I'm sorry, but I don't have any... And this problem has quite thin another-answer thresholds to prepare them quickly. What I can do is send you my AC solution, so you can compare whatever tests you generate with your own. Mail me via headden@karelia.ru if you want it. My solution is plain brute force, so it won't uncover you anything you might want to reinvent yourself :) | Where is the bug?!!! | Howl of Despair | 1488. ACM Poker | 5 Feb 2008 00:52 | 1 | I don't know how this did happen... It's the first time I've been encountered with such a trouble... Everything seems to be correct, all "home" tests having passed, but... WA2 Somebody, please help me! My code: #include <cstdio> #include <algorithm> using namespace std; struct Card { int value; char color; Card(int value = 0, char color = 0) : value(value), color(color) {} bool in() { char c; while(1) { c = getchar(); if(c == EOF) return false; if((c >= '1') && (c <= '9')) break; if(c == 'A' || c == 'J' || c == 'Q' || c == 'K') break; if(c >= 'A' && c <= 'Z') for(;;); if(c >= 'a' && c <= 'z') for(;;); if(c == '0') for(;;); } switch(c) { case '1': value = 10; getchar(); break; case 'J': value = 11; break; case 'Q': value = 12; break; case 'K': value = 13; break; case 'A': value = 14; break; default: if(c < '1' || c > '9') for(;;); value = c - '0'; } color = getchar(); if(!(color == 'H' || color == 'D' || color == 'S' || color == 'C')) for(;;); if(value < 1 || value > 14) for(;;); return true; } }; bool operator<(Card c1, Card c2) { return c1.value < c2.value; } bool operator==(Card c1, Card c2) { return (c1.value == c2.value) && (c1.color == c2.color); } enum cname {SINGLE = 1, PAIR = 2, FLASH = 3, STREET = 4, THREE = 5, STREETFLASH = 6, MAJOR = 7}; struct Combination { cname Name; int val; Combination() {} Combination(Card *cds) { sort(cds, cds + 3); if((cds[0].value == cds[1].value) && (cds[1].value == cds[2].value)) { if(cds[0].value == 3) Name = MAJOR; else { Name = THREE; val = cds[0].value; } return; } if((cds[0].color == cds[1].color) && (cds[1].color == cds[2].color)) { if((cds[0].value + 1 == cds[1].value) && (cds[0].value + 2 == cds[2].value)) { Name = STREETFLASH; val = cds[2].value; } else { Name = FLASH; val = 10000 * cds[2].value + 100 * cds[1].value + cds[0].value; } return; } if((cds[0].value + 1 == cds[1].value) && (cds[0].value + 2 == cds[2].value)) { Name = STREET; val = cds[2].value; return; } if(cds[1].value == cds[2].value) { Name = PAIR; val = 100 * cds[1].value + cds[0].value; return; } if(cds[1].value == cds[0].value) { Name = PAIR; val = 100 * cds[1].value + cds[2].value; return; } Name = SINGLE; val = 10000 * cds[2].value + 100 * cds[1].value + cds[0].value; } }; bool operator<(Combination c1, Combination c2) { if((int)c1.Name == (int)c2.Name) { return c1.val < c2.val; } return (int)c1.Name < (int)c2.Name; } bool operator==(Combination c1, Combination c2) { return (c1.Name == c2.Name) && (c1.val == c2.val); } int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif Card Sasha[3], Dima[5]; char Winner[3][10] = {"Sasha", "Artyom", "Dima"}; int dc; while(1) { dc = 3; for(int i = 0; i < 3; ++i) Sasha[i].in(); for(int i = 0; i < 3; ++i) Dima[i].in(); dc = 3; for(int i = 0; i < 2; ++i) { Card cheat; if(cheat.in() == false) return 0; bool ok = true; for(int k = 0; k < 3; ++k) { if(cheat == Dima[k] || cheat == Sasha[k]) { ok = false; break; } } if(cheat == Dima[dc - 1]) ok = false; if(ok) Dima[dc++] = cheat; } Combination SComb(Sasha); Combination DComb; int res = 0; Card comb[3]; for(int i = 0; i < dc - 2; ++i) { comb[0] = Dima[i]; for(int j = i + 1; j < dc - 1; ++j) { comb[1] = Dima[j]; for(int k = j + 1; k < dc; ++k) { comb[2] = Dima[k]; DComb = Combination(comb); if(SComb < DComb) res = 2; else if(DComb == SComb) res = max(res, 1); } } } puts(Winner[res]); } // return 0; } | To admins: about seekeof | I&K | 1488. ACM Poker | 25 Jan 2007 13:09 | 2 | I couldn't AC this simple problem for a long time because I used seekeof! I always got WA 1. When I change my code and replace seekeof by reading symbol-by-symbol and use eof, I get AC. I think it was a bug in FreePascal because I use Delphi and my program with seekeof successfully works on my computer. This is one more cause to replace FreePascal 2.0.4 by Delphi. Yes! And because of the fact during the contest I spend too much time on this problem, and had only +4! This is obvious bug in Free Pascal compiler (or bad input files) | A combination of three 3s is the best | RAF | 1488. ACM Poker | 7 Oct 2006 17:39 | 2 | |
|
|
|