結果
| 問題 | No.338 アンケート機能 | 
| コンテスト | |
| ユーザー |  tetsuzuki1115 | 
| 提出日時 | 2017-11-24 00:22:27 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 797 bytes | 
| コンパイル時間 | 799 ms | 
| コンパイル使用メモリ | 80,420 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-27 06:03:21 | 
| 合計ジャッジ時間 | 1,682 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 19 WA * 9 | 
ソースコード
#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 <= 100; a++ ) {
    for ( double b = 0; b <= 100; b++ ) {
        
        if ( a+b < 1 ) { continue; }
        
        int c =  static_cast<int>(round(100 * a / (a + b)));
        int d =  static_cast<int>(round(100 * b / (a + b)));
        
        if ( A == c && B == d ) {
            ans = min( ans, static_cast<int>(a+b) );
        }
    }
    }
    
    cout << ans << endl;
    
    return 0;
}
            
            
            
        