結果

問題 No.2517 Right Triangles on Circle
ユーザー ゆにぽけゆにぽけ
提出日時 2023-10-27 21:38:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 371 ms / 2,000 ms
コード長 800 bytes
コンパイル時間 1,256 ms
コンパイル使用メモリ 132,368 KB
実行使用メモリ 18,756 KB
最終ジャッジ日時 2023-10-27 21:38:48
合計ジャッジ時間 6,183 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 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 371 ms
18,756 KB
testcase_14 AC 208 ms
18,756 KB
testcase_15 AC 366 ms
18,756 KB
testcase_16 AC 222 ms
18,756 KB
testcase_17 AC 286 ms
15,988 KB
testcase_18 AC 258 ms
15,152 KB
testcase_19 AC 219 ms
13,840 KB
testcase_20 AC 207 ms
13,960 KB
testcase_21 AC 365 ms
18,632 KB
testcase_22 AC 38 ms
7,668 KB
testcase_23 AC 246 ms
14,492 KB
testcase_24 AC 75 ms
8,644 KB
testcase_25 AC 31 ms
7,024 KB
testcase_26 AC 301 ms
16,360 KB
testcase_27 AC 33 ms
7,404 KB
testcase_28 AC 26 ms
5,684 KB
testcase_29 AC 72 ms
8,416 KB
testcase_30 AC 38 ms
6,480 KB
testcase_31 AC 247 ms
14,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cassert>
#include<cmath>
#include<ctime>
#include<iomanip>
#include<numeric>
#include<stack>
#include<queue>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<bitset>
#include<random>
#include<functional>
#include<utility>
using namespace std;
void solve();
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int tt = 1;
	//cin >> tt;
	while(tt--) solve();
}
int N,M,A[3 << 17];
void solve()
{
	cin >> N >> M;
	set<int> S;
	for(int i = 0;i < N;i++) cin >> A[i],S.insert(--A[i]);
	if(M & 1) cout << 0 << endl;
	else
	{
		long long ans = 0;
		for(int i = 0;i < N;i++)
		{
			int B = (A[i]+M/2)%M;
			if(S.count(B)) ans += N-2;
		}
		ans /= 2;
		cout << ans << endl;
	}
}

0