結果

問題 No.2517 Right Triangles on Circle
ユーザー lloyzlloyz
提出日時 2023-10-27 21:33:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 275 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 136,780 KB
最終ジャッジ日時 2023-10-27 21:34:00
合計ジャッジ時間 5,075 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,532 KB
testcase_01 AC 36 ms
53,532 KB
testcase_02 AC 37 ms
53,532 KB
testcase_03 AC 36 ms
53,532 KB
testcase_04 AC 36 ms
53,532 KB
testcase_05 AC 38 ms
53,532 KB
testcase_06 AC 39 ms
59,132 KB
testcase_07 AC 36 ms
53,532 KB
testcase_08 AC 39 ms
59,132 KB
testcase_09 AC 35 ms
53,532 KB
testcase_10 AC 40 ms
59,132 KB
testcase_11 AC 36 ms
53,532 KB
testcase_12 AC 36 ms
53,532 KB
testcase_13 AC 268 ms
121,160 KB
testcase_14 AC 108 ms
109,728 KB
testcase_15 AC 275 ms
136,780 KB
testcase_16 AC 200 ms
136,584 KB
testcase_17 AC 206 ms
114,476 KB
testcase_18 AC 201 ms
112,468 KB
testcase_19 AC 186 ms
113,808 KB
testcase_20 AC 187 ms
114,208 KB
testcase_21 AC 269 ms
126,356 KB
testcase_22 AC 53 ms
80,460 KB
testcase_23 AC 197 ms
109,296 KB
testcase_24 AC 127 ms
94,068 KB
testcase_25 AC 53 ms
75,376 KB
testcase_26 AC 234 ms
119,340 KB
testcase_27 AC 52 ms
76,860 KB
testcase_28 AC 80 ms
81,924 KB
testcase_29 AC 118 ms
93,924 KB
testcase_30 AC 98 ms
85,772 KB
testcase_31 AC 202 ms
109,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

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

if m % 2 == 1:
    print(0)
    exit()
A.sort()
A2 = [A[i] + m for i in range(n)]
A = A + A2
ans = 0
for i in range(n):
    a = A[i]
    idx = bisect_left(A, a + m // 2)
    if A[idx] == a + m // 2:
        ans += n - 2
print(ans // 2)
0