結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー sei0osei0o
提出日時 2017-06-02 22:55:41
言語 Ruby
(3.2.2)
結果
AC  
実行時間 886 ms / 2,000 ms
コード長 153 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 11,912 KB
実行使用メモリ 16,220 KB
最終ジャッジ日時 2023-10-22 01:24:08
合計ジャッジ時間 4,770 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
16,220 KB
testcase_01 AC 112 ms
16,220 KB
testcase_02 AC 104 ms
16,216 KB
testcase_03 AC 139 ms
16,220 KB
testcase_04 AC 83 ms
16,108 KB
testcase_05 AC 82 ms
16,112 KB
testcase_06 AC 82 ms
16,112 KB
testcase_07 AC 83 ms
16,108 KB
testcase_08 AC 87 ms
16,112 KB
testcase_09 AC 123 ms
16,220 KB
testcase_10 AC 886 ms
16,220 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i

1.upto(n / 3) do |a|
  1.upto((n - a) / 2) do |b|
    c = n - a - b
    if a <= b && b <= c
      puts "#{a} #{b} #{c}"
    end
  end
end
0