結果
問題 |
No.482 あなたの名は
|
ユーザー |
![]() |
提出日時 | 2017-03-21 02:12:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 330 bytes |
コンパイル時間 | 173 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 106,752 KB |
最終ジャッジ日時 | 2024-07-05 04:48:58 |
合計ジャッジ時間 | 4,501 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 1 WA * 27 |
ソースコード
N,K = map(int,input().split()) L = list(map(int,input().split())) def min_gokan(A): count = 0 for i in range(len(A)): while A[i] - 1 != i: A[A[i] - 1],A[i] = A[i],A[A[i] - 1] print(i,A[i]) count = count + 1 return count m = min_gokan(L) if m > K: print("NO") elif (K - m) % 2 == 0: print("YES") else: print("NO")