結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-24 20:22:08 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 64 ms / 2,000 ms |
| コード長 | 288 bytes |
| 記録 | |
| コンパイル時間 | 297 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 103,552 KB |
| 最終ジャッジ日時 | 2026-04-30 10:35:41 |
| 合計ジャッジ時間 | 3,768 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
N,K = map(int,input().split())
D = list(map(int,input().split()))
count = 0
i = 0
while i < N:
if D[i] != i + 1:
j = D[i]
D[i],D[j-1] = D[j-1],D[i]
count += 1
else:
i += 1
if count <= K and (K-count)%2 == 0:
print('YES')
else:
print('NO')