結果

問題 No.2517 Right Triangles on Circle
ユーザー 👑 H20H20
提出日時 2023-10-27 22:13:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 446 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 247,176 KB
最終ジャッジ日時 2023-10-27 22:13:52
合計ジャッジ時間 7,539 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,272 KB
testcase_01 AC 41 ms
53,272 KB
testcase_02 AC 40 ms
53,272 KB
testcase_03 AC 40 ms
53,272 KB
testcase_04 AC 40 ms
53,272 KB
testcase_05 AC 41 ms
55,320 KB
testcase_06 AC 43 ms
55,320 KB
testcase_07 AC 41 ms
55,320 KB
testcase_08 AC 41 ms
55,320 KB
testcase_09 AC 40 ms
55,320 KB
testcase_10 AC 42 ms
55,320 KB
testcase_11 AC 41 ms
55,320 KB
testcase_12 AC 43 ms
53,272 KB
testcase_13 AC 429 ms
245,484 KB
testcase_14 AC 360 ms
245,432 KB
testcase_15 AC 446 ms
229,444 KB
testcase_16 AC 413 ms
229,456 KB
testcase_17 AC 336 ms
207,608 KB
testcase_18 AC 360 ms
194,148 KB
testcase_19 AC 287 ms
161,176 KB
testcase_20 AC 288 ms
161,540 KB
testcase_21 AC 403 ms
247,176 KB
testcase_22 AC 160 ms
116,580 KB
testcase_23 AC 308 ms
194,496 KB
testcase_24 AC 159 ms
107,648 KB
testcase_25 AC 126 ms
112,472 KB
testcase_26 AC 353 ms
217,144 KB
testcase_27 AC 135 ms
117,292 KB
testcase_28 AC 126 ms
95,932 KB
testcase_29 AC 148 ms
109,616 KB
testcase_30 AC 125 ms
108,168 KB
testcase_31 AC 312 ms
198,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N,M = map(int, input().split())
A = list(map(int, input().split())) 
C = collections.Counter()
for a in A:
    C[a%M]+=1
ans = 0
for k,v in C.items():
    ans+=v*C[M/2+k]*(N-C[k]-C[M/2+k])
print(ans)
0