結果

問題 No.2517 Right Triangles on Circle
ユーザー KKT89KKT89
提出日時 2023-10-27 22:19:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 838 bytes
コンパイル時間 2,755 ms
コンパイル使用メモリ 218,948 KB
実行使用メモリ 18,588 KB
最終ジャッジ日時 2023-10-27 22:19:11
合計ジャッジ時間 7,160 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 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 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 286 ms
18,588 KB
testcase_14 AC 241 ms
18,588 KB
testcase_15 AC 294 ms
18,588 KB
testcase_16 AC 217 ms
18,588 KB
testcase_17 AC 207 ms
15,684 KB
testcase_18 AC 186 ms
14,892 KB
testcase_19 AC 182 ms
13,572 KB
testcase_20 AC 167 ms
13,836 KB
testcase_21 AC 278 ms
18,324 KB
testcase_22 AC 36 ms
7,500 KB
testcase_23 AC 205 ms
14,364 KB
testcase_24 AC 64 ms
8,556 KB
testcase_25 AC 30 ms
6,868 KB
testcase_26 AC 227 ms
16,212 KB
testcase_27 AC 34 ms
7,236 KB
testcase_28 AC 23 ms
5,632 KB
testcase_29 AC 62 ms
8,292 KB
testcase_30 AC 32 ms
6,364 KB
testcase_31 AC 165 ms
14,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}
inline double time() {
    return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,m; cin >> n >> m;
    vector<int> a(n);
    set<int> st;
    for (int i = 0; i < n; ++i) {
        cin >> a[i]; a[i] -= 1;
        st.insert(a[i]);
    }
    ll cnt = 0;
    if (m%2 == 0) {
        for (int i = 0; i < n; ++i) {
            if (st.find(a[i]+m/2) != st.end()) cnt += 1;
        }
    }
    cout << cnt*(n-2) << endl;
}
0