結果

問題 No.946 箱箱箱
ユーザー mkawa2mkawa2
提出日時 2019-12-13 21:34:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 806 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 8,828 KB
最終ジャッジ日時 2023-09-09 23:03:51
合計ジャッジ時間 17,586 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,524 KB
testcase_01 AC 18 ms
8,480 KB
testcase_02 AC 18 ms
8,512 KB
testcase_03 AC 326 ms
8,724 KB
testcase_04 AC 372 ms
8,808 KB
testcase_05 AC 18 ms
8,464 KB
testcase_06 AC 372 ms
8,708 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 285 ms
8,620 KB
testcase_10 AC 338 ms
8,652 KB
testcase_11 AC 19 ms
8,420 KB
testcase_12 AC 280 ms
8,492 KB
testcase_13 WA -
testcase_14 AC 361 ms
8,664 KB
testcase_15 AC 340 ms
8,668 KB
testcase_16 AC 320 ms
8,648 KB
testcase_17 AC 326 ms
8,640 KB
testcase_18 AC 364 ms
8,768 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 448 ms
8,744 KB
testcase_22 AC 350 ms
8,616 KB
testcase_23 AC 362 ms
8,632 KB
testcase_24 AC 450 ms
8,828 KB
testcase_25 WA -
testcase_26 AC 338 ms
8,640 KB
testcase_27 WA -
testcase_28 AC 325 ms
8,692 KB
testcase_29 AC 368 ms
8,756 KB
testcase_30 WA -
testcase_31 AC 358 ms
8,756 KB
testcase_32 WA -
testcase_33 AC 356 ms
8,744 KB
testcase_34 AC 369 ms
8,728 KB
testcase_35 AC 365 ms
8,780 KB
testcase_36 AC 372 ms
8,680 KB
testcase_37 AC 370 ms
8,796 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 339 ms
8,680 KB
testcase_42 WA -
testcase_43 AC 369 ms
8,740 KB
testcase_44 WA -
testcase_45 AC 370 ms
8,708 KB
testcase_46 AC 369 ms
8,648 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 18 ms
8,504 KB
testcase_52 WA -
testcase_53 AC 18 ms
8,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *
from collections import defaultdict
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n=int(input())
    aa=[int(input()) for _ in range(n)]
    grundy=[0]*(n+1)
    for i in range(n-1,-1,-1):
        hp=[]
        s=0
        for j in range(n-1,i-1,-1):
            s^=aa[j]
            heappush(hp,grundy[j]^s)
        g=-1
        while hp:
            ng=heappop(hp)
            if ng!=g+1:break
            g=ng
        grundy[i]=g+1
    if grundy[0]:print("Takahashi")
    else:print("Takanashi")
    #print(grundy)

main()
0