結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,716 KB
testcase_02 WA -
testcase_03 AC 15 ms
7,856 KB
testcase_04 AC 15 ms
7,864 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,756 KB
testcase_07 WA -
testcase_08 AC 16 ms
7,788 KB
testcase_09 AC 15 ms
7,776 KB
testcase_10 AC 16 ms
7,800 KB
testcase_11 AC 16 ms
7,804 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 15 ms
7,812 KB
testcase_15 AC 146 ms
29,832 KB
testcase_16 AC 146 ms
29,892 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 145 ms
29,888 KB
testcase_20 WA -
testcase_21 AC 148 ms
29,864 KB
testcase_22 AC 148 ms
29,840 KB
testcase_23 AC 144 ms
29,924 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 151 ms
29,772 KB
testcase_28 AC 150 ms
29,888 KB
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

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():
	return cnt % 2 == K == 0
if check():
	print('YES')
else:
	print('NO')
0