結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー yozayoza
提出日時 2015-07-31 23:52:23
言語 Ruby
(3.2.2)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 11,524 KB
実行使用メモリ 31,532 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-23 21:10:36
合計ジャッジ時間 6,555 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
31,532 KB
testcase_01 AC 117 ms
31,200 KB
testcase_02 AC 121 ms
30,908 KB
testcase_03 AC 125 ms
31,164 KB
testcase_04 AC 120 ms
30,728 KB
testcase_05 AC 122 ms
31,120 KB
testcase_06 AC 122 ms
31,276 KB
testcase_07 AC 121 ms
31,324 KB
testcase_08 AC 121 ms
31,104 KB
testcase_09 AC 119 ms
31,416 KB
testcase_10 AC 122 ms
31,180 KB
testcase_11 AC 121 ms
30,716 KB
testcase_12 AC 121 ms
31,340 KB
testcase_13 AC 121 ms
31,064 KB
testcase_14 AC 123 ms
31,364 KB
testcase_15 AC 119 ms
30,696 KB
testcase_16 AC 119 ms
31,512 KB
testcase_17 AC 121 ms
31,416 KB
testcase_18 AC 124 ms
31,024 KB
testcase_19 AC 119 ms
30,936 KB
testcase_20 AC 120 ms
30,888 KB
testcase_21 AC 115 ms
31,088 KB
testcase_22 AC 119 ms
31,392 KB
testcase_23 AC 119 ms
30,732 KB
testcase_24 AC 119 ms
31,368 KB
testcase_25 AC 119 ms
31,296 KB
testcase_26 AC 121 ms
31,252 KB
testcase_27 AC 123 ms
31,044 KB
testcase_28 AC 120 ms
31,132 KB
testcase_29 AC 120 ms
31,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, k = gets.chomp.split.map(&:to_i)
offset = (n-1) % (k+1)
count = 1

if offset == 0
  puts 0
else
  puts offset
end
STDOUT.flush

while gets.to_i < n
  puts count * (k+1) + offset
  STDOUT.flush
  count += 1
end
0