結果

問題 No.338 アンケート機能
ユーザー newlife171128
提出日時 2018-01-18 22:20:05
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 753 bytes
コンパイル時間 1,512 ms
コンパイル使用メモリ 158,380 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 11:27:01
合計ジャッジ時間 2,617 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
#include <stack>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <string.h>
#include <utility>

typedef long long ll;
using namespace std;

typedef pair<int, int> P;

double calc_a(double a, double b){

	return round(100*a/(a+b));
}
double calc_b(double a, double b){

	return round(100*b/(a+b));
}
int main() {

	double a,b;
	cin>>a>>b;

	bool judge =false;
	for(int i=0; i<=100; i++){
		for(int j=0; j<=100; j++ ){

			if(a == calc_a(i,j) && b == calc_b(i,j)){
				cout<<i+j<<endl;
				judge = true;
			}

			if(judge)break;
		}
		if(judge)break;
	}

	return 0;
}
0