結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,316 KB
testcase_01 AC 75 ms
71,076 KB
testcase_02 AC 75 ms
71,556 KB
testcase_03 AC 74 ms
71,516 KB
testcase_04 AC 76 ms
71,584 KB
testcase_05 AC 76 ms
71,420 KB
testcase_06 AC 75 ms
71,148 KB
testcase_07 WA -
testcase_08 AC 76 ms
71,372 KB
testcase_09 WA -
testcase_10 AC 76 ms
71,512 KB
testcase_11 AC 75 ms
71,220 KB
testcase_12 WA -
testcase_13 AC 76 ms
71,208 KB
testcase_14 AC 76 ms
71,220 KB
testcase_15 WA -
testcase_16 AC 123 ms
109,064 KB
testcase_17 AC 123 ms
108,744 KB
testcase_18 AC 123 ms
108,828 KB
testcase_19 WA -
testcase_20 AC 126 ms
108,672 KB
testcase_21 WA -
testcase_22 AC 121 ms
108,772 KB
testcase_23 WA -
testcase_24 AC 122 ms
108,664 KB
testcase_25 WA -
testcase_26 AC 122 ms
108,632 KB
testcase_27 WA -
testcase_28 AC 129 ms
109,016 KB
testcase_29 WA -
testcase_30 AC 76 ms
71,092 KB
権限があれば一括ダウンロードができます

ソースコード

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