結果

問題 No.2517 Right Triangles on Circle
ユーザー ゆにぽけゆにぽけ
提出日時 2023-10-27 21:36:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 792 bytes
コンパイル時間 1,404 ms
コンパイル使用メモリ 126,548 KB
実行使用メモリ 6,276 KB
最終ジャッジ日時 2023-10-27 21:37:01
合計ジャッジ時間 5,085 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,604 KB
testcase_01 AC 3 ms
5,604 KB
testcase_02 AC 2 ms
5,604 KB
testcase_03 AC 2 ms
5,604 KB
testcase_04 AC 2 ms
5,604 KB
testcase_05 AC 2 ms
5,608 KB
testcase_06 AC 2 ms
5,608 KB
testcase_07 AC 3 ms
5,604 KB
testcase_08 AC 2 ms
5,612 KB
testcase_09 AC 2 ms
5,608 KB
testcase_10 AC 2 ms
5,608 KB
testcase_11 AC 2 ms
5,608 KB
testcase_12 AC 2 ms
5,604 KB
testcase_13 AC 33 ms
6,276 KB
testcase_14 AC 32 ms
6,276 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
権限があれば一括ダウンロードができます

ソースコード

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],ex[3 << 17];
void solve()
{
	cin >> N >> M;
	for(int i = 0;i < N;i++) cin >> A[i],ex[--A[i]] = 1;
	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(ex[B]) ans += N-2;
		}
		ans /= 2;
		cout << ans << endl;
	}
}

0