結果
| 問題 | No.482 あなたの名は |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-03-26 09:16:14 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 2,000 ms |
| コード長 | 278 bytes |
| 記録 | |
| コンパイル時間 | 2,048 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 104,832 KB |
| 最終ジャッジ日時 | 2026-03-26 09:16:24 |
| 合計ジャッジ時間 | 7,480 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
N,K = map(int,input().split())
D = [0]+list(map(int,input().split()))
tot = 0
i = 1
while i<N:
if D[i]==i:
i += 1
continue
j = D[i]
D[i],D[j] = D[j],D[i]
tot += 1
if tot>K:
print("NO")
elif (K-tot)%2==0:
print("YES")
else:
print("NO")