結果
| 問題 |
No.1937 Various Tournament
|
| コンテスト | |
| ユーザー |
qwewe
|
| 提出日時 | 2025-04-24 12:30:53 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 774 bytes |
| コンパイル時間 | 407 ms |
| コンパイル使用メモリ | 82,420 KB |
| 実行使用メモリ | 83,952 KB |
| 最終ジャッジ日時 | 2025-04-24 12:32:16 |
| 合計ジャッジ時間 | 4,099 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 1 TLE * 1 -- * 45 |
ソースコード
import sys
from itertools import permutations
def main():
N = int(sys.stdin.readline())
S = []
for _ in range(N):
S.append(list(map(int, sys.stdin.readline().split())))
ans = [0] * (N + 1)
for perm in permutations(range(1, N + 1)):
current = list(perm)
while len(current) > 1:
next_round = []
for i in range(0, len(current), 2):
a = current[i]
b = current[i+1]
if S[a-1][b-1]:
next_round.append(a)
else:
next_round.append(b)
current = next_round
winner = current[0]
ans[winner] += 1
for i in range(1, N + 1):
print(ans[i])
if __name__ == "__main__":
main()
qwewe