結果

問題 No.482 あなたの名は
ユーザー tookunn_1213
提出日時 2017-02-10 23:22:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 30,292 KB
最終ジャッジ日時 2024-12-29 04:56:53
合計ジャッジ時間 4,669 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
D = list(map(int,input().split()))
cnt = 0
for i in range(N):
	if D[i] != i+1:
		cnt+=1
def check():
	ma,mi = 0,0
	mi = cnt // 2
	if cnt % 2 == 1:
		mi+=1
	ma = max(0,cnt - 1)

	if mi <= K and mi % 2 == K % 2:
		return True
	if ma <= K and ma % 2 == K % 2:
		return True
	return False

if check():
	print('YES')
else:
	print('NO')
0