結果

問題 No.2517 Right Triangles on Circle
ユーザー baluteshihbaluteshih
提出日時 2023-10-27 21:35:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 706 bytes
コンパイル時間 2,019 ms
コンパイル使用メモリ 206,564 KB
実行使用メモリ 18,848 KB
最終ジャッジ日時 2023-10-27 21:35:35
合計ジャッジ時間 5,632 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 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 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 214 ms
18,848 KB
testcase_14 AC 153 ms
18,848 KB
testcase_15 AC 222 ms
18,848 KB
testcase_16 AC 167 ms
18,848 KB
testcase_17 AC 154 ms
16,080 KB
testcase_18 AC 166 ms
15,244 KB
testcase_19 AC 120 ms
13,932 KB
testcase_20 AC 122 ms
14,052 KB
testcase_21 AC 216 ms
18,724 KB
testcase_22 AC 33 ms
7,760 KB
testcase_23 AC 140 ms
14,584 KB
testcase_24 AC 51 ms
8,736 KB
testcase_25 AC 28 ms
7,116 KB
testcase_26 AC 191 ms
16,452 KB
testcase_27 AC 32 ms
7,496 KB
testcase_28 AC 20 ms
5,776 KB
testcase_29 AC 59 ms
8,508 KB
testcase_30 AC 32 ms
6,572 KB
testcase_31 AC 131 ms
14,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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_back

int 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";
}
0