結果

問題 No.1700 floor X
ユーザー V_Melville
提出日時 2021-10-08 22:46:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 340 bytes
コンパイル時間 3,060 ms
コンパイル使用メモリ 190,768 KB
最終ジャッジ日時 2025-01-24 23:00:19
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 41 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using std::cin;
using std::cout;
using ll = long long;

ll mySqrt(ll x) {
	if (x == 0) return 0;
	ll res = exp(0.5 * log(x));
	return ((res + 1) * (res + 1) <= x ? res + 1 : res);
}

int main() {
	int t;
	cin >> t;
	
	while (t--) {
		ll n;
		cin >> n;
		ll ans = mySqrt(n);
		cout << ans << '\n';
	}
	
	return 0;
}
0