結果
問題 |
No.1700 floor X
|
ユーザー |
![]() |
提出日時 | 2021-10-09 00:35:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 219 ms |
コンパイル使用メモリ | 31,104 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-03 10:37:20 |
合計ジャッジ時間 | 1,883 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 44 |
ソースコード
/* -*- coding: utf-8 -*- * * 1700.cc: No.1700 floor X - yukicoder */ #include<cstdio> using namespace std; /* constant */ const int MAX_R = 1000000000; /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ /* main */ int main() { int tn; scanf("%d", &tn); while (tn--) { ll n; scanf("%lld", &n); int r0 = 1, r1 = MAX_R + 1; while (r0 + 1 < r1) { int r = (r0 + r1) / 2; if ((ll)r * r <= n) r0 = r; else r1 = r; } printf("%d\n", r0); } return 0; }