結果

問題 No.482 あなたの名は
ユーザー uma66uma66
提出日時 2018-02-08 17:34:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 11,944 KB
実行使用メモリ 31,964 KB
最終ジャッジ日時 2023-10-24 22:12:14
合計ジャッジ時間 4,497 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

D = [ x for x in map(int,input().split())]

num = 0
for i in range(len(D)):
    tmp = D[i]
    if tmp == i+1:
        continue
    else:
        D[i] = D[tmp-1]
        D[tmp-1] = tmp
        num += 1
diff = K - num
if diff >= 0 and diff % 2 == 0:
    print("YES")
else:
    print("NO")
0