結果

問題 No.942 プレゼント配り
ユーザー maimai
提出日時 2019-12-05 00:18:11
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 223 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-05-08 12:36:31
合計ジャッジ時間 3,935 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 191 ms
12,416 KB
testcase_02 AC 79 ms
12,160 KB
testcase_03 AC 77 ms
12,160 KB
testcase_04 AC 186 ms
12,288 KB
testcase_05 WA -
testcase_06 AC 77 ms
12,032 KB
testcase_07 AC 82 ms
12,160 KB
testcase_08 AC 164 ms
12,416 KB
testcase_09 AC 176 ms
12,544 KB
testcase_10 AC 75 ms
12,160 KB
testcase_11 AC 77 ms
12,160 KB
testcase_12 AC 78 ms
12,032 KB
testcase_13 AC 78 ms
12,160 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 76 ms
12,288 KB
testcase_19 AC 76 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:11: warning: assigned but unused variable - i
Syntax OK

ソースコード

diff #

def lscan; gets.split.map(&:to_i); end

n, k = lscan

k2 = k*2
if n/k2*k2 != n
  puts 'No'
  exit
end
puts 'Yes'
i = 0
k.times do |i|
  (n/k2).times do |j|
    print (j*k2+i+1).to_s+' '+(j*k2+k2-i).to_s+' '
  end
  puts
end
0