結果

問題 No.2420 Simple Problem
ユーザー FplusFplusFFplusFplusF
提出日時 2023-08-12 13:49:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 246 ms / 2,000 ms
コード長 758 bytes
コンパイル時間 2,015 ms
コンパイル使用メモリ 199,548 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-30 04:13:02
合計ジャッジ時間 12,278 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 99 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 40 ms
5,376 KB
testcase_04 AC 192 ms
5,376 KB
testcase_05 AC 123 ms
5,376 KB
testcase_06 AC 239 ms
5,376 KB
testcase_07 AC 241 ms
5,376 KB
testcase_08 AC 241 ms
5,376 KB
testcase_09 AC 241 ms
5,376 KB
testcase_10 AC 240 ms
5,376 KB
testcase_11 AC 241 ms
5,376 KB
testcase_12 AC 240 ms
5,376 KB
testcase_13 AC 241 ms
5,376 KB
testcase_14 AC 241 ms
5,376 KB
testcase_15 AC 242 ms
5,376 KB
testcase_16 AC 243 ms
5,376 KB
testcase_17 AC 240 ms
5,376 KB
testcase_18 AC 241 ms
5,376 KB
testcase_19 AC 241 ms
5,376 KB
testcase_20 AC 246 ms
5,376 KB
testcase_21 AC 243 ms
5,376 KB
testcase_22 AC 241 ms
5,376 KB
testcase_23 AC 240 ms
5,376 KB
testcase_24 AC 242 ms
5,376 KB
testcase_25 AC 241 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 191 ms
5,376 KB
testcase_28 AC 196 ms
5,376 KB
testcase_29 AC 195 ms
5,376 KB
testcase_30 AC 192 ms
5,376 KB
testcase_31 AC 195 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 98 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
using ld=long double;
const ll INF=(1ll<<60);
#define rep(i,n) for (ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(),v.end()
template<class T> void chmin(T &a,T b){
    if(a>b){
        a=b;
    }
}
template<class T> void chmax(T &a,T b){
    if(a<b){
        a=b;
    }
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin >> n;
    while(n--){
        ld a,b;
        cin >> a >> b;
        a=sqrtl(a);
        b=sqrtl(b);
        ll ok=INF,ng=0;
        while(1<abs(ok-ng)){
            ll mid=(ok+ng)/2;
            if(a+b<mid) ok=mid;
            else ng=mid;
        }
        cout << ok << '\n';
    }
}
0