結果

問題 No.2517 Right Triangles on Circle
ユーザー atcoder8atcoder8
提出日時 2023-10-27 22:25:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 256 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 81,916 KB
実行使用メモリ 173,264 KB
最終ジャッジ日時 2024-09-25 14:28:11
合計ジャッジ時間 5,042 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
aa = list(map(int, input().split()))

if m % 2 == 1:
    print(0)
    exit(0)

cnt = 0
s = set()
for a in sorted(aa):
    if a <= m / 2:
        s.add(a)
    elif a - m / 2 in s:
        cnt += 1

print(cnt * (n - 2))
0