結果

問題 No.2517 Right Triangles on Circle
ユーザー KudeKude
提出日時 2023-10-27 21:30:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 81,856 KB
実行使用メモリ 147,692 KB
最終ジャッジ日時 2023-10-27 21:31:04
合計ジャッジ時間 4,304 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,536 KB
testcase_01 AC 38 ms
53,536 KB
testcase_02 AC 44 ms
53,536 KB
testcase_03 AC 38 ms
53,536 KB
testcase_04 AC 37 ms
53,536 KB
testcase_05 AC 44 ms
53,536 KB
testcase_06 AC 38 ms
55,584 KB
testcase_07 AC 37 ms
53,536 KB
testcase_08 AC 37 ms
55,584 KB
testcase_09 AC 40 ms
53,536 KB
testcase_10 AC 38 ms
55,584 KB
testcase_11 AC 36 ms
53,536 KB
testcase_12 AC 37 ms
53,536 KB
testcase_13 AC 164 ms
140,272 KB
testcase_14 AC 150 ms
139,916 KB
testcase_15 AC 171 ms
147,692 KB
testcase_16 AC 172 ms
147,600 KB
testcase_17 AC 154 ms
125,060 KB
testcase_18 AC 156 ms
120,168 KB
testcase_19 AC 133 ms
111,512 KB
testcase_20 AC 135 ms
114,372 KB
testcase_21 AC 169 ms
141,820 KB
testcase_22 AC 67 ms
90,352 KB
testcase_23 AC 138 ms
121,096 KB
testcase_24 AC 83 ms
97,464 KB
testcase_25 AC 63 ms
83,872 KB
testcase_26 AC 151 ms
131,508 KB
testcase_27 AC 64 ms
88,048 KB
testcase_28 AC 68 ms
78,856 KB
testcase_29 AC 79 ms
95,692 KB
testcase_30 AC 68 ms
84,296 KB
testcase_31 AC 139 ms
124,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n, m = map(int, input().split())
a = Counter(map(int, input().split()))
if m % 2:
    print(0)
    exit()
m2 = m // 2
ans = 0
for k, v1 in a.items():
    if k <= m2:
        v2 = a.get(k + m2, 0)
        ans += v1 * v2 * (n - v1 - v2)
print(ans)
0