結果

問題 No.482 あなたの名は
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-05 05:03:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 109,188 KB
最終ジャッジ日時 2023-09-27 01:33:59
合計ジャッジ時間 5,184 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,444 KB
testcase_01 AC 75 ms
71,200 KB
testcase_02 AC 76 ms
71,224 KB
testcase_03 AC 76 ms
71,392 KB
testcase_04 AC 74 ms
71,596 KB
testcase_05 WA -
testcase_06 AC 75 ms
71,444 KB
testcase_07 AC 76 ms
71,424 KB
testcase_08 WA -
testcase_09 AC 75 ms
71,396 KB
testcase_10 AC 74 ms
71,252 KB
testcase_11 AC 76 ms
71,584 KB
testcase_12 AC 76 ms
71,472 KB
testcase_13 AC 74 ms
71,232 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 126 ms
109,096 KB
testcase_17 AC 122 ms
108,632 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 121 ms
108,780 KB
testcase_25 AC 120 ms
108,668 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 124 ms
108,864 KB
testcase_29 AC 119 ms
108,896 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

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
c //= 2
if k-c >= 0 and (k-c)%2 == 0:
    print('YES')
else:
    print('NO')
0