結果
問題 |
No.2517 Right Triangles on Circle
|
ユーザー |
|
提出日時 | 2023-10-27 23:22:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 542 bytes |
コンパイル時間 | 1,754 ms |
コンパイル使用メモリ | 199,756 KB |
最終ジャッジ日時 | 2025-02-17 16:01:18 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 WA * 1 |
ソースコード
#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 ans = 0, cnt = 0; set<ll> st; rep(i, N) { st.insert(A[i]); ll rev = (A[i] + M) % (2 * M); ans += cnt; if (st.find(rev) != st.end()) { ans += i - 1; cnt++; } } cout << ans << "\n"; return 0; }