結果

問題 No.482 あなたの名は
ユーザー pluto77pluto77
提出日時 2017-02-14 09:17:13
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 259 bytes
コンパイル時間 707 ms
コンパイル使用メモリ 6,636 KB
実行使用メモリ 6,044 KB
最終ジャッジ日時 2023-08-28 16:28:31
合計ジャッジ時間 4,892 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,044 KB
testcase_01 AC 11 ms
5,912 KB
testcase_02 AC 11 ms
5,904 KB
testcase_03 AC 11 ms
5,856 KB
testcase_04 AC 11 ms
5,972 KB
testcase_05 AC 12 ms
6,036 KB
testcase_06 AC 11 ms
6,008 KB
testcase_07 AC 14 ms
6,000 KB
testcase_08 AC 13 ms
5,940 KB
testcase_09 AC 11 ms
6,008 KB
testcase_10 AC 12 ms
5,972 KB
testcase_11 AC 14 ms
5,992 KB
testcase_12 AC 13 ms
5,892 KB
testcase_13 AC 12 ms
5,912 KB
testcase_14 AC 12 ms
5,880 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 k>=cnt and k%2==cnt%2:
 print 'YES'
else:
 print 'NO'
0