結果

問題 No.413 +5,000,000pts
ユーザー treeonetreeone
提出日時 2016-08-13 00:01:03
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 789 bytes
コンパイル時間 1,300 ms
コンパイル使用メモリ 158,440 KB
実行使用メモリ 6,816 KB
最終ジャッジ日時 2024-04-25 05:54:49
合計ジャッジ時間 1,885 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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() {
    int cnt = 0;
    for(ll i = 90000000; i >= 80000000; i--){
         ll d = i * i + i; //cin >> d;
        ll t = calc(d);
        //cout << t << endl;
        //cout << t*t + t << endl;
        t++;
        //cout << t*t + t << endl;
        if(t*t + t <= d){
            // cout << "NG!!" << endl;
            // cout <<d << ' ' <<  i  << ' ' << t - 1<< endl;
            cout << d << endl;
            cnt++;
        }
        else{
            // cout << "OK" << endl;
            // cout << d <<  ' ' << i << endl;
        }
        if(cnt == 100000){
             //cout << "OK" << endl;
            break;
        }
    }
  return 0;
}
0