結果

問題 No.461 三角形はいくつ?
ユーザー titiatitia
提出日時 2023-09-19 03:14:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 603 bytes
コンパイル時間 670 ms
コンパイル使用メモリ 86,664 KB
実行使用メモリ 78,572 KB
最終ジャッジ日時 2023-09-19 03:14:22
合計ジャッジ時間 17,104 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 81 ms
71,000 KB
testcase_02 AC 76 ms
71,284 KB
testcase_03 AC 75 ms
71,208 KB
testcase_04 AC 103 ms
76,344 KB
testcase_05 AC 371 ms
78,088 KB
testcase_06 AC 234 ms
78,028 KB
testcase_07 AC 259 ms
77,840 KB
testcase_08 AC 216 ms
77,444 KB
testcase_09 AC 87 ms
76,160 KB
testcase_10 AC 174 ms
77,568 KB
testcase_11 AC 279 ms
77,756 KB
testcase_12 AC 189 ms
77,888 KB
testcase_13 AC 356 ms
78,228 KB
testcase_14 AC 347 ms
78,356 KB
testcase_15 AC 385 ms
78,228 KB
testcase_16 AC 102 ms
77,016 KB
testcase_17 AC 102 ms
76,876 KB
testcase_18 AC 492 ms
77,660 KB
testcase_19 AC 498 ms
77,676 KB
testcase_20 WA -
testcase_21 AC 350 ms
78,116 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 818 ms
77,564 KB
testcase_26 AC 828 ms
77,552 KB
testcase_27 AC 97 ms
76,928 KB
testcase_28 AC 96 ms
76,784 KB
testcase_29 AC 859 ms
77,728 KB
testcase_30 AC 879 ms
77,476 KB
testcase_31 AC 800 ms
77,760 KB
testcase_32 AC 785 ms
77,864 KB
testcase_33 AC 93 ms
76,660 KB
testcase_34 AC 90 ms
76,864 KB
testcase_35 AC 87 ms
76,668 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

from math import gcd

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

N=int(input())

for i in range(N):
    p,a,b=map(int,input().split())

    GCD=gcd(a,b)
    a//=GCD
    b//=GCD

    L[p].append(b/(a+b))

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

ANS=0

SET=set(L[2])

for x in L[0]:
    for y in L[1]:
        if x+y>1:
            break
        MAX=max(x,y)

        k=bisect(L[2],1-MAX)

        #print(x,y,L[2],k,1-MAX)

        ANS+=k

        z=x+y
        if z<1-MAX and 1-z in SET:
            #print(x,y,z)
            ANS-=1

print(ANS)


        

0