結果
問題 | No.2517 Right Triangles on Circle |
ユーザー |
|
提出日時 | 2023-10-27 21:35:28 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 214 ms / 2,000 ms |
コード長 | 706 bytes |
コンパイル時間 | 1,887 ms |
コンパイル使用メモリ | 197,596 KB |
最終ジャッジ日時 | 2025-02-17 14:40:53 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int, int> pii;typedef pair<ll, ll> pll;#define X first#define Y second#define SZ(a) ((int)a.size())#define ALL(v) v.begin(), v.end()#define pb push_backint arr[300005];int main() {ios::sync_with_stdio(0), cin.tie(0);set<int> vis;int n, m;ll ans = 0;cin >> n >> m;for (int i = 1; i <= n; ++i)cin >> arr[i], arr[i] %= m, vis.insert(arr[i]);if (m & 1)return cout << "0\n", 0;for (int i = 1; i <= n; ++i) {int tar = (m / 2 + arr[i]) % m;if (tar > arr[i] && vis.find(tar) != vis.end())ans += n - 2;}cout << ans << "\n";}