結果

問題 No.2517 Right Triangles on Circle
ユーザー MasKoaTSMasKoaTS
提出日時 2023-08-26 17:16:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 317 ms / 2,000 ms
コード長 492 bytes
コンパイル時間 847 ms
コンパイル使用メモリ 86,756 KB
実行使用メモリ 130,532 KB
最終ジャッジ日時 2023-08-26 17:16:36
合計ジャッジ時間 7,788 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,052 KB
testcase_01 AC 73 ms
71,048 KB
testcase_02 AC 73 ms
71,048 KB
testcase_03 AC 74 ms
71,128 KB
testcase_04 AC 73 ms
71,412 KB
testcase_05 AC 74 ms
71,336 KB
testcase_06 AC 78 ms
75,068 KB
testcase_07 AC 74 ms
71,336 KB
testcase_08 AC 73 ms
70,924 KB
testcase_09 AC 75 ms
70,928 KB
testcase_10 AC 82 ms
75,264 KB
testcase_11 AC 75 ms
71,144 KB
testcase_12 AC 74 ms
71,160 KB
testcase_13 AC 317 ms
117,416 KB
testcase_14 AC 192 ms
116,380 KB
testcase_15 AC 285 ms
130,532 KB
testcase_16 AC 258 ms
130,448 KB
testcase_17 AC 242 ms
106,324 KB
testcase_18 AC 258 ms
103,064 KB
testcase_19 AC 209 ms
107,644 KB
testcase_20 AC 208 ms
107,292 KB
testcase_21 AC 315 ms
120,364 KB
testcase_22 AC 103 ms
88,072 KB
testcase_23 AC 224 ms
103,784 KB
testcase_24 AC 162 ms
91,256 KB
testcase_25 AC 100 ms
85,304 KB
testcase_26 AC 252 ms
115,776 KB
testcase_27 AC 103 ms
86,772 KB
testcase_28 AC 119 ms
81,320 KB
testcase_29 AC 150 ms
90,780 KB
testcase_30 AC 131 ms
84,496 KB
testcase_31 AC 230 ms
106,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

n, m = map(int, input().split())
a = sorted(map(int, input().split()))

if(m & 1):
    exit(print(0))

ans = 0
for x in a:
    def bin_search(x):
        ok = 0
        ng = len(a)
        while(abs(ok - ng) > 1):
            mid = (ok + ng) // 2
            if(a[mid] <= x):
                ok = mid
            else:
                ng = mid
        return (a[ok] == x)
    if not(bin_search(x + m // 2)):
        continue
    ans += n - 2
print(ans)
0