結果

問題 No.482 あなたの名は
ユーザー 6soukiti296soukiti29
提出日時 2017-03-20 22:31:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 30,040 KB
最終ジャッジ日時 2023-09-18 13:22:34
合計ジャッジ時間 4,185 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,816 KB
testcase_01 AC 15 ms
7,856 KB
testcase_02 AC 16 ms
7,804 KB
testcase_03 AC 17 ms
7,912 KB
testcase_04 AC 17 ms
7,780 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,780 KB
testcase_07 WA -
testcase_08 AC 16 ms
7,932 KB
testcase_09 AC 15 ms
7,812 KB
testcase_10 AC 16 ms
7,852 KB
testcase_11 AC 16 ms
7,804 KB
testcase_12 AC 16 ms
7,804 KB
testcase_13 WA -
testcase_14 AC 16 ms
7,800 KB
testcase_15 AC 164 ms
29,928 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 166 ms
30,012 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 167 ms
29,928 KB
testcase_23 WA -
testcase_24 AC 171 ms
29,992 KB
testcase_25 WA -
testcase_26 AC 167 ms
30,016 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 139 ms
29,848 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
L = list(map(int,input().split()))
j = 0
for i,k in enumerate(L):
	if L[k - 1] == i + 1:
		j = j + 1
	if k == i + 1:
		j = j + 1
j = j // 2
if K < N - 1 - j:
	print("NO")
else:
	K = K - N + j
	if K % 2 == 0:
		print("YES")
	else:
		print("NO")
0