結果

問題 No.947 ABC包囲網
ユーザー mkawa2mkawa2
提出日時 2019-12-16 16:02:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 817 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 78,816 KB
最終ジャッジ日時 2023-09-15 17:51:15
合計ジャッジ時間 34,378 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,844 KB
testcase_01 AC 73 ms
71,840 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 76 ms
71,632 KB
testcase_05 AC 74 ms
71,448 KB
testcase_06 AC 73 ms
72,004 KB
testcase_07 WA -
testcase_08 AC 74 ms
71,524 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 73 ms
71,800 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 86 ms
77,188 KB
testcase_17 AC 90 ms
77,092 KB
testcase_18 AC 92 ms
77,272 KB
testcase_19 AC 90 ms
77,324 KB
testcase_20 AC 89 ms
77,144 KB
testcase_21 AC 89 ms
77,032 KB
testcase_22 AC 89 ms
77,280 KB
testcase_23 AC 89 ms
77,152 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 858 ms
78,596 KB
testcase_29 AC 883 ms
78,368 KB
testcase_30 WA -
testcase_31 AC 1,430 ms
78,500 KB
testcase_32 AC 918 ms
78,440 KB
testcase_33 AC 1,483 ms
78,572 KB
testcase_34 AC 1,405 ms
78,676 KB
testcase_35 AC 1,382 ms
78,472 KB
testcase_36 AC 881 ms
78,652 KB
testcase_37 AC 1,445 ms
78,768 KB
testcase_38 AC 1,429 ms
78,492 KB
testcase_39 AC 1,405 ms
78,712 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 1,416 ms
78,744 KB
testcase_50 WA -
testcase_51 AC 82 ms
76,732 KB
testcase_52 AC 81 ms
76,712 KB
testcase_53 AC 79 ms
76,820 KB
testcase_54 AC 73 ms
71,616 KB
testcase_55 AC 73 ms
71,800 KB
testcase_56 AC 71 ms
72,008 KB
testcase_57 AC 91 ms
77,044 KB
testcase_58 AC 89 ms
77,240 KB
testcase_59 AC 91 ms
77,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import *
from math import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n=int(input())
    xy=[LI() for _ in range(n)]
    rad=[atan2(y,x) for x,y in xy]
    #print(rad)
    rad.sort()
    #rad+=[r+2*pi for r in rad]
    #print(rad)
    ans=0
    for i in range(n-2):
        r0=rad[i]
        if r0>pi:break
        L=bisect_right(rad,r0+pi)
        for j in range(i+1,n-1):
            r1=rad[j]
            if r0+pi<=r1:break
            R=bisect_left(rad,r1+pi)
            #print(i,j,r0,r1,L,R)
            ans+=R-L
    print(ans)

main()
0