結果

問題 No.2517 Right Triangles on Circle
ユーザー ochiaigawaochiaigawa
提出日時 2023-10-27 21:32:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 261 ms / 2,000 ms
コード長 525 bytes
コンパイル時間 1,912 ms
コンパイル使用メモリ 207,336 KB
実行使用メモリ 17,580 KB
最終ジャッジ日時 2023-10-27 21:32:36
合計ジャッジ時間 5,626 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
4,348 KB
testcase_04 AC 1 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 242 ms
17,580 KB
testcase_14 AC 214 ms
17,580 KB
testcase_15 AC 249 ms
17,580 KB
testcase_16 AC 223 ms
17,580 KB
testcase_17 AC 179 ms
15,028 KB
testcase_18 AC 152 ms
14,256 KB
testcase_19 AC 119 ms
13,044 KB
testcase_20 AC 135 ms
13,156 KB
testcase_21 AC 261 ms
17,468 KB
testcase_22 AC 34 ms
7,348 KB
testcase_23 AC 148 ms
13,644 KB
testcase_24 AC 53 ms
8,248 KB
testcase_25 AC 30 ms
6,752 KB
testcase_26 AC 189 ms
15,368 KB
testcase_27 AC 32 ms
7,104 KB
testcase_28 AC 20 ms
5,516 KB
testcase_29 AC 49 ms
8,036 KB
testcase_30 AC 27 ms
6,248 KB
testcase_31 AC 133 ms
13,568 KB
権限があれば一括ダウンロードができます

ソースコード

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;
  set<int> st;
  for(int i = 0; i < N; i++) {
    int A;
    cin >> A;
    st.insert(A);
  }
  if(M % 2 == 1) {
    cout << 0 << '\n';
  } else {
    long long ans = 0;
    for(int x : st) {
      if(st.find(x + M / 2) != st.end()) {
        ans += N - 2;
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
0