結果

問題 No.338 アンケート機能
ユーザー nenuon
提出日時 2017-06-29 23:53:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 754 bytes
コンパイル時間 902 ms
コンパイル使用メモリ 89,492 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-04 16:55:10
合計ジャッジ時間 1,958 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;

int main(){
  int A, B;
  cin >> A >> B;
  if (A == 0 || B == 0) {
    cout << 1 << endl;
    return 0;
  }
  int ans = 999;
  for(double a = 0; a <= 100; a++) {
    for(double b = 0; b <= 100; b++) {
      if(a == 0 && b == 0) continue;
      if (A == int((100 * a)/(a + b)+0.5) && B == int((100 * b)/(a + b)+0.5)) {
        ans = min(ans, int(a + b));
      }
    }
  }
  cout << ans << endl;
  return 0;
}
0