結果

問題 No.482 あなたの名は
ユーザー pluto77pluto77
提出日時 2017-02-14 09:20:47
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 278 bytes
コンパイル時間 1,718 ms
コンパイル使用メモリ 76,700 KB
実行使用メモリ 170,836 KB
最終ジャッジ日時 2024-12-29 21:08:51
合計ジャッジ時間 49,915 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 TLE * 15
権限があれば一括ダウンロードができます

ソースコード

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