結果

問題 No.2517 Right Triangles on Circle
ユーザー daiotadaiota
提出日時 2023-10-27 23:00:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 1,686 ms
コンパイル使用メモリ 172,964 KB
実行使用メモリ 5,564 KB
最終ジャッジ日時 2023-10-27 23:00:30
合計ジャッジ時間 3,933 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 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 2 ms
4,348 KB
testcase_13 AC 61 ms
5,564 KB
testcase_14 AC 49 ms
5,564 KB
testcase_15 AC 72 ms
5,564 KB
testcase_16 AC 61 ms
5,564 KB
testcase_17 AC 50 ms
5,036 KB
testcase_18 AC 47 ms
5,036 KB
testcase_19 AC 42 ms
4,772 KB
testcase_20 AC 46 ms
4,772 KB
testcase_21 AC 67 ms
5,564 KB
testcase_22 AC 17 ms
4,348 KB
testcase_23 AC 49 ms
4,772 KB
testcase_24 AC 24 ms
4,348 KB
testcase_25 AC 14 ms
4,348 KB
testcase_26 AC 57 ms
5,300 KB
testcase_27 AC 15 ms
4,348 KB
testcase_28 AC 11 ms
4,348 KB
testcase_29 AC 23 ms
4,348 KB
testcase_30 AC 14 ms
4,348 KB
testcase_31 AC 49 ms
4,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0