結果

問題 No.2517 Right Triangles on Circle
ユーザー べんけのーび
提出日時 2023-10-30 16:55:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 171,484 KB
最終ジャッジ日時 2024-09-25 17:19:26
合計ジャッジ時間 5,086 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
A = list(map(lambda x:int(x)%M, input().split()))
A.sort()
Aset = set(A)
if M%2:
	print(0)
	exit()
ans = 0
i = 0
while i < N and A[i] < M//2:
	if (A[i] + M//2) % M in Aset:
		ans += N-2
	i += 1

print(ans)
0