結果

問題 No.2517 Right Triangles on Circle
ユーザー take000take000
提出日時 2023-10-28 03:52:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 2,119 ms
コンパイル使用メモリ 208,520 KB
実行使用メモリ 19,624 KB
最終ジャッジ日時 2023-10-28 03:52:32
合計ジャッジ時間 6,236 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 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 1 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 1 ms
4,348 KB
testcase_13 WA -
testcase_14 AC 254 ms
19,580 KB
testcase_15 AC 288 ms
19,580 KB
testcase_16 AC 180 ms
19,580 KB
testcase_17 AC 212 ms
16,676 KB
testcase_18 AC 181 ms
15,884 KB
testcase_19 AC 148 ms
14,300 KB
testcase_20 AC 145 ms
14,564 KB
testcase_21 AC 241 ms
19,580 KB
testcase_22 AC 47 ms
7,700 KB
testcase_23 AC 150 ms
15,092 KB
testcase_24 AC 73 ms
8,756 KB
testcase_25 AC 39 ms
6,908 KB
testcase_26 AC 196 ms
16,940 KB
testcase_27 AC 43 ms
7,436 KB
testcase_28 AC 24 ms
5,628 KB
testcase_29 AC 56 ms
8,492 KB
testcase_30 AC 31 ms
6,380 KB
testcase_31 AC 156 ms
15,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
typedef long long ll;
using namespace std;

int main() {
    cin.tie(0)->sync_with_stdio(0);

    ll N, M;
    cin >> N >> M;
    vector<ll> A(N);
    rep(i, N) cin >> A[i], A[i] *= 2;

    ll cnt = 0;
    set<ll> st;
    rep(i, N) {
        st.insert(A[i]);

        if (st.find((A[i] + M) % (2 * M)) != st.end()) {
            cnt++;
        }
    }

    ll ans = cnt * (N - 2);
    cout << ans << "\n";

    return 0;
}
0