結果

問題 No.482 あなたの名は
ユーザー 6soukiti296soukiti29
提出日時 2017-03-21 01:40:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 107,248 KB
最終ジャッジ日時 2023-09-18 13:42:00
合計ジャッジ時間 4,628 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,424 KB
testcase_01 AC 73 ms
71,032 KB
testcase_02 AC 74 ms
71,004 KB
testcase_03 AC 70 ms
71,388 KB
testcase_04 AC 71 ms
71,388 KB
testcase_05 AC 72 ms
71,300 KB
testcase_06 AC 72 ms
71,244 KB
testcase_07 AC 72 ms
71,304 KB
testcase_08 WA -
testcase_09 AC 71 ms
71,200 KB
testcase_10 AC 72 ms
71,264 KB
testcase_11 AC 72 ms
71,392 KB
testcase_12 WA -
testcase_13 AC 72 ms
71,088 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 115 ms
107,088 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 116 ms
106,812 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 115 ms
106,840 KB
testcase_24 AC 115 ms
106,716 KB
testcase_25 AC 116 ms
106,768 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 118 ms
107,204 KB
testcase_29 AC 114 ms
107,248 KB
testcase_30 AC 72 ms
71,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def min_gokan(A):
	count = 0
	for i,a in enumerate(A):
		if a - 1 != i:
			A[i],A[a - 1] = A[a - 1],A[i]
			count = count + 1
	return count
		

m = min_gokan(L)
if m > K:
	print("NO")
elif (K - m) % 2 == 0:
	print("YES")
else:
	print("NO")
0