結果
| 問題 |
No.338 アンケート機能
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-06 17:38:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 402 bytes |
| コンパイル時間 | 509 ms |
| コンパイル使用メモリ | 70,568 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 14:38:19 |
| 合計ジャッジ時間 | 1,798 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include <cfloat>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
double A, B;
cin >> A >> B;
double ans = DBL_MAX;
for (double a = 0.0; a <= 1000.0; ++a) {
for (double b = 0.0; b <= 1000.0; ++b) {
if (a != 0.0 || b != 0.0) {
if (A == round(100.0 * a / (a + b)) && B == round(100.0 * b / (a + b))) ans = min(a + b, ans);
}
}
}
cout << ans;
}