結果

問題 No.2420 Simple Problem
ユーザー throughthrough
提出日時 2023-08-12 14:25:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 531 ms / 2,000 ms
コード長 793 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 203,112 KB
実行使用メモリ 11,360 KB
最終ジャッジ日時 2024-04-30 06:02:53
合計ジャッジ時間 18,854 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 212 ms
6,816 KB
testcase_02 AC 4 ms
6,944 KB
testcase_03 AC 81 ms
6,940 KB
testcase_04 AC 379 ms
9,576 KB
testcase_05 AC 248 ms
7,296 KB
testcase_06 AC 489 ms
11,220 KB
testcase_07 AC 484 ms
11,360 KB
testcase_08 AC 531 ms
11,204 KB
testcase_09 AC 486 ms
11,008 KB
testcase_10 AC 486 ms
11,200 KB
testcase_11 AC 502 ms
11,124 KB
testcase_12 AC 486 ms
11,204 KB
testcase_13 AC 516 ms
11,132 KB
testcase_14 AC 500 ms
11,188 KB
testcase_15 AC 508 ms
11,196 KB
testcase_16 AC 496 ms
11,156 KB
testcase_17 AC 496 ms
11,176 KB
testcase_18 AC 501 ms
11,180 KB
testcase_19 AC 488 ms
11,148 KB
testcase_20 AC 490 ms
11,220 KB
testcase_21 AC 518 ms
11,188 KB
testcase_22 AC 502 ms
11,124 KB
testcase_23 AC 501 ms
11,148 KB
testcase_24 AC 493 ms
11,196 KB
testcase_25 AC 494 ms
11,156 KB
testcase_26 AC 2 ms
6,944 KB
testcase_27 AC 413 ms
9,636 KB
testcase_28 AC 388 ms
9,576 KB
testcase_29 AC 386 ms
9,616 KB
testcase_30 AC 400 ms
9,660 KB
testcase_31 AC 400 ms
9,640 KB
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 206 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint1000000007;
#define rep(i, n) for(ll i = 0; i < n; i++)

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

    cout << setprecision(10) << fixed;
    
    ll n; cin >> n;
    vector<long double> a(n), b(n);
    rep(i,n) cin >> a[i] >> b[i];
    rep(i,n) {
        ll left = 1, right = 1e16;
        while( right-left > 1 ) {
            ll mid = (right+left)/2;
            bool f = ( (long double)(sqrt(a[i])+sqrt(b[i])) < (long double)mid);
            if( f ) right = mid;
            else left = mid;
        }
        cout << right << endl;
    }
    
    return 0;
}
0