結果

問題 No.2517 Right Triangles on Circle
ユーザー cho435cho435
提出日時 2023-10-28 01:50:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 414 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 4,162 ms
コンパイル使用メモリ 267,620 KB
実行使用メモリ 18,672 KB
最終ジャッジ日時 2023-10-28 01:50:35
合計ジャッジ時間 9,847 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 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 409 ms
18,672 KB
testcase_14 AC 89 ms
4,416 KB
testcase_15 AC 414 ms
18,672 KB
testcase_16 AC 297 ms
18,672 KB
testcase_17 AC 301 ms
15,768 KB
testcase_18 AC 267 ms
14,976 KB
testcase_19 AC 232 ms
13,656 KB
testcase_20 AC 251 ms
13,920 KB
testcase_21 AC 411 ms
18,408 KB
testcase_22 AC 34 ms
4,348 KB
testcase_23 AC 273 ms
14,448 KB
testcase_24 AC 103 ms
8,432 KB
testcase_25 AC 29 ms
4,348 KB
testcase_26 AC 367 ms
16,296 KB
testcase_27 AC 31 ms
4,348 KB
testcase_28 AC 38 ms
5,700 KB
testcase_29 AC 95 ms
8,376 KB
testcase_30 AC 52 ms
6,432 KB
testcase_31 AC 287 ms
14,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using mint = atcoder::modint1000000007;

int main(){
	int n,m;
	cin>>n>>m;
	vector<int> a(n);
	rep(i,n) cin>>a.at(i);
	if(m&1){
		cout<<0<<endl;
		return 0;
	}
	rep(i,n) a.at(i)%=m;
	set<int> st;
	rep(i,n) st.insert(a.at(i));
	ll ans=0;
	rep(i,n){
		if(st.count((a.at(i)+m/2)%m)) ans+=n-2;
	}
	cout<<ans/2<<endl;
}
0