結果

問題 No.338 アンケート機能
ユーザー mako55gomako55go
提出日時 2016-01-30 00:58:54
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 445 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 62,036 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 17:40:16
合計ジャッジ時間 1,457 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include <math.h>
using namespace std;
int shishagonyu(double x)
{
	return (int)(x < 0.0 ? x - 0.5 : x + 0.5);
}
int main() {
	double a, b, A, B,s=1000;
	double ans;
	cin >> A >> B;
	if (A > B) swap(A, B);
	for (a = 0; a < 100; a++) {
		for (b = a; b < 200; b++) {
			ans = (100*b / (a + b));
			ans = shishagonyu(ans);
			if (B == ans) {
				if (s > a + b) {
					s = a + b;
				}
			}
		}
	}
	cout << s << endl;
	return 0;
}
0