結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,740 KB
testcase_01 AC 15 ms
7,944 KB
testcase_02 AC 15 ms
7,836 KB
testcase_03 AC 15 ms
7,848 KB
testcase_04 AC 16 ms
7,748 KB
testcase_05 AC 16 ms
7,908 KB
testcase_06 AC 16 ms
7,840 KB
testcase_07 AC 16 ms
7,768 KB
testcase_08 AC 16 ms
7,816 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 16 ms
7,816 KB
testcase_12 AC 16 ms
7,820 KB
testcase_13 AC 16 ms
7,876 KB
testcase_14 WA -
testcase_15 AC 109 ms
29,904 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 108 ms
29,896 KB
testcase_19 AC 106 ms
29,900 KB
testcase_20 AC 108 ms
29,900 KB
testcase_21 AC 108 ms
29,988 KB
testcase_22 WA -
testcase_23 AC 106 ms
30,004 KB
testcase_24 AC 108 ms
29,864 KB
testcase_25 WA -
testcase_26 AC 108 ms
29,940 KB
testcase_27 WA -
testcase_28 AC 108 ms
29,852 KB
testcase_29 AC 113 ms
29,892 KB
testcase_30 AC 15 ms
7,812 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():
	if cnt <= 2:
		return (K - cnt//2) % 2 == 0
	else:
		if cnt % 2 == 0:
			return (K - cnt // 2) % 2 == 0
		else:
			return (K - (cnt // 2 + 1)) % 2 == 0

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