結果
| 問題 | No.100 直列あみだくじ |
| コンテスト | |
| ユーザー |
yaoshimax
|
| 提出日時 | 2015-03-09 23:18:43 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 356 bytes |
| 記録 | |
| コンパイル時間 | 137 ms |
| コンパイル使用メモリ | 77,548 KB |
| 最終ジャッジ日時 | 2025-12-03 14:25:49 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 WA * 7 |
ソースコード
N=int(raw_input())
a=map(int,raw_input().split())
for i in range(len(a)):
if a[i]!=-1 and a[i]!=i+1:
cnt=1
cur=i
while a[cur]!=i+1:
cnt+=1
tmp=cur
cur=a[cur]-1
a[tmp]=-1
a[cur]=-1
if cnt % 2 == 0:
print "No"
exit()
print "Yes"
yaoshimax