結果

問題 No.550 夏休みの思い出(1)
ユーザー ei1333333ei1333333
提出日時 2017-07-29 00:35:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,603 ms / 2,000 ms
コード長 707 bytes
コンパイル時間 1,996 ms
コンパイル使用メモリ 166,192 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 17:55:17
合計ジャッジ時間 43,292 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,556 ms
5,248 KB
testcase_01 AC 76 ms
5,376 KB
testcase_02 AC 79 ms
5,376 KB
testcase_03 AC 78 ms
5,376 KB
testcase_04 AC 76 ms
5,376 KB
testcase_05 AC 78 ms
5,376 KB
testcase_06 AC 77 ms
5,376 KB
testcase_07 AC 78 ms
5,376 KB
testcase_08 AC 78 ms
5,376 KB
testcase_09 AC 1,551 ms
5,376 KB
testcase_10 AC 1,548 ms
5,376 KB
testcase_11 AC 1,573 ms
5,376 KB
testcase_12 AC 1,570 ms
5,376 KB
testcase_13 AC 1,537 ms
5,376 KB
testcase_14 AC 1,603 ms
5,376 KB
testcase_15 AC 1,536 ms
5,376 KB
testcase_16 AC 1,545 ms
5,376 KB
testcase_17 AC 1,557 ms
5,376 KB
testcase_18 AC 1,551 ms
5,376 KB
testcase_19 AC 1,539 ms
5,376 KB
testcase_20 AC 1,530 ms
5,376 KB
testcase_21 AC 1,560 ms
5,376 KB
testcase_22 AC 78 ms
5,376 KB
testcase_23 AC 79 ms
5,376 KB
testcase_24 AC 78 ms
5,376 KB
testcase_25 AC 76 ms
5,376 KB
testcase_26 AC 76 ms
5,376 KB
testcase_27 AC 77 ms
5,376 KB
testcase_28 AC 77 ms
5,376 KB
testcase_29 AC 79 ms
5,376 KB
testcase_30 AC 77 ms
5,376 KB
testcase_31 AC 1,552 ms
5,376 KB
testcase_32 AC 1,550 ms
5,376 KB
testcase_33 AC 1,542 ms
5,376 KB
testcase_34 AC 1,551 ms
5,376 KB
testcase_35 AC 1,543 ms
5,376 KB
testcase_36 AC 1,533 ms
5,376 KB
testcase_37 AC 1,548 ms
5,376 KB
testcase_38 AC 1,535 ms
5,376 KB
testcase_39 AC 1,525 ms
5,376 KB
testcase_40 AC 76 ms
5,376 KB
testcase_41 AC 78 ms
5,376 KB
testcase_42 AC 78 ms
5,376 KB
testcase_43 AC 77 ms
5,376 KB
testcase_44 AC 77 ms
5,376 KB
testcase_45 AC 76 ms
5,376 KB
testcase_46 AC 75 ms
5,376 KB
testcase_47 AC 77 ms
5,376 KB
testcase_48 AC 76 ms
5,376 KB
testcase_49 AC 75 ms
5,376 KB
testcase_50 AC 78 ms
5,376 KB
testcase_51 AC 75 ms
5,376 KB
testcase_52 AC 78 ms
5,376 KB
testcase_53 AC 78 ms
5,376 KB
testcase_54 AC 76 ms
5,376 KB
testcase_55 AC 77 ms
5,376 KB
testcase_56 AC 78 ms
5,376 KB
testcase_57 AC 76 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:44:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   44 |       if(flag++) cout << " ";
      |          ^~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long int64;

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

  bool flag = false;

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

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

  vector< int64 > vs;

  for(int64 X = -10000000; X < 10000000; X++) {
    if(g(X) == 0) {
      vs.push_back(X);
    }
  }

  if(vs.size() == 3) {
    for(int i = 0; i < vs.size(); i++) {
      if(i) cout << " ";
      cout << vs[i];
    }
    return (0);
  }

  vs.clear();

  for(int64 X = -1000000000; X < 1000000000; X++) {
    if(f(X) == 0) {
      if(flag++) cout << " ";
      cout << X;
    }
  }
}
0