結果

問題 No.946 箱箱箱
ユーザー mkawa2mkawa2
提出日時 2022-06-21 16:00:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 1,071 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 77,168 KB
最終ジャッジ日時 2024-04-22 10:22:01
合計ジャッジ時間 9,128 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
54,288 KB
testcase_01 AC 39 ms
52,568 KB
testcase_02 AC 39 ms
52,692 KB
testcase_03 AC 169 ms
76,852 KB
testcase_04 AC 163 ms
76,052 KB
testcase_05 AC 40 ms
52,008 KB
testcase_06 AC 160 ms
76,028 KB
testcase_07 AC 157 ms
76,524 KB
testcase_08 AC 160 ms
76,864 KB
testcase_09 AC 156 ms
76,692 KB
testcase_10 AC 155 ms
77,024 KB
testcase_11 AC 39 ms
53,292 KB
testcase_12 AC 158 ms
76,116 KB
testcase_13 AC 155 ms
76,872 KB
testcase_14 AC 159 ms
76,692 KB
testcase_15 AC 155 ms
76,232 KB
testcase_16 AC 157 ms
76,928 KB
testcase_17 AC 161 ms
77,168 KB
testcase_18 AC 160 ms
76,788 KB
testcase_19 AC 154 ms
76,236 KB
testcase_20 AC 45 ms
59,944 KB
testcase_21 AC 150 ms
76,640 KB
testcase_22 AC 157 ms
76,884 KB
testcase_23 AC 159 ms
76,852 KB
testcase_24 AC 152 ms
76,648 KB
testcase_25 AC 161 ms
76,332 KB
testcase_26 AC 158 ms
76,804 KB
testcase_27 AC 157 ms
76,756 KB
testcase_28 AC 167 ms
76,928 KB
testcase_29 AC 160 ms
76,664 KB
testcase_30 AC 161 ms
76,308 KB
testcase_31 AC 160 ms
76,912 KB
testcase_32 AC 158 ms
76,816 KB
testcase_33 AC 157 ms
76,700 KB
testcase_34 AC 160 ms
76,908 KB
testcase_35 AC 165 ms
77,128 KB
testcase_36 AC 161 ms
76,112 KB
testcase_37 AC 164 ms
76,348 KB
testcase_38 AC 159 ms
76,476 KB
testcase_39 AC 158 ms
76,828 KB
testcase_40 AC 149 ms
76,968 KB
testcase_41 AC 154 ms
76,448 KB
testcase_42 AC 155 ms
76,564 KB
testcase_43 AC 160 ms
76,104 KB
testcase_44 AC 157 ms
76,632 KB
testcase_45 AC 161 ms
76,256 KB
testcase_46 AC 161 ms
76,424 KB
testcase_47 AC 39 ms
53,500 KB
testcase_48 AC 39 ms
53,508 KB
testcase_49 AC 40 ms
52,500 KB
testcase_50 AC 39 ms
52,200 KB
testcase_51 AC 39 ms
52,996 KB
testcase_52 AC 39 ms
52,952 KB
testcase_53 AC 40 ms
53,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
# md = 10**9+7
md = 998244353

n = II()
aa = [II() for _ in range(n)]

gg = [0]*n
for i in range(n-1)[::-1]:
    st = set()
    x = aa[i]
    for j in range(i+1, n):
        st.add(x ^ gg[j])
        x ^= aa[j]
    st.add(x)
    for g in range(1000000):
        if g not in st:
            gg[i] = g
            break
# print(gg)

print("Takahashi" if gg[0] else "Takanashi")
0