結果

問題 No.2517 Right Triangles on Circle
ユーザー umezoumezo
提出日時 2023-10-27 22:36:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 308 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 3,724 ms
コンパイル使用メモリ 211,380 KB
実行使用メモリ 18,452 KB
最終ジャッジ日時 2023-10-27 22:36:34
合計ジャッジ時間 7,183 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 1 ms
4,372 KB
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 2 ms
4,372 KB
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 2 ms
4,372 KB
testcase_07 AC 2 ms
4,372 KB
testcase_08 AC 2 ms
4,372 KB
testcase_09 AC 2 ms
4,372 KB
testcase_10 AC 2 ms
4,372 KB
testcase_11 AC 2 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 AC 293 ms
18,452 KB
testcase_14 AC 300 ms
18,452 KB
testcase_15 AC 308 ms
18,452 KB
testcase_16 AC 291 ms
18,452 KB
testcase_17 AC 235 ms
15,548 KB
testcase_18 AC 210 ms
14,756 KB
testcase_19 AC 214 ms
13,436 KB
testcase_20 AC 174 ms
13,700 KB
testcase_21 AC 300 ms
18,188 KB
testcase_22 AC 47 ms
7,392 KB
testcase_23 AC 191 ms
14,228 KB
testcase_24 AC 70 ms
8,292 KB
testcase_25 AC 38 ms
6,796 KB
testcase_26 AC 270 ms
16,076 KB
testcase_27 AC 44 ms
7,148 KB
testcase_28 AC 24 ms
5,560 KB
testcase_29 AC 64 ms
8,156 KB
testcase_30 AC 36 ms
6,292 KB
testcase_31 AC 190 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);
  
  ll n,m;
  cin>>n>>m;
  vector<int> A(n);
  set<int> s;
  rep(i,n){
    cin>>A[i];
    s.insert(A[i]);
  }
  sort(ALL(A));
  
  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