結果
| 問題 |
No.2420 Simple Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-29 21:51:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 713 bytes |
| コンパイル時間 | 1,326 ms |
| コンパイル使用メモリ | 167,792 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-30 23:57:50 |
| 合計ジャッジ時間 | 15,777 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 27 WA * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define ld long double
const ld sq = sqrt(1e9+10);
const ld eps = 1e-8;
void solve(){
ll a,b;
cin>>a>>b;
ld l = 0,r = sq;
ld sa,sb;
for(int i = 0;i<60;i++){
ld mid = (l+r)/2;
if(mid*mid>=a)r = mid;
else l = mid;
}
sa = l;
l = 0,r = sq;
for(int i = 0;i<60;i++){
ld mid = (l+r)/2;
if(mid*mid>=b)r = mid;
else l = mid;
}
sb = l;
ld sum = ceil(sa+sb+eps);
cout<<(ll)round(sum)<<'\n';
return;
}
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int t;cin>>t;
while(t--)solve();
}