結果

問題 No.2517 Right Triangles on Circle
ユーザー daiotadaiota
提出日時 2023-10-27 22:53:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 611 bytes
コンパイル時間 1,779 ms
コンパイル使用メモリ 173,144 KB
実行使用メモリ 5,644 KB
最終ジャッジ日時 2023-10-27 22:53:19
合計ジャッジ時間 4,215 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 2 ms
4,372 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,372 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 WA -
testcase_14 AC 52 ms
5,564 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 51 ms
5,036 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 43 ms
4,772 KB
testcase_21 AC 63 ms
5,564 KB
testcase_22 AC 16 ms
4,372 KB
testcase_23 AC 47 ms
4,772 KB
testcase_24 WA -
testcase_25 AC 14 ms
4,372 KB
testcase_26 AC 58 ms
5,300 KB
testcase_27 AC 16 ms
4,372 KB
testcase_28 AC 12 ms
4,372 KB
testcase_29 AC 22 ms
4,372 KB
testcase_30 AC 13 ms
4,372 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

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;
		}
		if(M%4==0){
			if(binary_search(a.begin(),a.end(),a[i]+M/4)) ans+=N-2;
			if(binary_search(a.begin(),a.end(),a[i]+3*M/4)) ans+=N-2;
		}
	}


	cout << ans << endl;


	return 0;
}
0