結果
| 問題 |
No.2420 Simple Problem
|
| コンテスト | |
| ユーザー |
through
|
| 提出日時 | 2023-08-12 14:22:13 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 778 bytes |
| コンパイル時間 | 2,002 ms |
| コンパイル使用メモリ | 196,324 KB |
| 最終ジャッジ日時 | 2025-02-16 04:43:20 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 27 WA * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint1000000007;
#define rep(i, n) for(ll i = 0; i < n; i++)
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
cout << setprecision(10) << fixed;
ll n; cin >> n;
vector<double> a(n), b(n);
rep(i,n) cin >> a[i] >> b[i];
rep(i,n) {
ll left = 1, right = 1e16;
while( right-left > 1 ) {
ll mid = (right+left)/2;
bool f = ( (double)(sqrt(a[i])+sqrt(b[i])) < (double)mid);
if( f ) right = mid;
else left = mid;
}
cout << right << endl;
}
return 0;
}
through