結果

問題 No.2517 Right Triangles on Circle
ユーザー prin_kemkemprin_kemkem
提出日時 2023-10-28 19:37:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 785 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,844 KB
実行使用メモリ 134,840 KB
最終ジャッジ日時 2023-10-28 19:37:49
合計ジャッジ時間 7,073 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
80,188 KB
testcase_01 AC 93 ms
80,168 KB
testcase_02 AC 94 ms
80,188 KB
testcase_03 AC 92 ms
80,188 KB
testcase_04 AC 92 ms
80,188 KB
testcase_05 AC 93 ms
80,188 KB
testcase_06 AC 92 ms
80,168 KB
testcase_07 AC 93 ms
80,192 KB
testcase_08 AC 93 ms
80,192 KB
testcase_09 AC 93 ms
80,164 KB
testcase_10 AC 120 ms
80,188 KB
testcase_11 AC 95 ms
80,192 KB
testcase_12 AC 93 ms
80,188 KB
testcase_13 AC 214 ms
133,304 KB
testcase_14 AC 208 ms
133,892 KB
testcase_15 AC 235 ms
122,888 KB
testcase_16 AC 221 ms
122,684 KB
testcase_17 AC 201 ms
123,008 KB
testcase_18 AC 195 ms
118,496 KB
testcase_19 AC 178 ms
113,488 KB
testcase_20 AC 179 ms
113,732 KB
testcase_21 AC 231 ms
134,840 KB
testcase_22 AC 130 ms
94,112 KB
testcase_23 AC 189 ms
118,412 KB
testcase_24 AC 149 ms
96,540 KB
testcase_25 AC 126 ms
91,144 KB
testcase_26 AC 208 ms
124,684 KB
testcase_27 AC 133 ms
92,712 KB
testcase_28 AC 122 ms
86,292 KB
testcase_29 AC 149 ms
96,312 KB
testcase_30 AC 135 ms
89,372 KB
testcase_31 AC 190 ms
119,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict, deque, Counter
import copy
from itertools import combinations, permutations, product, accumulate, groupby, chain
from heapq import heapify, heappop, heappush
import math
import bisect
from pprint import pprint
from random import randint
import sys
# sys.setrecursionlimit(200000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)

#################################################

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

A.sort()
j = 0
while j < N and 2*A[j] <= M:
    j += 1

k = j
ans = 0
for i in range(k):
    while j < N and 2*(A[j]-A[i]) < M:
        j += 1
    if j < N and 2*(A[j]-A[i]) == M:
        ans += N-2
print(ans)
0