結果

問題 No.482 あなたの名は
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-05 05:08:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 105,088 KB
最終ジャッジ日時 2024-07-19 19:12:05
合計ジャッジ時間 3,894 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
D = list(map(int, input().split()))

D = [d-1 for d in D]

c = 0
for i, d in enumerate(D):
    if i != d:
        c += 1
if c == 0:
    if k%2 == 0:
        print('YES')
    else:
        print('NO')
else:
    if (k-(c-1))%2 == 0:
        print('YES')
    else:
        print('NO')
0