結果

問題 No.482 あなたの名は
ユーザー ronpooronpoo
提出日時 2023-10-31 11:46:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 81,852 KB
実行使用メモリ 102,976 KB
最終ジャッジ日時 2023-10-31 11:46:39
合計ジャッジ時間 4,973 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,576 KB
testcase_01 AC 35 ms
53,576 KB
testcase_02 AC 37 ms
53,576 KB
testcase_03 AC 36 ms
53,576 KB
testcase_04 AC 35 ms
53,576 KB
testcase_05 AC 36 ms
53,576 KB
testcase_06 AC 35 ms
53,576 KB
testcase_07 AC 37 ms
53,576 KB
testcase_08 AC 36 ms
53,576 KB
testcase_09 AC 35 ms
53,576 KB
testcase_10 AC 36 ms
53,576 KB
testcase_11 AC 36 ms
53,576 KB
testcase_12 AC 36 ms
53,576 KB
testcase_13 AC 36 ms
53,576 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 80 ms
102,960 KB
testcase_17 AC 80 ms
102,956 KB
testcase_18 AC 80 ms
102,956 KB
testcase_19 WA -
testcase_20 AC 78 ms
102,956 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 79 ms
102,956 KB
testcase_25 WA -
testcase_26 AC 78 ms
102,956 KB
testcase_27 WA -
testcase_28 AC 81 ms
102,960 KB
testcase_29 AC 76 ms
102,952 KB
testcase_30 AC 35 ms
53,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
D = list(map(int, input().split()))

cnt = 0
for i in range(N):
    if D[i] != i+1:
        cnt += 1

if cnt % 2 == 0:
    cnt //= 2
else:
    cnt -= 1
    
if cnt > K:    
    print('NO')
elif (K-cnt) % 2 == 1:
    print('NO')
else:
    print('YES')
0