結果
問題 | No.338 アンケート機能 |
ユーザー |
![]() |
提出日時 | 2019-12-18 11:46:21 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 76 ms / 2,000 ms |
コード長 | 804 bytes |
コンパイル時間 | 2,011 ms |
コンパイル使用メモリ | 73,924 KB |
実行使用メモリ | 38,144 KB |
最終ジャッジ日時 | 2024-07-06 04:09:28 |
合計ジャッジ時間 | 4,548 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
import java.util.*;import java.io.*;public class Main {public static void main(String[] args) throws Exception {BufferedReader br = new BufferedReader(new InputStreamReader(System.in));String[] first = br.readLine().split(" ", 2);int a = Integer.parseInt(first[0]);int b = Integer.parseInt(first[1]);int min = Integer.MAX_VALUE;for (int i = 0; i <= 1000; i++) {for (int j = 0; j <= 1000; j++) {if (i == 0 && j == 0) {continue;}if (Math.round((100 * i) / (double)(i + j)) == a && Math.round((100 * j) / (double)(i + j)) == b) {min = Math.min(min, i + j);}}}System.out.println(min);}}