結果

問題 No.482 あなたの名は
ユーザー jamadjamad
提出日時 2017-08-30 03:40:32
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 211 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 30,044 KB
最終ジャッジ日時 2023-08-06 07:08:40
合計ジャッジ時間 4,075 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,928 KB
testcase_01 AC 16 ms
7,792 KB
testcase_02 AC 16 ms
7,832 KB
testcase_03 AC 15 ms
7,936 KB
testcase_04 AC 16 ms
7,816 KB
testcase_05 AC 16 ms
7,980 KB
testcase_06 AC 16 ms
7,820 KB
testcase_07 AC 16 ms
7,824 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,828 KB
testcase_10 AC 16 ms
7,824 KB
testcase_11 AC 16 ms
7,812 KB
testcase_12 WA -
testcase_13 AC 16 ms
7,820 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 137 ms
29,948 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 138 ms
29,864 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 136 ms
29,948 KB
testcase_24 AC 136 ms
29,864 KB
testcase_25 AC 135 ms
29,864 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 135 ms
29,856 KB
testcase_29 AC 139 ms
29,860 KB
testcase_30 AC 16 ms
7,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

x=0
for i in range(N):
    if D[i]==i:continue
    j=D[i]
    D[i]=D[j]
    D[j]=j
    x+=1
    
print(('NO','YES')[K>=x and (K-x)%2==0])
0