結果
問題 | No.338 アンケート機能 |
ユーザー |
![]() |
提出日時 | 2017-11-24 00:29:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 652 ms / 2,000 ms |
コード長 | 805 bytes |
コンパイル時間 | 634 ms |
コンパイル使用メモリ | 80,832 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-27 06:04:03 |
合計ジャッジ時間 | 20,835 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#include <iostream>#include <vector>#include <string>#include <cstring>#include <math.h>#include <cmath>#include <limits.h>#include <map>#include <set>#include <queue>#include <algorithm>#include <functional>#include <stdio.h>using namespace std;long long MOD = 1000000007;int main() {int A,B;cin >> A >> B;int ans = INT_MAX;for ( double a = 0; a <= 10000; a++ ) {for ( double b = 0; b <= 10000; b++ ) {if ( a+b < 1 ) { continue; }int c = static_cast<int>(round(100.0 * a / (a + b)));int d = static_cast<int>(round(100.0 * b / (a + b)));if ( A == c && B == d ) {ans = min( ans, static_cast<int>(a+b) );}}}cout << ans << endl;return 0;}