結果
| 問題 | No.338 アンケート機能 |
| コンテスト | |
| ユーザー |
newlife171128
|
| 提出日時 | 2018-01-18 22:25:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 752 bytes |
| コンパイル時間 | 1,519 ms |
| コンパイル使用メモリ | 158,916 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 07:38:57 |
| 合計ジャッジ時間 | 3,300 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#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<=200; i++){
for(int j=0; j<=200; 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;
}
newlife171128