結果

問題 No.482 あなたの名は
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-08 16:05:14
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 11,788 KB
実行使用メモリ 31,896 KB
最終ジャッジ日時 2023-10-24 06:14:23
合計ジャッジ時間 5,235 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,088 KB
testcase_01 AC 29 ms
10,088 KB
testcase_02 AC 28 ms
10,088 KB
testcase_03 AC 28 ms
10,088 KB
testcase_04 AC 27 ms
10,088 KB
testcase_05 WA -
testcase_06 AC 27 ms
10,088 KB
testcase_07 AC 28 ms
10,176 KB
testcase_08 WA -
testcase_09 AC 28 ms
10,092 KB
testcase_10 AC 27 ms
10,132 KB
testcase_11 AC 28 ms
10,148 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 136 ms
31,836 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 141 ms
31,836 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 139 ms
31,836 KB
testcase_24 AC 140 ms
31,836 KB
testcase_25 AC 137 ms
31,836 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 137 ms
31,836 KB
testcase_29 AC 144 ms
31,836 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
lst = [0]+list(map(int,input().split()))

cnt = 0
for i in range(N):
    x = lst[i]
    if x!=i:
        lst[i] = lst[x]
        lst[x] = x
        cnt+=1
print("NO" if cnt>K or (K-cnt)%2 else "YES")
0