結果

問題 No.338 アンケート機能
コンテスト
ユーザー hogeover30
提出日時 2016-05-21 17:09:07
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 182 ms / 2,000 ms
+ 876µs
コード長 406 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 293 ms
コンパイル使用メモリ 76,848 KB
実行使用メモリ 9,988 KB
最終ジャッジ日時 2026-09-21 01:38:51
合計ジャッジ時間 7,725 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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