結果
| 問題 |
No.413 +5,000,000pts
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-12 23:53:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 330 ms / 5,000 ms |
| コード長 | 501 bytes |
| コンパイル時間 | 2,099 ms |
| コンパイル使用メモリ | 59,952 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-07 16:00:46 |
| 合計ジャッジ時間 | 1,449 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include<iostream>
#include<cmath>
using namespace std;
const int CNT_LIMIT = 100000;
long long wrongCalc(long long d) {
return (long long) ((-1 + sqrt(1 + 4 * d)) / 2.0);
}
void work() {
int cnt = 0;
for (long long t = 1; ; ++t) {
long long d = t * t + t - 1;
if (wrongCalc(d) == t) {
cout << d << endl;
++cnt;
if (cnt == CNT_LIMIT) {
break;
}
}
}
}
int main() {
work();
return 0;
}