結果

問題 No.2517 Right Triangles on Circle
ユーザー べんけのーびべんけのーび
提出日時 2023-10-30 16:55:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 257 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 171,228 KB
最終ジャッジ日時 2023-10-30 16:55:56
合計ジャッジ時間 5,475 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,516 KB
testcase_01 AC 35 ms
53,516 KB
testcase_02 AC 35 ms
53,516 KB
testcase_03 AC 35 ms
53,516 KB
testcase_04 AC 35 ms
53,516 KB
testcase_05 AC 36 ms
53,516 KB
testcase_06 AC 35 ms
53,516 KB
testcase_07 AC 36 ms
53,516 KB
testcase_08 AC 35 ms
53,516 KB
testcase_09 AC 35 ms
53,516 KB
testcase_10 AC 35 ms
53,516 KB
testcase_11 AC 35 ms
53,516 KB
testcase_12 AC 35 ms
53,516 KB
testcase_13 AC 216 ms
160,716 KB
testcase_14 AC 190 ms
160,396 KB
testcase_15 AC 228 ms
171,228 KB
testcase_16 AC 257 ms
170,720 KB
testcase_17 AC 179 ms
143,568 KB
testcase_18 AC 157 ms
112,968 KB
testcase_19 AC 147 ms
138,996 KB
testcase_20 AC 166 ms
138,916 KB
testcase_21 AC 224 ms
165,336 KB
testcase_22 AC 81 ms
93,804 KB
testcase_23 AC 173 ms
136,912 KB
testcase_24 AC 98 ms
102,448 KB
testcase_25 AC 74 ms
88,224 KB
testcase_26 AC 203 ms
148,696 KB
testcase_27 AC 78 ms
91,016 KB
testcase_28 AC 67 ms
78,876 KB
testcase_29 AC 97 ms
102,172 KB
testcase_30 AC 76 ms
85,652 KB
testcase_31 AC 178 ms
137,588 KB
権限があれば一括ダウンロードができます

ソースコード

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