結果

問題 No.2517 Right Triangles on Circle
コンテスト
ユーザー umezo
提出日時 2023-10-27 22:34:11
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 495 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,331 ms
コンパイル使用メモリ 216,580 KB
実行使用メモリ 18,560 KB
最終ジャッジ日時 2026-07-02 21:11:53
合計ジャッジ時間 4,694 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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