結果

問題 No.1389 Clumsy Calculation
ユーザー soldraysoldray
提出日時 2021-02-28 15:35:55
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 700 ms
コンパイル使用メモリ 122,112 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 15:59:26
合計ジャッジ時間 4,155 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,812 KB
testcase_02 WA -
testcase_03 AC 3 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 3 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 63 ms
6,944 KB
testcase_15 AC 63 ms
6,944 KB
testcase_16 AC 63 ms
6,940 KB
testcase_17 AC 69 ms
6,940 KB
testcase_18 AC 67 ms
6,940 KB
testcase_19 AC 68 ms
6,944 KB
testcase_20 AC 69 ms
6,940 KB
testcase_21 AC 69 ms
6,940 KB
testcase_22 AC 67 ms
6,944 KB
testcase_23 AC 68 ms
6,940 KB
testcase_24 AC 67 ms
6,944 KB
testcase_25 AC 68 ms
6,944 KB
testcase_26 AC 57 ms
6,944 KB
testcase_27 AC 62 ms
6,944 KB
testcase_28 AC 69 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <iostream>
#include <vector>

using namespace std;

#define LL long long

int main() {
  int N; cin >> N;
  LL X, sum = 0; cin >> X;
  
  vector<LL> S(N);

  for (int i = 0; i < N; i++) {
    cin >> S[i];

    sum += S[i];
  }

  for (int i = 0; i < N; i++) {
    if ((S[i] & 1) == 1) {
      continue;
    }

    if (2 * sum - S[i] == 2 * (N - 1) * X) {
      cout << S[i] / 2 << endl;
    }
  }

  return 0;
}
0