結果

問題 No.338 アンケート機能
ユーザー startcpp
提出日時 2016-01-29 22:39:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 56,928 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 02:49:06
合計ジャッジ時間 1,609 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int a, b;
	int ans = 114514;
	cin >> a >> b;
	
	for( int i = 0; i < 2000; i++ ){
		for( int j = 0; j < 2000; j++ ){
			if( i + j == 0 ) continue;
			int sa = 100.0 * i / (i+j) + 0.5;
			int sb = 100.0 * j / (i+j) + 0.5;
			if( sa == a && sb == b )
				ans = min(ans, i + j);
		}
	}
	cout << ans << endl;
	return 0;
}
0