結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,564 KB
testcase_01 AC 75 ms
71,184 KB
testcase_02 AC 75 ms
71,472 KB
testcase_03 AC 76 ms
71,336 KB
testcase_04 AC 113 ms
76,756 KB
testcase_05 AC 351 ms
78,340 KB
testcase_06 AC 228 ms
77,992 KB
testcase_07 AC 258 ms
77,812 KB
testcase_08 AC 217 ms
77,816 KB
testcase_09 AC 90 ms
76,492 KB
testcase_10 AC 145 ms
77,908 KB
testcase_11 AC 280 ms
78,336 KB
testcase_12 AC 193 ms
77,940 KB
testcase_13 AC 359 ms
78,508 KB
testcase_14 AC 339 ms
78,600 KB
testcase_15 AC 348 ms
78,556 KB
testcase_16 AC 106 ms
77,320 KB
testcase_17 AC 103 ms
77,216 KB
testcase_18 AC 495 ms
77,796 KB
testcase_19 AC 536 ms
77,772 KB
testcase_20 WA -
testcase_21 AC 350 ms
78,504 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 789 ms
77,840 KB
testcase_26 AC 798 ms
77,700 KB
testcase_27 AC 98 ms
76,996 KB
testcase_28 AC 100 ms
77,320 KB
testcase_29 AC 831 ms
78,192 KB
testcase_30 AC 907 ms
77,936 KB
testcase_31 AC 807 ms
77,824 KB
testcase_32 AC 748 ms
77,868 KB
testcase_33 AC 97 ms
76,904 KB
testcase_34 AC 97 ms
77,092 KB
testcase_35 AC 90 ms
77,076 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 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_left(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