結果

問題 No.102 トランプを奪え
ユーザー ああいいああいい
提出日時 2022-03-31 22:07:57
言語 PyPy3
(7.3.13)
結果
MLE  
実行時間 -
コード長 513 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 842,384 KB
最終ジャッジ日時 2023-08-11 02:21:01
合計ジャッジ時間 7,899 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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')
0