結果
問題 | No.413 +5,000,000pts |
ユーザー |
![]() |
提出日時 | 2016-08-13 00:19:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 159 ms / 5,000 ms |
コード長 | 637 bytes |
コンパイル時間 | 484 ms |
コンパイル使用メモリ | 60,768 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 16:05:19 |
合計ジャッジ時間 | 1,072 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#include <iostream>#include <cmath>#define ll long longusing namespace std;//t^2 >= 1 + 4dを満たす最大のdを返すll getD(ll t) {return (t * t - 2) / 4;}ll calc(ll d) {return (ll)((-1 + sqrt(1.0 + 4*d)) / 2.0);}ll right(ll d) {ll st = 0, ed = 1145141919, mid; //oooxxx, [st, ed)while (ed - st > 1) {mid = (st + ed) / 2;if (mid * mid + mid <= d) st = mid;else ed = mid;}return st;}int main() {ll t, d;ll cnt = 0;for (t = 600000000; t < 700000000; t++) {d = getD(t);if (right(d) != calc(d)) {cout << d << endl;cnt++;}if (cnt == 100000) {break;}}return 0;}