結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-04 01:55:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 242 bytes |
| コンパイル時間 | 372 ms |
| コンパイル使用メモリ | 82,440 KB |
| 実行使用メモリ | 105,572 KB |
| 最終ジャッジ日時 | 2024-11-24 11:11:46 |
| 合計ジャッジ時間 | 4,281 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 11 |
ソースコード
N, K = map(int, input().split())
D = list(map(lambda x: int(x) - 1, input().split()))
ans = 0
for i in range(N):
if D[i] != i:
D[D[i]] = D[i]
ans += 1
if ans > K or (ans - K) % 2:
print('NO')
else:
print('YES')