結果

問題 No.2517 Right Triangles on Circle
ユーザー GOTKAKOGOTKAKO
提出日時 2023-10-27 21:32:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 1,507 ms
コンパイル使用メモリ 176,020 KB
実行使用メモリ 31,724 KB
最終ジャッジ日時 2023-10-27 21:32:46
合計ジャッジ時間 5,956 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 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 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 266 ms
24,692 KB
testcase_14 AC 175 ms
17,660 KB
testcase_15 AC 325 ms
31,720 KB
testcase_16 AC 301 ms
31,724 KB
testcase_17 AC 220 ms
25,760 KB
testcase_18 AC 205 ms
24,388 KB
testcase_19 AC 179 ms
21,956 KB
testcase_20 AC 189 ms
22,372 KB
testcase_21 AC 296 ms
30,792 KB
testcase_22 AC 36 ms
7,428 KB
testcase_23 AC 195 ms
23,828 KB
testcase_24 AC 73 ms
13,056 KB
testcase_25 AC 31 ms
6,832 KB
testcase_26 AC 232 ms
27,296 KB
testcase_27 AC 34 ms
7,184 KB
testcase_28 AC 28 ms
7,596 KB
testcase_29 AC 68 ms
12,632 KB
testcase_30 AC 39 ms
9,056 KB
testcase_31 AC 222 ms
23,700 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:17:13: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   17 |     for(auto[a,c] : A){
      |             ^

ソースコード

diff #

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N,M; cin >> N >> M;
    map<int,int> A;
    for(int i=0; i<N; i++){
        int a; cin >> a;
        A[a] = 1;
    }
    if(M%2){cout << 0 << endl; return 0;}

    long long answer = 0;
    for(auto[a,c] : A){
        if(c == 0) continue;
        if(A[a+M/2] == 1) answer += N-2; 
    }
    cout << answer << endl;
}
0