結果
問題 | No.102 トランプを奪え |
ユーザー |
|
提出日時 | 2022-03-31 22:09:45 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 497 bytes |
コンパイル時間 | 314 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-11-17 14:41:46 |
合計ジャッジ時間 | 1,058 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 8 |
ソースコード
a,b,c,d = map(int,input().split()) import sys sys.setrecursionlimit(10 ** 6) from functools import lru_cache @lru_cache 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')