結果
| 問題 |
No.2420 Simple Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-12 15:52:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 550 bytes |
| コンパイル時間 | 1,580 ms |
| コンパイル使用メモリ | 167,796 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-20 04:30:59 |
| 合計ジャッジ時間 | 19,738 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 27 WA * 6 |
ソースコード
#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;
}
}