結果

問題 No.2517 Right Triangles on Circle
ユーザー nono00nono00
提出日時 2023-10-28 05:17:50
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 288 ms / 2,000 ms
コード長 759 bytes
コンパイル時間 3,160 ms
コンパイル使用メモリ 252,240 KB
実行使用メモリ 19,612 KB
最終ジャッジ日時 2023-10-28 05:17:57
合計ジャッジ時間 7,599 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 AC 281 ms
19,612 KB
testcase_14 AC 30 ms
5,620 KB
testcase_15 AC 288 ms
19,612 KB
testcase_16 AC 245 ms
19,612 KB
testcase_17 AC 204 ms
16,708 KB
testcase_18 AC 190 ms
15,916 KB
testcase_19 AC 153 ms
14,332 KB
testcase_20 AC 162 ms
14,596 KB
testcase_21 AC 278 ms
19,612 KB
testcase_22 AC 11 ms
4,372 KB
testcase_23 AC 181 ms
15,124 KB
testcase_24 AC 60 ms
8,788 KB
testcase_25 AC 9 ms
4,372 KB
testcase_26 AC 220 ms
16,972 KB
testcase_27 AC 10 ms
4,372 KB
testcase_28 AC 22 ms
5,656 KB
testcase_29 AC 57 ms
8,524 KB
testcase_30 AC 31 ms
6,412 KB
testcase_31 AC 169 ms
14,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

namespace nono {

struct Init {};

void solve([[maybe_unused]] const Init& init) {
    long long n, m;
    std::cin >> n >> m;
    std::vector<long long> a(n);
    for (int i = 0; i < n; i++) std::cin >> a[i];
    if (m % 2 == 1) {
        std::cout << 0 << std::endl;
        return;
    }
    long long half = m / 2;
    std::set<long long> s(a.begin(), a.end());
    long long ans = 0;
    for (auto v: a) {
        if (s.contains(v + half)) {
            ans += n - 2;
        }
    }
    std::cout << ans << std::endl;
}

}  //  namespace nono

int main() {
    std::cin.tie(0)->sync_with_stdio(0);
    std::cout << std::fixed << std::setprecision(16);

    int t = 1;
    nono::Init init;

    while (t--) nono::solve(init);
}
0