結果

問題 No.946 箱箱箱
ユーザー とりゐとりゐ
提出日時 2022-01-04 11:35:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 77,080 KB
最終ジャッジ日時 2024-04-22 05:15:53
合計ジャッジ時間 8,577 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,840 KB
testcase_01 AC 40 ms
51,584 KB
testcase_02 AC 38 ms
52,352 KB
testcase_03 AC 162 ms
76,904 KB
testcase_04 AC 152 ms
76,712 KB
testcase_05 AC 39 ms
51,840 KB
testcase_06 AC 163 ms
76,800 KB
testcase_07 AC 163 ms
76,812 KB
testcase_08 AC 152 ms
76,544 KB
testcase_09 AC 157 ms
76,800 KB
testcase_10 AC 150 ms
77,056 KB
testcase_11 AC 37 ms
52,224 KB
testcase_12 AC 153 ms
76,672 KB
testcase_13 AC 155 ms
77,056 KB
testcase_14 AC 154 ms
76,800 KB
testcase_15 AC 156 ms
76,928 KB
testcase_16 AC 155 ms
76,672 KB
testcase_17 AC 161 ms
76,640 KB
testcase_18 AC 156 ms
76,928 KB
testcase_19 AC 157 ms
76,672 KB
testcase_20 AC 44 ms
58,624 KB
testcase_21 AC 147 ms
76,800 KB
testcase_22 AC 157 ms
76,900 KB
testcase_23 AC 153 ms
76,800 KB
testcase_24 AC 147 ms
76,288 KB
testcase_25 AC 154 ms
76,544 KB
testcase_26 AC 154 ms
76,888 KB
testcase_27 AC 155 ms
77,056 KB
testcase_28 AC 158 ms
76,928 KB
testcase_29 AC 154 ms
76,672 KB
testcase_30 AC 161 ms
77,080 KB
testcase_31 AC 155 ms
76,928 KB
testcase_32 AC 148 ms
76,928 KB
testcase_33 AC 158 ms
77,056 KB
testcase_34 AC 152 ms
76,800 KB
testcase_35 AC 154 ms
76,544 KB
testcase_36 AC 158 ms
76,548 KB
testcase_37 AC 157 ms
76,288 KB
testcase_38 AC 157 ms
76,544 KB
testcase_39 AC 155 ms
76,672 KB
testcase_40 AC 149 ms
76,672 KB
testcase_41 AC 153 ms
76,928 KB
testcase_42 AC 163 ms
76,672 KB
testcase_43 AC 160 ms
76,544 KB
testcase_44 AC 153 ms
76,572 KB
testcase_45 AC 157 ms
76,672 KB
testcase_46 AC 156 ms
76,416 KB
testcase_47 AC 38 ms
51,456 KB
testcase_48 AC 36 ms
52,096 KB
testcase_49 AC 37 ms
51,968 KB
testcase_50 AC 37 ms
51,968 KB
testcase_51 AC 36 ms
51,840 KB
testcase_52 AC 36 ms
51,968 KB
testcase_53 AC 39 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
grundy=[-1]*(n+1)
grundy[n]=0
for i in range(n-1,-1,-1):
  mex=set()
  xor=0
  for j in range(i,n):
    xor^=a[j]
    mex.add(xor^grundy[j+1])
  g=0
  while g in mex:
    g+=1
  grundy[i]=g
if grundy[0]==0:
  print('Takanashi')
else:
  print('Takahashi')
0