結果

問題 No.482 あなたの名は
ユーザー TatsunoTatsuno
提出日時 2017-02-11 16:51:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 233 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 30,000 KB
最終ジャッジ日時 2023-08-28 14:42:59
合計ジャッジ時間 4,128 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,912 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 15 ms
7,744 KB
testcase_03 AC 16 ms
7,812 KB
testcase_04 AC 16 ms
7,760 KB
testcase_05 AC 16 ms
7,776 KB
testcase_06 AC 16 ms
7,732 KB
testcase_07 AC 16 ms
7,756 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,896 KB
testcase_10 AC 16 ms
7,828 KB
testcase_11 AC 16 ms
7,808 KB
testcase_12 WA -
testcase_13 AC 15 ms
7,852 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 151 ms
29,832 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 152 ms
29,948 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 146 ms
29,960 KB
testcase_24 AC 152 ms
29,956 KB
testcase_25 AC 151 ms
29,868 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 148 ms
29,808 KB
testcase_29 AC 140 ms
29,920 KB
testcase_30 AC 16 ms
7,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
d=list(map(lambda x: x-1, map(int,input().split())))
cnt=0
for i in range(n):
    j = d[i]
    if i == j: continue
    cnt+=1
    d[j] = d[i]
print("YES" if cnt == k or (k>cnt and (k-cnt)&1==0) else "NO")
0