結果

問題 No.2517 Right Triangles on Circle
ユーザー ochiaigawaochiaigawa
提出日時 2023-10-27 21:30:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 554 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 203,744 KB
実行使用メモリ 814,776 KB
最終ジャッジ日時 2023-10-27 21:31:03
合計ジャッジ時間 6,010 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 32 ms
4,500 KB
testcase_14 AC 32 ms
4,500 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 46 ms
9,700 KB
testcase_18 AC 43 ms
10,228 KB
testcase_19 AC 36 ms
8,712 KB
testcase_20 AC 39 ms
10,952 KB
testcase_21 AC 62 ms
14,580 KB
testcase_22 RE -
testcase_23 AC 153 ms
189,552 KB
testcase_24 RE -
testcase_25 MLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
int main() {
  cin.tie(0); cout.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> C(M + 1);
  for(int i = 0; i < N; i++) {
    int A;
    cin >> A;
    C[A]++;
  }
  if(M % 2 == 1) {
    cout << 0 << '\n';
  } else {
    long long ans = 0;
    for(int i = 0; i <= M / 2; i++) {
      int j = i + M / 2;
      ans += (long long) C[i] * C[j] * (N - C[i] - C[j]);
    }
    cout << ans << '\n';
  }
  return 0;
}
0