結果

問題 No.2420 Simple Problem
ユーザー えらーめぐえらーめぐ
提出日時 2023-08-12 15:52:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 1,280 ms
コンパイル使用メモリ 167,076 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-30 10:23:58
合計ジャッジ時間 17,638 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 205 ms
6,944 KB
testcase_02 AC 3 ms
6,940 KB
testcase_03 AC 74 ms
6,944 KB
testcase_04 AC 394 ms
6,940 KB
testcase_05 AC 257 ms
6,940 KB
testcase_06 AC 482 ms
6,940 KB
testcase_07 AC 481 ms
6,940 KB
testcase_08 AC 490 ms
6,944 KB
testcase_09 AC 499 ms
6,940 KB
testcase_10 AC 491 ms
6,940 KB
testcase_11 AC 505 ms
6,940 KB
testcase_12 AC 490 ms
6,940 KB
testcase_13 AC 505 ms
6,944 KB
testcase_14 AC 492 ms
6,944 KB
testcase_15 AC 486 ms
6,944 KB
testcase_16 AC 489 ms
6,940 KB
testcase_17 AC 471 ms
6,944 KB
testcase_18 AC 478 ms
6,940 KB
testcase_19 AC 480 ms
6,944 KB
testcase_20 AC 490 ms
6,940 KB
testcase_21 AC 481 ms
6,944 KB
testcase_22 AC 478 ms
6,944 KB
testcase_23 AC 482 ms
6,940 KB
testcase_24 AC 485 ms
6,944 KB
testcase_25 AC 484 ms
6,940 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 196 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
using ld = long double;
bool hitoshii(ll s,ld sahen){
    if(abs((ld)s-(ld)sahen)<=0.0001)return true;
    return false;
}
bool hantei(ll A,ll B,ll X){
    ld a = sqrt(A);ld b = sqrt(B);
    if((ld)X-a-b<=0.0001)return false;
    return true;
}
int main(){
    ll N;cin >> N;
    while(N--){
        ll A,B;cin >> A >> B;
        ld sahen = sqrt(A)+sqrt(B);
        ll s = sahen;
        if(hantei(A,B,s))cout << s << endl;
        else cout << s+1 << endl;
        
    }
}
0