結果
問題 |
No.100 直列あみだくじ
|
ユーザー |
![]() |
提出日時 | 2025-06-19 02:50:37 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 534 bytes |
コンパイル時間 | 458 ms |
コンパイル使用メモリ | 12,160 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2025-06-19 02:50:42 |
合計ジャッジ時間 | 4,177 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 WA * 4 |
ソースコード
# 解説を見た。なるほど。これは思いつけるべきだったか。 import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) for i in range(N): A[i]-=1 USE=[0]*N ANS=0 for i in range(N): if USE[i]==1: continue now=i USE[i]=1 count=1 while True: now=A[now] if USE[now]==1: break USE[now]=1 count+=1 #print(USE,count) if count%2==0: ANS+=1 if ANS%2==0: print("Yes") else: print("No")