結果
| 問題 |
No.946 箱箱箱
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-31 16:38:51 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 683 ms / 2,000 ms |
| コード長 | 486 bytes |
| コンパイル時間 | 112 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 44,724 KB |
| 最終ジャッジ日時 | 2024-06-24 20:10:43 |
| 合計ジャッジ時間 | 36,066 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 51 |
ソースコード
#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N, *A = map(int, read().split())
dp = np.zeros(N + 1, np.int32)
for i, x in enumerate(A[::-1]):
dp[:i + 1] ^= x
values = np.unique(dp[: i + 1])
n = len(values)
ind = np.where(np.arange(n) != values)[0]
dp[i + 1] = n if not len(ind) else ind[0]
answer = 'Takahashi' if dp[-1] else 'Takanashi'
print(answer)
maspy