結果

問題 No.2517 Right Triangles on Circle
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-11-29 19:19:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 2,583 ms
コンパイル使用メモリ 207,020 KB
実行使用メモリ 17,536 KB
最終ジャッジ日時 2023-11-29 19:19:50
合計ジャッジ時間 8,819 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 331 ms
17,536 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 324 ms
17,536 KB
testcase_16 AC 290 ms
17,536 KB
testcase_17 AC 268 ms
14,976 KB
testcase_18 AC 225 ms
14,208 KB
testcase_19 AC 185 ms
13,056 KB
testcase_20 AC 197 ms
13,184 KB
testcase_21 AC 324 ms
17,408 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 239 ms
13,568 KB
testcase_24 AC 77 ms
8,192 KB
testcase_25 AC 2 ms
6,676 KB
testcase_26 AC 266 ms
15,360 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 24 ms
6,676 KB
testcase_29 AC 70 ms
8,064 KB
testcase_30 AC 33 ms
6,676 KB
testcase_31 AC 202 ms
13,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    ll N, M, A, ans=0;
    cin >> N >> M;
    set<ll> st;
    if (M % 2 == 1){
        cout << 0 << endl;
        return 0;
    }
    for (int i=0; i<N; i++){
        cin >> A;
        A %= M;
        st.insert(A);
    }

    for (auto x : st){
        if (st.count((x+M/2)%M)) ans += N-2;
    }
    cout << ans/2 << endl;

    return 0;
}
0