結果

問題 No.550 夏休みの思い出(1)
ユーザー ei1333333ei1333333
提出日時 2017-07-28 23:17:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 790 bytes
コンパイル時間 1,938 ms
コンパイル使用メモリ 170,592 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-18 11:42:09
合計ジャッジ時間 30,315 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 368 ms
6,816 KB
testcase_01 AC 477 ms
6,940 KB
testcase_02 AC 468 ms
6,944 KB
testcase_03 AC 463 ms
6,940 KB
testcase_04 AC 474 ms
6,944 KB
testcase_05 AC 475 ms
6,944 KB
testcase_06 AC 465 ms
6,944 KB
testcase_07 AC 468 ms
6,940 KB
testcase_08 AC 475 ms
6,944 KB
testcase_09 AC 367 ms
6,944 KB
testcase_10 AC 358 ms
6,944 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 402 ms
6,940 KB
testcase_14 AC 434 ms
6,944 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 477 ms
6,944 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 467 ms
6,940 KB
testcase_25 AC 474 ms
6,944 KB
testcase_26 AC 470 ms
6,940 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 464 ms
6,944 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 470 ms
6,944 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 473 ms
6,944 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 467 ms
6,940 KB
testcase_50 AC 475 ms
6,940 KB
testcase_51 AC 470 ms
6,948 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:37:8: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   37 |     if(first++) cout << " ";
      |        ^~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long int64;

int main()
{
  int64 A, B, C;
  cin >> A >> B >> C;

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

  set< int64 > vs;

  double shift = 1e5;
  double shift2 = 1e4;

  for(double low = -1000000001; low <= 1000000001; low += shift) {
    double high = low + shift;
    for(int i = 0; i < 100; i++) {
      double left = (low * 2 + high) / 3;
      double right = (low + high * 2) / 3;
      if(abs(f(left)) < abs(f(right))) high = right;
      else low = left;
    }
    for(int64 j = low - shift2; j <= low + shift2; j++) {
      if(f(j) == 0) vs.emplace(j);
    }
  }

  bool first = false;
  for(auto &s : vs) {
    if(first++) cout << " ";
    cout << s;
  }
  cout << endl;

}

0