結果

問題 No.2517 Right Triangles on Circle
ユーザー umezoumezo
提出日時 2023-10-27 22:34:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 2,675 ms
コンパイル使用メモリ 207,996 KB
実行使用メモリ 18,500 KB
最終ジャッジ日時 2023-10-27 22:34:19
合計ジャッジ時間 6,586 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 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 2 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 WA -
testcase_14 AC 186 ms
18,452 KB
testcase_15 AC 254 ms
18,452 KB
testcase_16 AC 207 ms
18,452 KB
testcase_17 AC 227 ms
15,548 KB
testcase_18 AC 173 ms
14,756 KB
testcase_19 AC 154 ms
13,436 KB
testcase_20 AC 160 ms
13,700 KB
testcase_21 AC 278 ms
18,188 KB
testcase_22 AC 36 ms
7,392 KB
testcase_23 AC 169 ms
14,228 KB
testcase_24 AC 59 ms
8,292 KB
testcase_25 AC 32 ms
6,796 KB
testcase_26 AC 220 ms
16,076 KB
testcase_27 AC 32 ms
7,148 KB
testcase_28 AC 20 ms
5,560 KB
testcase_29 AC 52 ms
8,156 KB
testcase_30 AC 31 ms
6,292 KB
testcase_31 AC 163 ms
13,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n,m;
  cin>>n>>m;
  vector<int> A(n);
  set<int> s;
  rep(i,n){
    cin>>A[i];
    s.insert(A[i]);
  }
  
  if(m%2){
    cout<<0<<endl;
    return 0;
  }
  
  m/=2;
  ll cnt=0;
  rep(i,n-1){
    if(s.count(m+A[i])) cnt++;
  }
  cout<<cnt*(n-2)<<endl;
    
  return 0;
}
0