結果
問題 | No.102 トランプを奪え |
ユーザー |
|
提出日時 | 2022-03-31 22:07:57 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 513 bytes |
コンパイル時間 | 282 ms |
コンパイル使用メモリ | 81,716 KB |
実行使用メモリ | 849,284 KB |
最終ジャッジ日時 | 2024-11-17 14:37:46 |
合計ジャッジ時間 | 32,745 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 3 |
other | MLE * 8 |
ソースコード
a,b,c,d = map(int,input().split()) import sys sys.setrecursionlimit(10 ** 8) from functools import lru_cache @lru_cache(maxsize = 1000) def calc(a,b,c,d): if a == 0 and b == 0 and c == 0 and d == 0: return (0,0) tmp = 0 for u in (a,b,c,d): for i in range(1,min(u,3)+1): x,y = calc(a-i,b,c,d) if tmp < y + i:tmp = y + i return (tmp,a + b + c + d - tmp) x,y = calc(a,b,c,d) if x > y: print('Taro') elif x == y: print('Draw') else: print('Jiro')