結果

問題 No.413 +5,000,000pts
ユーザー alpha_virginisalpha_virginis
提出日時 2016-08-12 23:58:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,108 bytes
コンパイル時間 1,640 ms
コンパイル使用メモリ 163,716 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-04-25 05:54:17
合計ジャッジ時間 1,998 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

template<typename T> T in() { abort(); return T(); }
template<> std::string in() { std::string str; std::cin >> str; return str; }
template<> int in() { int x; scanf("%d", &x); return x; }

template<typename T> void out(T x) { abort(); }
template<> void out(const char* x) { printf("%s\n", x); }
template<> void out(std::string x) { std::cout << x << std::endl; }
template<> void out(int x) { printf("%d\n", x); }
template<> void out(long x) { printf("%ld\n", x); }

template<typename T>
T pow(T x, long n) {
  T res = 1;
  T p = x;
  while( n != 0 ) {
    if( n & 0x01 ) res *= p;
    p *= p;
    n >>= 1;
  }
  return res;
}


int xs[3];
int n;
int ys[128];

long f(long x) {
  return (long)(-1 + sqrt(1 + 4 * x) / 2.0);
}

bool test(long x) {
  long t = f(x);
  if( not ( t * t + t <= x ) ) return false; 
  long s = t + 1;  
  if( s * s + s <= x ) return false;
  return true;
}

int main() {
  int count = 0;
  for(long x = 36028797114438492LL; ;++x) {
    if( not test(x) ) {
      out(x);
      count += 1;
      if( count == 100000 ) break;
    }
  }
        
  return 0;
}
0