結果

問題 No.482 あなたの名は
コンテスト
ユーザー flippergo
提出日時 2026-03-26 09:16:14
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 278 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 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
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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")
0