結果

問題 No.550 夏休みの思い出(1)
ユーザー ei1333333
提出日時 2017-07-29 00:01:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 1,158 bytes
コンパイル時間 2,299 ms
コンパイル使用メモリ 197,636 KB
最終ジャッジ日時 2025-01-05 02:01:27
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample TLE * 3
other TLE * 55
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long int64;

int main()
{
  int64 a, b, c;
  cin >> a >> b >> c;

  __int128 A, B, C;
  A = a, B = b, C = c;

  bool flag = false;

  auto f = [&](__int128 x)
  {
    return (x * x * x - A * x * x - B * x - C);
  };

  for(__int128 X = -1000000000; X < 1000000000; X += 8) {
    if(f(X) == 0) {
      if(exchange(flag, true)) cout << " ";
      cout << (int) X;
    }
    if(f(X + 1) == 0) {
      if(exchange(flag, true)) cout << " ";
      cout << (int) X + 1;
    }
    if(f(X + 2) == 0) {
      if(exchange(flag, true)) cout << " ";
      cout << (int) X + 2;
    }
    if(f(X + 3) == 0) {
      if(exchange(flag, true)) cout << " ";
      cout << (int) X + 3;
    }
    if(f(X + 4) == 0) {
      if(exchange(flag, true)) cout << " ";
      cout << (int) X + 4;
    }
    if(f(X + 5) == 0) {
      if(exchange(flag, true)) cout << " ";
      cout << (int) X + 5;
    }
    if(f(X + 6) == 0) {
      if(exchange(flag, true)) cout << " ";
      cout << (int) X + 6;
    }
    if(f(X + 7) == 0) {
      if(exchange(flag, true)) cout << " ";
      cout << (int) X + 7;
    }
  }
  cout << endl;
}
0