結果
| 問題 | No.338 アンケート機能 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-01-29 23:33:59 | 
| 言語 | Ruby (3.4.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 301 bytes | 
| コンパイル時間 | 106 ms | 
| コンパイル使用メモリ | 7,424 KB | 
| 実行使用メモリ | 12,288 KB | 
| 最終ジャッジ日時 | 2024-09-21 18:45:34 | 
| 合計ジャッジ時間 | 3,558 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 17 WA * 11 | 
コンパイルメッセージ
Syntax OK
ソースコード
a, b = gets.split.map(&:to_i)
ans = nil
for x in 0..100 do
  for y in 0..100 do
    next if x == 0 || y == 0
    t1 = ((100 * x).to_f / (x + y)).round
    t2 = ((100 * y).to_f / (x + y)).round
    next unless t1 == a
    next unless t2 == b
    ans = x + y if !ans || x + y < ans
  end
end
puts ans
            
            
            
        