結果

問題 No.550 夏休みの思い出(1)
ユーザー ei1333333ei1333333
提出日時 2017-07-28 23:43:38
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 621 bytes
コンパイル時間 1,509 ms
コンパイル使用メモリ 158,680 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 12:22:08
合計ジャッジ時間 6,483 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 54 ms
5,376 KB
testcase_02 AC 54 ms
5,376 KB
testcase_03 AC 54 ms
5,376 KB
testcase_04 AC 54 ms
5,376 KB
testcase_05 AC 53 ms
5,376 KB
testcase_06 AC 54 ms
5,376 KB
testcase_07 AC 53 ms
5,376 KB
testcase_08 AC 54 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 54 ms
5,376 KB
testcase_23 AC 53 ms
5,376 KB
testcase_24 AC 54 ms
5,376 KB
testcase_25 AC 53 ms
5,376 KB
testcase_26 AC 53 ms
5,376 KB
testcase_27 AC 53 ms
5,376 KB
testcase_28 AC 52 ms
5,376 KB
testcase_29 AC 52 ms
5,376 KB
testcase_30 AC 53 ms
5,376 KB
testcase_31 WA -
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 AC 54 ms
5,376 KB
testcase_41 AC 52 ms
5,376 KB
testcase_42 AC 52 ms
5,376 KB
testcase_43 AC 53 ms
5,376 KB
testcase_44 AC 53 ms
5,376 KB
testcase_45 AC 52 ms
5,376 KB
testcase_46 AC 53 ms
5,376 KB
testcase_47 AC 55 ms
5,376 KB
testcase_48 AC 53 ms
5,376 KB
testcase_49 AC 52 ms
5,376 KB
testcase_50 AC 53 ms
5,376 KB
testcase_51 AC 53 ms
5,376 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:21:10: warning: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Wdeprecated]
   21 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:25:10: warning: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Wdeprecated]
   25 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:29:10: warning: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Wdeprecated]
   29 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:33:10: warning: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Wdeprecated]
   33 |       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 * x * x + A * x * x + B * x + C);
  };

  for(int64 X = -20000005; X < 20000005; X += 4) {
    if(f(X) == 0) {
      if(flag++) cout << " ";
      cout << X;
    }
    if(f(X + 1) == 0) {
      if(flag++) cout << " ";
      cout << X + 1;
    }
    if(f(X + 2) == 0) {
      if(flag++) cout << " ";
      cout << X + 2;
    }
    if(f(X + 3) == 0) {
      if(flag++) cout << " ";
      cout << X + 3;
    }

  }
  cout << endl;
}
0