結果

問題 No.413 +5,000,000pts
ユーザー HachimoriHachimori
提出日時 2016-08-12 23:53:58
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 950 ms / 5,000 ms
コード長 501 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 58,444 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-08-07 12:03:28
合計ジャッジ時間 2,704 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 950 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0