結果

問題 No.482 あなたの名は
ユーザー tookunn_1213tookunn_1213
提出日時 2017-02-10 23:22:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 30,096 KB
最終ジャッジ日時 2023-08-28 08:59:20
合計ジャッジ時間 3,562 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,780 KB
testcase_01 AC 17 ms
7,776 KB
testcase_02 AC 15 ms
7,792 KB
testcase_03 AC 15 ms
7,968 KB
testcase_04 AC 16 ms
7,692 KB
testcase_05 AC 15 ms
7,804 KB
testcase_06 AC 15 ms
7,900 KB
testcase_07 AC 15 ms
7,808 KB
testcase_08 AC 15 ms
7,804 KB
testcase_09 AC 15 ms
7,772 KB
testcase_10 AC 16 ms
7,768 KB
testcase_11 AC 16 ms
7,864 KB
testcase_12 AC 16 ms
7,864 KB
testcase_13 AC 15 ms
7,848 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 105 ms
29,900 KB
testcase_18 AC 107 ms
29,912 KB
testcase_19 WA -
testcase_20 AC 107 ms
29,928 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 106 ms
29,836 KB
testcase_25 WA -
testcase_26 AC 110 ms
29,848 KB
testcase_27 WA -
testcase_28 AC 111 ms
29,856 KB
testcase_29 AC 111 ms
30,000 KB
testcase_30 AC 16 ms
7,788 KB
権限があれば一括ダウンロードができます

ソースコード

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