結果
| 問題 | 
                            No.2420 Simple Problem
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-08-29 21:52:31 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 715 bytes | 
| コンパイル時間 | 1,641 ms | 
| コンパイル使用メモリ | 166,656 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-12-31 00:02:53 | 
| 合計ジャッジ時間 | 18,690 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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-9;
void solve(){
	ll a,b;
	cin>>a>>b;
	ld l = 0,r = sq;
	ld sa,sb;
	for(int i = 0;i<100;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<100;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();
}