結果

問題 No.2420 Simple Problem
ユーザー えらーめぐ
提出日時 2023-08-12 15:14:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 1,659 ms
コンパイル使用メモリ 167,692 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-20 00:42:44
合計ジャッジ時間 19,489 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

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