結果

問題 No.482 あなたの名は
ユーザー hanorver
提出日時 2017-03-03 22:28:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 167 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 29,808 KB
最終ジャッジ日時 2024-06-22 05:51:42
合計ジャッジ時間 4,194 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.py:4: SyntaxWarning: invalid decimal literal
  else:print("NO"if b%2or b<0else"YES")
Main.py:4: SyntaxWarning: invalid decimal literal
  else:print("NO"if b%2or b<0else"YES")

ソースコード

diff #

d=lambda:map(int,input().split());a,b=d();c=list(d())
for i in range(len(c)):
 while c[i]!=i+1:b-=1;c[c[i]-1],c[i]=c[i],c[c[i]-1]
else:print("NO"if b%2or b<0else"YES")
0