結果

問題 No.115 遠足のおやつ
ユーザー gigurururugigurururu
提出日時 2014-12-28 23:45:49
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 149 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 11,560 KB
実行使用メモリ 15,484 KB
最終ジャッジ日時 2023-09-03 18:50:30
合計ジャッジ時間 5,447 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 AC 85 ms
15,108 KB
testcase_03 WA -
testcase_04 AC 83 ms
15,264 KB
testcase_05 AC 81 ms
15,108 KB
testcase_06 AC 84 ms
15,204 KB
testcase_07 AC 84 ms
15,292 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 83 ms
15,240 KB
testcase_14 AC 83 ms
15,160 KB
testcase_15 AC 83 ms
15,224 KB
testcase_16 AC 85 ms
15,080 KB
testcase_17 AC 86 ms
15,108 KB
testcase_18 AC 84 ms
15,192 KB
testcase_19 AC 84 ms
15,196 KB
testcase_20 AC 85 ms
15,084 KB
testcase_21 AC 87 ms
15,248 KB
testcase_22 AC 86 ms
15,204 KB
testcase_23 WA -
testcase_24 AC 85 ms
15,084 KB
testcase_25 AC 83 ms
15,188 KB
testcase_26 AC 84 ms
15,056 KB
testcase_27 AC 85 ms
15,272 KB
testcase_28 AC 83 ms
15,252 KB
testcase_29 AC 83 ms
15,084 KB
testcase_30 AC 86 ms
15,224 KB
testcase_31 AC 83 ms
15,148 KB
testcase_32 AC 83 ms
15,292 KB
testcase_33 AC 82 ms
15,144 KB
testcase_34 AC 84 ms
15,052 KB
testcase_35 AC 82 ms
15,096 KB
testcase_36 AC 82 ms
15,268 KB
testcase_37 AC 83 ms
15,088 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 83 ms
15,036 KB
testcase_41 AC 86 ms
15,004 KB
testcase_42 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - ans
Syntax OK

ソースコード

diff #

n,d,k=gets.split.map(&:to_i)
ans=[]
sum=k*(k+1)/2
diff=d-sum
m=diff/(n-k)
puts sum>d ?-1:[*1..k-m-1,k-m+(diff-m*(n-k)),*(k-m+1..k).map{|i|i+n-k}]*" "
0