結果
| 問題 |
No.100 直列あみだくじ
|
| コンテスト | |
| ユーザー |
tnodino
|
| 提出日時 | 2022-04-10 16:56:41 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 5,000 ms |
| コード長 | 365 bytes |
| コンパイル時間 | 211 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-14 05:26:19 |
| 合計ジャッジ時間 | 3,340 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 45 |
ソースコード
N = int(input())
a = list(map(int,input().split()))
flg = [1] * N
cnt = [0] * (N+1)
for i in range(N):
if flg[i]:
idx = i
Roop = 0
while flg[idx]:
flg[idx] = 0
idx = a[idx] - 1
Roop += 1
cnt[Roop] += 1
for i in range(0,N+1,2):
if cnt[i] % 2:
print('No')
exit()
print('Yes')
tnodino