結果

問題 No.2517 Right Triangles on Circle
ユーザー take000take000
提出日時 2023-10-28 04:10:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 310 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 2,211 ms
コンパイル使用メモリ 206,536 KB
実行使用メモリ 17,680 KB
最終ジャッジ日時 2023-10-28 04:10:26
合計ジャッジ時間 6,820 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 2 ms
4,372 KB
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 2 ms
4,372 KB
testcase_07 AC 2 ms
4,372 KB
testcase_08 AC 2 ms
4,372 KB
testcase_09 AC 2 ms
4,372 KB
testcase_10 AC 2 ms
4,372 KB
testcase_11 AC 2 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 AC 286 ms
17,680 KB
testcase_14 AC 264 ms
17,680 KB
testcase_15 AC 310 ms
17,680 KB
testcase_16 AC 232 ms
17,680 KB
testcase_17 AC 189 ms
15,128 KB
testcase_18 AC 171 ms
14,356 KB
testcase_19 AC 147 ms
13,144 KB
testcase_20 AC 195 ms
13,256 KB
testcase_21 AC 286 ms
17,568 KB
testcase_22 AC 42 ms
7,448 KB
testcase_23 AC 158 ms
13,744 KB
testcase_24 AC 54 ms
8,348 KB
testcase_25 AC 36 ms
6,852 KB
testcase_26 AC 216 ms
15,468 KB
testcase_27 AC 41 ms
7,204 KB
testcase_28 AC 21 ms
5,616 KB
testcase_29 AC 53 ms
8,136 KB
testcase_30 AC 29 ms
6,348 KB
testcase_31 AC 171 ms
13,668 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);

    int N, M;
    cin >> N >> M;
    set<ll> st;
    rep(i, N) {
        ll a;
        cin >> a;
        st.insert(a * 2);
    }

    ll ans = 0;
    for (ll s : st) {
        ll x = s + M;
        if (st.find(x) != st.end())
            ans += N - 2;
    }

    cout << ans << "\n";

    return 0;
}
0