結果

問題 No.2420 Simple Problem
ユーザー dyktr_06
提出日時 2023-08-12 04:31:06
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 498 bytes
コンパイル時間 1,706 ms
コンパイル使用メモリ 194,824 KB
最終ジャッジ日時 2025-02-16 02:44:03
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

const long double EPS = 5e-15;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n; cin >> n;
    
    while(n--){
        int a, b; cin >> a >> b;
        int ok = 65000, ng = 0;
        while(ok - ng > 1){
            int mid = (ok + ng) / 2;
            if(sqrtl(a) + sqrt(b) < mid - EPS){
                ok = mid;
            }else{
                ng = mid;
            }
        }
        cout << ok << endl;
    }
}
0