結果

問題 No.482 あなたの名は
ユーザー pluto77pluto77
提出日時 2017-02-14 09:20:47
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 278 bytes
コンパイル時間 1,207 ms
コンパイル使用メモリ 77,668 KB
実行使用メモリ 102,108 KB
最終ジャッジ日時 2023-08-28 16:29:04
合計ジャッジ時間 6,464 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
80,808 KB
testcase_01 AC 71 ms
76,188 KB
testcase_02 AC 70 ms
76,180 KB
testcase_03 AC 72 ms
76,344 KB
testcase_04 AC 71 ms
76,420 KB
testcase_05 AC 70 ms
76,408 KB
testcase_06 AC 73 ms
76,136 KB
testcase_07 AC 74 ms
77,300 KB
testcase_08 AC 72 ms
76,408 KB
testcase_09 AC 70 ms
76,364 KB
testcase_10 AC 70 ms
76,468 KB
testcase_11 AC 71 ms
77,504 KB
testcase_12 AC 73 ms
77,352 KB
testcase_13 AC 71 ms
76,392 KB
testcase_14 AC 71 ms
76,612 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_482

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