結果

問題 No.482 あなたの名は
コンテスト
ユーザー fagfagdfa
提出日時 2017-09-06 01:58:15
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 182 ms
コンパイル使用メモリ 77,252 KB
最終ジャッジ日時 2025-12-04 00:37:58
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, k = map(int, raw_input().split())
a = map(int, raw_input().split())

ct = 0

for i in range(len(a)):
    if i != a[i] - 1:
        ct += 1

if ct / 2 == k:
    print "YES"
elif ct == 0 and k % 2 == 0:
    print "YES"
elif ct / 2 < k and (k - (ct / 2)) % 2 == 0:
    print "YES"
else:
    print "NO"


0