結果
| 問題 |
No.413 +5,000,000pts
|
| ユーザー |
titia
|
| 提出日時 | 2025-01-09 02:30:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 142 ms / 5,000 ms |
| コード長 | 786 bytes |
| コンパイル時間 | 1,830 ms |
| コンパイル使用メモリ | 158,840 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2025-01-09 02:30:18 |
| 合計ジャッジ時間 | 2,322 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll calc(ll d) {
return (ll)((-1 + sqrt(1 + 4*d)) / 2.0);
}
int main() {
vector<long long> ANS;
for (long long c = 2000000000-1; c >= 0; --c) {
long long lc = (c * c - 1) / 4;
for (long long x = lc - 10; x <= lc + 10; ++x) {
//cout<<x<<"\n";
long long ans = static_cast<long long>(calc(x));
if (ans * ans + ans <= x && (ans + 1) * (ans + 1) + ans + 1 <= x) {
ANS.push_back(x);
} else if (ans * ans + ans > x) {
ANS.push_back(x);
}
}
if (ANS.size() == 100000) {
break;
}
}
for (long long ans : ANS) {
cout << ans << endl;
}
return 0;
}
titia