結果

問題 No.550 夏休みの思い出(1)
ユーザー ei1333333ei1333333
提出日時 2017-07-29 00:20:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,834 bytes
コンパイル時間 1,795 ms
コンパイル使用メモリ 167,456 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-18 17:43:08
合計ジャッジ時間 51,968 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 833 ms
6,940 KB
testcase_02 AC 830 ms
6,940 KB
testcase_03 AC 826 ms
6,940 KB
testcase_04 AC 844 ms
6,940 KB
testcase_05 AC 835 ms
6,944 KB
testcase_06 AC 843 ms
6,940 KB
testcase_07 AC 836 ms
6,944 KB
testcase_08 AC 828 ms
6,944 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 840 ms
6,944 KB
testcase_23 AC 833 ms
6,944 KB
testcase_24 AC 837 ms
6,944 KB
testcase_25 AC 826 ms
6,940 KB
testcase_26 AC 826 ms
6,944 KB
testcase_27 AC 829 ms
6,940 KB
testcase_28 AC 834 ms
6,940 KB
testcase_29 AC 836 ms
6,944 KB
testcase_30 AC 834 ms
6,944 KB
testcase_31 AC 838 ms
6,940 KB
testcase_32 AC 829 ms
6,940 KB
testcase_33 AC 841 ms
6,940 KB
testcase_34 AC 838 ms
6,940 KB
testcase_35 AC 831 ms
6,940 KB
testcase_36 AC 835 ms
6,944 KB
testcase_37 AC 826 ms
6,940 KB
testcase_38 AC 828 ms
6,944 KB
testcase_39 AC 839 ms
6,944 KB
testcase_40 AC 838 ms
6,940 KB
testcase_41 AC 832 ms
6,940 KB
testcase_42 AC 831 ms
6,940 KB
testcase_43 AC 837 ms
6,944 KB
testcase_44 AC 826 ms
6,944 KB
testcase_45 AC 846 ms
6,944 KB
testcase_46 AC 833 ms
6,944 KB
testcase_47 AC 832 ms
6,940 KB
testcase_48 AC 826 ms
6,940 KB
testcase_49 AC 831 ms
6,944 KB
testcase_50 AC 830 ms
6,940 KB
testcase_51 AC 847 ms
6,940 KB
testcase_52 AC 838 ms
6,944 KB
testcase_53 AC 836 ms
6,940 KB
testcase_54 AC 826 ms
6,940 KB
testcase_55 AC 829 ms
6,944 KB
testcase_56 AC 829 ms
6,944 KB
testcase_57 AC 840 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:65:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   65 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:69:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   69 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:73:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   73 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:77:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   77 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:81:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   81 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:85:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   85 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:89:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   89 |       if(flag++) cout << " ";
      |          ^~~~
main.cpp:93:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated]
   93 |       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);
  };

  for(int64 X = -100000000; X < 100000000; X += 8) {
    if(g(X) == 0) {
      if(exchange(flag, 1)) cout << " ";

      cout << X;
    }
    if(g(X + 1) == 0) {
      if(exchange(flag, 1)) cout << " ";
      cout << X + 1;
    }
    if(g(X + 2) == 0) {
      if(exchange(flag, 1)) cout << " ";
      cout << X + 2;
    }
    if(g(X + 3) == 0) {
      if(exchange(flag, 1)) cout << " ";
      cout << X + 3;
    }
    if(g(X + 4) == 0) {
      if(exchange(flag, 1)) cout << " ";
      cout << X + 4;
    }
    if(g(X + 5) == 0) {
      if(exchange(flag, 1)) cout << " ";
      cout << X + 5;
    }
    if(g(X + 6) == 0) {
      if(exchange(flag, 1)) cout << " ";
      cout << X + 6;
    }
    if(g(X + 7) == 0) {
      if(exchange(flag, 1)) cout << " ";
      cout << X + 7;
    }
  }
  cout << endl;
  return (0);


  for(int64 X = -1000000000; X < 1000000000; X += 8) {
    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;
    }
    if(f(X + 4) == 0) {
      if(flag++) cout << " ";
      cout << X + 4;
    }
    if(f(X + 5) == 0) {
      if(flag++) cout << " ";
      cout << X + 5;
    }
    if(f(X + 6) == 0) {
      if(flag++) cout << " ";
      cout << X + 6;
    }
    if(f(X + 7) == 0) {
      if(flag++) cout << " ";
      cout << X + 7;
    }
  }
  cout << endl;
}
0