結果

問題 No.482 あなたの名は
ユーザー ああいい
提出日時 2022-03-24 20:21:23
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 288 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 106,752 KB
最終ジャッジ日時 2024-10-13 04:02:52
合計ジャッジ時間 5,235 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

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 coutn <= K and (K-count)%2 == 0:
    print('YES')
else:
    print('NO')
0