結果

問題 No.2517 Right Triangles on Circle
ユーザー MasKoaTSMasKoaTS
提出日時 2023-08-26 17:01:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 285 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 2,421 ms
コンパイル使用メモリ 202,596 KB
実行使用メモリ 15,348 KB
最終ジャッジ日時 2023-08-26 17:01:34
合計ジャッジ時間 7,309 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 172 ms
15,296 KB
testcase_14 AC 149 ms
15,348 KB
testcase_15 AC 285 ms
15,324 KB
testcase_16 AC 275 ms
15,228 KB
testcase_17 AC 192 ms
13,392 KB
testcase_18 AC 175 ms
12,804 KB
testcase_19 AC 136 ms
12,376 KB
testcase_20 AC 149 ms
12,372 KB
testcase_21 AC 252 ms
14,996 KB
testcase_22 AC 46 ms
6,164 KB
testcase_23 AC 160 ms
12,540 KB
testcase_24 AC 72 ms
7,820 KB
testcase_25 AC 41 ms
5,844 KB
testcase_26 AC 213 ms
13,648 KB
testcase_27 AC 43 ms
6,164 KB
testcase_28 AC 27 ms
5,552 KB
testcase_29 AC 64 ms
7,880 KB
testcase_30 AC 36 ms
5,512 KB
testcase_31 AC 179 ms
12,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int n, m;   cin >> n >> m;
    unordered_set<int> a = {};
    for(int i = 0; i < n; ++i){
        int x;  cin >> x;
        a.insert(x);
    }

    if(m & 1){
        cout << 0 << endl;
        return 0;
    }

    ll ans = 0;
    for(auto itr = a.begin(); itr != a.end(); ++itr){
        int x = (*itr) + m / 2;
        if(a.find(x) == a.end()){
            continue;
        }
        ans += n - 2;
    }
    cout << ans << endl;

    return 0;
}
0