結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-24 20:22:08 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 59 ms / 2,000 ms |
| + 734µs | |
| コード長 | 288 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 80,640 KB |
| 実行使用メモリ | 105,600 KB |
| 最終ジャッジ日時 | 2026-09-15 08:58:22 |
| 合計ジャッジ時間 | 3,626 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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')