結果

問題 No.2517 Right Triangles on Circle
ユーザー H20
提出日時 2023-10-27 22:11:37
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 222 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 245,888 KB
最終ジャッジ日時 2024-09-25 14:15:36
合計ジャッジ時間 5,621 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 TLE * 1 -- * 16
権限があれば一括ダウンロードができます

ソースコード

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 i in range(M//2):
    ans+=C[i]*C[M/2+i]*(N-C[i]-C[M/2+i])
print(ans)
0