結果

問題 No.461 三角形はいくつ?
ユーザー titiatitia
提出日時 2023-09-19 03:32:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 844 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 78,752 KB
最終ジャッジ日時 2023-09-19 03:33:00
合計ジャッジ時間 18,014 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,396 KB
testcase_01 AC 93 ms
71,308 KB
testcase_02 AC 102 ms
70,924 KB
testcase_03 AC 93 ms
71,276 KB
testcase_04 AC 165 ms
77,124 KB
testcase_05 AC 364 ms
77,924 KB
testcase_06 AC 250 ms
78,208 KB
testcase_07 AC 277 ms
78,188 KB
testcase_08 AC 242 ms
78,004 KB
testcase_09 AC 109 ms
76,904 KB
testcase_10 AC 162 ms
77,720 KB
testcase_11 AC 300 ms
78,204 KB
testcase_12 AC 204 ms
77,540 KB
testcase_13 AC 387 ms
78,004 KB
testcase_14 AC 368 ms
77,712 KB
testcase_15 AC 379 ms
77,744 KB
testcase_16 AC 124 ms
77,608 KB
testcase_17 AC 123 ms
77,588 KB
testcase_18 AC 538 ms
77,752 KB
testcase_19 AC 558 ms
77,984 KB
testcase_20 WA -
testcase_21 AC 367 ms
77,956 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 797 ms
77,948 KB
testcase_26 AC 825 ms
77,464 KB
testcase_27 AC 116 ms
77,576 KB
testcase_28 AC 123 ms
77,236 KB
testcase_29 AC 910 ms
77,560 KB
testcase_30 AC 903 ms
77,676 KB
testcase_31 AC 828 ms
77,556 KB
testcase_32 AC 768 ms
77,544 KB
testcase_33 AC 114 ms
77,132 KB
testcase_34 AC 114 ms
77,144 KB
testcase_35 AC 131 ms
77,096 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from bisect import bisect_left
from collections import Counter

L=[[0] for i in range(3)]

N=int(input())

for i in range(N):
    p,a,b=map(int,input().split())
    L[p].append(b/(a+b))

L[0].sort()
L[1].sort()
L[2].sort()

ANS=0
C=Counter(L[2])

for x in L[0]:
    for y in L[1]:
        if x+y>1:
            break
        MAX=max(x,y)
        k=bisect_left(L[2],1-MAX)
        ANS+=k
        z=x+y
        if z<1-MAX and 1-z in C:
            ANS-=C[1-z]

print(ANS)


        

0