結果

問題 No.2517 Right Triangles on Circle
ユーザー eve__fuyukieve__fuyuki
提出日時 2023-11-29 04:38:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 624 bytes
コンパイル時間 2,280 ms
コンパイル使用メモリ 208,308 KB
実行使用メモリ 18,560 KB
最終ジャッジ日時 2023-11-29 04:39:01
合計ジャッジ時間 9,326 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_06 WA -
testcase_07 AC 2 ms
6,676 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 378 ms
18,560 KB
testcase_14 AC 208 ms
18,560 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 37 ms
7,552 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 31 ms
6,912 KB
testcase_26 WA -
testcase_27 AC 35 ms
7,296 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
void fast_io() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}

int main() {
    fast_io();
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    set<int> st;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i] %= m;
        st.insert(a[i]);
    }
    if (m % 2) {
        cout << 0 << endl;
        return 0;
    }
    long long ans = 0;
    for (int i = 0; i < n; i++) {
        int x = ((m / 2 - a[i]) % m + m) % m;
        if (st.find(x) != st.end()) {
            ans += n - 2;
        }
    }
    ans /= 2;
    cout << ans << endl;
}
0