結果
| 問題 | No.338 アンケート機能 | 
| コンテスト | |
| ユーザー |  tetsuzuki1115 | 
| 提出日時 | 2017-11-24 00:31:03 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 8 ms / 2,000 ms | 
| コード長 | 803 bytes | 
| コンパイル時間 | 736 ms | 
| コンパイル使用メモリ | 79,204 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-11-27 06:04:05 | 
| 合計ジャッジ時間 | 1,782 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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 <= 1000; a++ ) {
    for ( double b = 0; b <= 1000; 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;
}
            
            
            
        