結果

問題 No.413 +5,000,000pts
ユーザー koba-e964koba-e964
提出日時 2016-12-19 17:10:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 142 ms / 5,000 ms
コード長 998 bytes
コンパイル時間 834 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-21 01:18:36
合計ジャッジ時間 1,249 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;

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

const ll lim = 1e8;
int main(void){
  int pos = 0;
  ll i = 0;
  while (i < lim && pos < 100000) {
    ll d = lim - i - 1;
    d *= d + 1;
    REP(j, 0, 10) {
      ll t = calc(d);
      if (t * t + t <= d && (t + 1) * (t + 2) > d) {
      } else {
	cout << d << endl;
	pos++;
      }
      d--;
    }
    ++i;
  }
}
0