結果

問題 No.2517 Right Triangles on Circle
ユーザー Nzt3Nzt3
提出日時 2023-10-27 21:41:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 2,029 ms
コンパイル使用メモリ 206,304 KB
実行使用メモリ 17,672 KB
最終ジャッジ日時 2023-10-27 21:41:16
合計ジャッジ時間 5,456 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 245 ms
17,672 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 252 ms
17,672 KB
testcase_16 AC 165 ms
17,672 KB
testcase_17 AC 210 ms
15,120 KB
testcase_18 AC 174 ms
14,348 KB
testcase_19 AC 141 ms
13,136 KB
testcase_20 AC 148 ms
13,248 KB
testcase_21 AC 236 ms
17,560 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 158 ms
13,736 KB
testcase_24 AC 60 ms
8,340 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 224 ms
15,460 KB
testcase_27 AC 1 ms
4,348 KB
testcase_28 AC 22 ms
5,608 KB
testcase_29 AC 57 ms
8,128 KB
testcase_30 AC 31 ms
6,340 KB
testcase_31 AC 162 ms
13,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N,M;
  cin>>N>>M;
  if(M%2){
    puts("0");
    return 0;
  }
  set<int>A;
  ll ans=0;
  for(int i=0;i<N;i++){
    int t;
    cin>>t;
    if(A.count(t-M/2)||A.count(t+M/2)){
      ans+=N-2;
    }
    A.insert(t);
  }
  cout<<ans<<'\n';
}
0