結果

問題 No.338 アンケート機能
ユーザー hogeover30hogeover30
提出日時 2016-05-21 17:09:07
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 345 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 66,188 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-07 21:45:35
合計ジャッジ時間 12,288 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 345 ms
4,376 KB
testcase_01 AC 340 ms
4,376 KB
testcase_02 AC 340 ms
4,380 KB
testcase_03 AC 341 ms
4,380 KB
testcase_04 AC 340 ms
4,376 KB
testcase_05 AC 341 ms
4,376 KB
testcase_06 AC 335 ms
4,376 KB
testcase_07 AC 303 ms
4,376 KB
testcase_08 AC 341 ms
4,376 KB
testcase_09 AC 304 ms
4,380 KB
testcase_10 AC 340 ms
4,376 KB
testcase_11 AC 342 ms
4,380 KB
testcase_12 AC 339 ms
4,380 KB
testcase_13 AC 342 ms
4,380 KB
testcase_14 AC 341 ms
4,376 KB
testcase_15 AC 339 ms
4,376 KB
testcase_16 AC 342 ms
4,376 KB
testcase_17 AC 340 ms
4,380 KB
testcase_18 AC 341 ms
4,380 KB
testcase_19 AC 310 ms
4,376 KB
testcase_20 AC 312 ms
4,376 KB
testcase_21 AC 341 ms
4,376 KB
testcase_22 AC 335 ms
4,380 KB
testcase_23 AC 337 ms
4,376 KB
testcase_24 AC 326 ms
4,376 KB
testcase_25 AC 311 ms
4,376 KB
testcase_26 AC 339 ms
4,380 KB
testcase_27 AC 333 ms
4,376 KB
testcase_28 AC 334 ms
4,380 KB
testcase_29 AC 339 ms
4,376 KB
testcase_30 AC 318 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    int a, b; cin>>a>>b;
    int res=1<<30;
    for(int i=0; i<10000; ++i) {
        for(int j=0; j<10000; ++j) if (i+j) {
            int x=i*1000/(i+j);
            int y=j*1000/(i+j);
            if (10*a-5<=x and x<=10*a+4 and 10*b-5<=y and y<=10*b+4)
                res=min(res, i+j);
        }
    }
    cout<<res<<endl;
}
0