結果

問題 No.482 あなたの名は
ユーザー neterukunneterukun
提出日時 2019-06-03 22:32:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 320 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 40,352 KB
最終ジャッジ日時 2023-10-17 23:31:02
合計ジャッジ時間 6,615 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,160 KB
testcase_01 AC 28 ms
10,160 KB
testcase_02 AC 29 ms
10,160 KB
testcase_03 AC 29 ms
10,160 KB
testcase_04 AC 29 ms
10,160 KB
testcase_05 AC 31 ms
10,160 KB
testcase_06 AC 28 ms
10,160 KB
testcase_07 WA -
testcase_08 AC 28 ms
10,236 KB
testcase_09 AC 28 ms
10,168 KB
testcase_10 AC 29 ms
10,232 KB
testcase_11 AC 29 ms
10,296 KB
testcase_12 AC 29 ms
10,316 KB
testcase_13 AC 28 ms
10,232 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 248 ms
40,332 KB
testcase_19 WA -
testcase_20 AC 247 ms
40,332 KB
testcase_21 WA -
testcase_22 AC 247 ms
40,332 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 248 ms
40,332 KB
testcase_27 AC 247 ms
40,332 KB
testcase_28 AC 250 ms
40,332 KB
testcase_29 AC 213 ms
40,332 KB
testcase_30 AC 28 ms
10,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

memo = {}
for i in range(n):
    memo[d[i]] = i

ans = 0
for i in range(n):
    if memo[i + 1] != i:
        memo[d[i]] = memo[i + 1]
        memo[i + 1] = i
        ans += 1

if ans <= k and (k - ans) % 2 == 0:
    print("YES")
else:
    print("NO")
0