結果
| 問題 |
No.1700 floor X
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-08 22:51:17 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 574 bytes |
| コンパイル時間 | 1,160 ms |
| コンパイル使用メモリ | 101,248 KB |
| 最終ジャッジ日時 | 2025-01-24 23:05:32 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 44 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i=0;i < (int)(n);i++)
int main(){
int t;
cin >> t;
while(t--){
ll x;cin >> x;
ll ans = round(sqrt(x));
for (ll i = ans-2;i < ans+3;i++){
if (i*i <= x && (i+1)*(i+1) > x){
cout << i << endl;
break;
}
}
}
return 0;
}