結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 688 ms
6,812 KB
testcase_01 AC 880 ms
6,944 KB
testcase_02 AC 878 ms
6,940 KB
testcase_03 AC 884 ms
6,940 KB
testcase_04 AC 881 ms
6,940 KB
testcase_05 AC 874 ms
6,944 KB
testcase_06 AC 875 ms
6,940 KB
testcase_07 AC 870 ms
6,944 KB
testcase_08 AC 870 ms
6,940 KB
testcase_09 AC 668 ms
6,940 KB
testcase_10 AC 670 ms
6,944 KB
testcase_11 AC 879 ms
6,940 KB
testcase_12 AC 875 ms
6,944 KB
testcase_13 AC 747 ms
6,940 KB
testcase_14 AC 802 ms
6,944 KB
testcase_15 AC 866 ms
6,944 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 819 ms
6,940 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 871 ms
6,940 KB
testcase_27 AC 880 ms
6,940 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 877 ms
6,944 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 878 ms
6,944 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 870 ms
6,944 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 875 ms
6,944 KB
testcase_50 AC 876 ms
6,944 KB
testcase_51 AC 869 ms
6,940 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 = 1e6;
  double shift2 = 2e5;

  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