結果

問題 No.2517 Right Triangles on Circle
ユーザー take000
提出日時 2023-10-28 03:52:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 1,808 ms
コンパイル使用メモリ 199,060 KB
最終ジャッジ日時 2025-02-17 16:32:34
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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