結果

問題 No.482 あなたの名は
ユーザー mmmpppmmmppp
提出日時 2017-02-13 19:33:24
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 123 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 11,288 KB
実行使用メモリ 29,596 KB
最終ジャッジ日時 2023-08-28 15:39:43
合計ジャッジ時間 5,089 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 76 ms
15,228 KB
testcase_03 AC 76 ms
15,208 KB
testcase_04 WA -
testcase_05 AC 77 ms
15,180 KB
testcase_06 WA -
testcase_07 AC 77 ms
15,092 KB
testcase_08 AC 77 ms
15,160 KB
testcase_09 AC 75 ms
15,092 KB
testcase_10 AC 77 ms
15,072 KB
testcase_11 WA -
testcase_12 AC 77 ms
15,092 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 163 ms
29,400 KB
testcase_17 AC 165 ms
29,456 KB
testcase_18 AC 165 ms
29,376 KB
testcase_19 WA -
testcase_20 AC 164 ms
29,380 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 165 ms
29,392 KB
testcase_27 AC 164 ms
29,388 KB
testcase_28 WA -
testcase_29 AC 161 ms
29,572 KB
testcase_30 AC 76 ms
15,296 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,k,*d=$<.read.split.map &:to_i
c=0
n.times{|i|d[i]==m=i+1||(c+=1;d[d.index m],d[i]=d[i],m)}
puts c<=k&&1&(k^c)<1?:YES: :NO
0