結果
| 問題 | No.338 アンケート機能 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-08 15:16:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 823 bytes |
| コンパイル時間 | 604 ms |
| コンパイル使用メモリ | 81,212 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-06 19:44:53 |
| 合計ジャッジ時間 | 1,582 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#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 = 1; i <=200; i++) {
ll num_a = round((A*i) / 100.0);
ll 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 ((num_a + num_b) == i) {
if (((ll)(round((100.0 * num_a) / i)) == A) && ((ll)(round((100.0 * num_b) / i)) == B)) {
cout << i << endl;
return 0;
}
}
}
cout << 200 << endl;
return 0;
}