結果

問題 No.413 +5,000,000pts
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-05-22 01:44:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 14 ms / 5,000 ms
コード長 1,205 bytes
コンパイル時間 1,283 ms
コンパイル使用メモリ 88,372 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 10:54:11
合計ジャッジ時間 1,755 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> void chmin(T &t, const T &f) { if (t > f) t = f; }
template <class T> void chmax(T &t, const T &f) { if (t < f) t = f; }


typedef long long ll;

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


int main() {
  const int N = 100000;
  int n = 0;
  for (Int t = 999999999; n < N; --t) {
    // cerr << t << " " << calc(t * t + t - 1) << " " << calc(t * t + t) << endl;
    if (t - 1 != calc(t * t + t - 1)) {
      printf("%lld\n", t * t + t - 1);
      ++n;
    }
  }
  return 0;
}
0