結果

問題 No.413 +5,000,000pts
ユーザー kimiyukikimiyuki
提出日時 2016-10-07 19:59:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 69,144 KB
実行使用メモリ 6,812 KB
最終ジャッジ日時 2024-05-01 15:02:35
合計ジャッジ時間 1,340 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cmath>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
typedef long long ll;
using namespace std;

ll calc(ll d) {
    return (ll)((-1 + sqrt(1 + 4*d)) / 2.0);
}

ll sq(ll x) { return x * x; }
bool check(ll t, ll d) {
    return sq(t)+t <= d and sq(t+1)+(t+1) > d;
}
int main() {
    const int n = 1e5;
    ll t = 999999999;
    for (int i = 0; i < n; ++ i) {
        repeat (dd,100) {
            ll d = sq(t)+t-dd;
            if (check(calc(d), d)) continue;
            cout << d << endl;
            if (++ i >= n) break;
        }
        -- t;
    }
    return 0;
}
0