結果

問題 No.338 アンケート機能
ユーザー nksk38
提出日時 2017-07-08 15:07:01
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 764 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 79,360 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 19:44:47
合計ジャッジ時間 1,720 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;

int main()
{
	int A, B;
	cin >> A >> B;

	for (int i = 2; i <= 100; i++) {
		int num_a = round((A*i) / 100.0);
		int num_b = round((B*i) / 100.0);
		//cout << num_a << " " << num_b << " " << i << " " << ((ll)(round((100.0 * num_a) / i))==A)  << " " << ((ll)(round((100.0 * num_b) / i))== B ) << endl;
		if (((ll)(round((100.0 * num_a) / i)) == A) && ((ll)(round((100.0 * num_b) / i)) == B)) {
			cout << i << endl;
			break;
		}
	}
	return 0;
}
0