結果

問題 No.482 あなたの名は
ユーザー mlihua09mlihua09
提出日時 2020-09-04 01:55:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 105,060 KB
最終ジャッジ日時 2024-05-03 11:44:29
合計ジャッジ時間 3,883 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,432 KB
testcase_01 AC 37 ms
52,892 KB
testcase_02 AC 37 ms
53,216 KB
testcase_03 AC 38 ms
53,320 KB
testcase_04 AC 35 ms
53,460 KB
testcase_05 AC 36 ms
52,280 KB
testcase_06 AC 35 ms
52,560 KB
testcase_07 AC 36 ms
54,156 KB
testcase_08 WA -
testcase_09 AC 35 ms
52,712 KB
testcase_10 AC 35 ms
53,320 KB
testcase_11 AC 34 ms
53,568 KB
testcase_12 WA -
testcase_13 AC 34 ms
52,252 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 88 ms
102,872 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 83 ms
102,912 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 84 ms
103,424 KB
testcase_24 AC 85 ms
103,424 KB
testcase_25 AC 84 ms
102,620 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 86 ms
103,168 KB
testcase_29 AC 84 ms
103,296 KB
testcase_30 AC 35 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


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

D = list(map(lambda x: int(x) - 1, input().split()))

ans = 0
for i in range(N):
    if D[i] != i:
        D[D[i]] = D[i]
        ans += 1
if ans > K or (ans - K) % 2:
    print('NO')
else:
    print('YES')
0