結果

問題 No.482 あなたの名は
ユーザー pluto77pluto77
提出日時 2017-02-14 09:57:25
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 611 ms
コンパイル使用メモリ 6,708 KB
実行使用メモリ 23,220 KB
最終ジャッジ日時 2023-08-28 16:29:15
合計ジャッジ時間 5,672 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,980 KB
testcase_01 AC 11 ms
5,948 KB
testcase_02 AC 12 ms
5,840 KB
testcase_03 AC 13 ms
5,912 KB
testcase_04 AC 11 ms
5,980 KB
testcase_05 WA -
testcase_06 AC 11 ms
5,912 KB
testcase_07 AC 12 ms
5,908 KB
testcase_08 AC 11 ms
5,940 KB
testcase_09 AC 12 ms
5,864 KB
testcase_10 AC 11 ms
6,040 KB
testcase_11 AC 12 ms
6,092 KB
testcase_12 WA -
testcase_13 AC 12 ms
5,944 KB
testcase_14 AC 12 ms
5,940 KB
testcase_15 AC 250 ms
23,188 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 248 ms
23,152 KB
testcase_19 AC 252 ms
23,084 KB
testcase_20 AC 258 ms
23,184 KB
testcase_21 AC 253 ms
23,184 KB
testcase_22 AC 255 ms
23,220 KB
testcase_23 AC 253 ms
23,220 KB
testcase_24 AC 252 ms
23,056 KB
testcase_25 AC 254 ms
23,060 KB
testcase_26 WA -
testcase_27 AC 256 ms
23,120 KB
testcase_28 WA -
testcase_29 AC 238 ms
23,076 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_482

n,k=map(int,raw_input().split())
d=map(int,raw_input().split())
r=[-1 for i in xrange(n)]
for i in xrange(n):
 d[i]=d[i]-1
 r[d[i]]=i
cnt=0
for i in xrange(n):
 if d[i]!=i:
  d[i],d[r[i]]=d[r[i]],d[i]
  r[d[i]]=i
  r[d[r[i]]]=r[i]
  cnt+=1
if k>=cnt and k%2==cnt%2:
 print 'YES'
else:
 print 'NO'
0