結果

問題 No.482 あなたの名は
ユーザー tookunn_1213tookunn_1213
提出日時 2017-02-11 00:02:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 30,060 KB
最終ジャッジ日時 2023-08-28 10:23:12
合計ジャッジ時間 4,236 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,868 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 17 ms
7,820 KB
testcase_03 AC 15 ms
7,816 KB
testcase_04 AC 16 ms
7,788 KB
testcase_05 AC 16 ms
7,820 KB
testcase_06 AC 15 ms
7,816 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 15 ms
7,892 KB
testcase_10 AC 16 ms
7,840 KB
testcase_11 AC 16 ms
7,904 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 145 ms
30,048 KB
testcase_16 AC 148 ms
29,924 KB
testcase_17 AC 146 ms
29,924 KB
testcase_18 AC 147 ms
29,992 KB
testcase_19 AC 149 ms
29,920 KB
testcase_20 AC 147 ms
29,840 KB
testcase_21 AC 145 ms
29,836 KB
testcase_22 AC 148 ms
29,984 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 151 ms
29,984 KB
testcase_26 AC 152 ms
29,876 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 162 ms
30,028 KB
testcase_30 AC 15 ms
7,816 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:
		a,b = D[i]-1,D[D[i]-1]-1
		D[a],D[b] = D[b],D[a]
		cnt+=1
def check():
	if K < cnt:
		return False
	return (K - cnt) % 2 == 0
if check():
	print('YES')
else:
	print('NO')
0