結果

問題 No.338 アンケート機能
ユーザー めうめう🎒
提出日時 2016-01-29 23:53:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 1,169 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 74,048 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 02:54:00
合計ジャッジ時間 1,631 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)
int main() {
int a,b,ans = INF;
cin >> a >> b;
for(double i = 0;i <= 1000;i++){
for(double j = 0;j <= 1000;j++){
if((int)(100 * i / (i + j) + 0.5) == a && (int)(100 * j / (i + j) + 0.5) == b) {
ans = min(ans,int(i + j));
break;
}
if((int)(100 * j / (j + i) + 0.5) == a && (int)(100 * i / (j + i) + 0.5) == b) {
ans = min(ans,int(i + j));
break;
}
if((int)(100 * i / (i + j) + 0.5) == b && (int)(100 * j / (i + j) + 0.5) == a) {
ans = min(ans,int(i + j));
break;
}
if((int)(100 * j / (j + i) + 0.5) == b && (int)(100 * i / (j + i) + 0.5) == a) {
ans = min(ans,int(i + j));
break;
}
}
}
cout << ans << endl;
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0