結果
問題 | No.2517 Right Triangles on Circle |
ユーザー |
|
提出日時 | 2023-10-27 23:00:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 71 ms / 2,000 ms |
コード長 | 473 bytes |
コンパイル時間 | 1,652 ms |
コンパイル使用メモリ | 172,596 KB |
実行使用メモリ | 5,760 KB |
最終ジャッジ日時 | 2024-09-25 15:00:46 |
合計ジャッジ時間 | 3,795 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int,int> P;#define REP(i,n) for(int i=0;i<int(n);i++)int main(void){cin.tie(nullptr); ios_base::sync_with_stdio(false);ll i,j;ll N,M;cin >> N >> M;vector<ll> a(N);for(i=0;i<N;i++) cin >> a[i];sort(a.begin(),a.end());ll ans=0;for(i=0;i<N;i++){if(M%2==0){if(binary_search(a.begin(),a.end(),a[i]+M/2)) ans+=N-2;}}cout << ans << endl;return 0;}