結果

問題 No.2517 Right Triangles on Circle
コンテスト
ユーザー yu_w(ゆ)
提出日時 2023-10-27 21:41:28
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 351 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 221 ms
コンパイル使用メモリ 85,632 KB
実行使用メモリ 180,352 KB
最終ジャッジ日時 2026-04-12 18:26:32
合計ジャッジ時間 3,702 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N,M=map(int,input().split())
A=list(map(int,input().split()))

d=dict()
for i in range(N):
    if A[i] in d.keys():
        d[A[i]]+=1
    else:
        d[A[i]]=1
    
if M%2!=0:
    print(0)
    exit()

ans=0
for i in d.keys():
    if i>=M//2+1:
        continue
    j=i+M//2
    if j in d.keys():
        ans+=d[i]*d[j]*(N-d[i]-d[j])
    
print(ans)
0