結果

問題 No.338 アンケート機能
ユーザー nenuon
提出日時 2017-06-29 23:57:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 781 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 89,656 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 16:55:17
合計ジャッジ時間 1,652 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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.0; a <= 100.0; a+=1.0) {
    for(double b = 0.0; b <= 100.0; b+=1.0) {
      if(a == 0 && b == 0) continue;
      if (A == int((100.0 * a) / (a + b) + 0.5) && B == int((100.0 * b) / (a + b) + 0.5)) {
        ans = min(ans, int(a + b));
      }
    }
  }
  cout << ans << endl;
  return 0;
}
0