結果

問題 No.482 あなたの名は
ユーザー akitsugu777
提出日時 2019-07-23 10:25:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 211 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 29,680 KB
最終ジャッジ日時 2024-06-25 01:16:47
合計ジャッジ時間 4,535 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 16 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
d = [int(i)-1 for i in input().split()]

for i in range(n):
    while d[i] != i:
        d[d[i]], d[i] = d[i], d[d[i]]
        k -= 1

print(['NO', 'YES'][k == 0 and k % 2 == 0])
0