結果

問題 No.1137 Circles
ユーザー 👑 KazunKazun
提出日時 2020-07-26 22:33:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 496 bytes
コンパイル時間 504 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 90,112 KB
最終ジャッジ日時 2023-09-11 05:08:17
合計ジャッジ時間 4,822 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
88,048 KB
testcase_01 AC 166 ms
89,876 KB
testcase_02 AC 113 ms
89,252 KB
testcase_03 AC 139 ms
89,672 KB
testcase_04 AC 151 ms
89,520 KB
testcase_05 AC 122 ms
90,112 KB
testcase_06 AC 156 ms
89,768 KB
testcase_07 AC 132 ms
89,772 KB
testcase_08 AC 156 ms
89,572 KB
testcase_09 AC 125 ms
89,712 KB
testcase_10 AC 137 ms
89,860 KB
testcase_11 AC 138 ms
89,848 KB
testcase_12 AC 169 ms
89,840 KB
testcase_13 AC 130 ms
89,688 KB
testcase_14 AC 167 ms
89,676 KB
testcase_15 AC 132 ms
89,856 KB
testcase_16 AC 142 ms
89,748 KB
testcase_17 AC 116 ms
89,356 KB
testcase_18 AC 159 ms
89,776 KB
testcase_19 AC 125 ms
89,532 KB
testcase_20 AC 125 ms
89,752 KB
testcase_21 AC 89 ms
88,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class Imos_1:
    def __init__(self,N):
        self.len=N
        self.list=[0]*(N+1)

    def Add(self,F,T,C=1):
        self.list[F]+=C
        self.list[T+1]-=C

    def Cumulative_Sum(self):
        Y=[0]*(self.len)
        S=0
        for i in range(self.len):
            S+=self.list[i]
            Y[i]=S

        return Y

N=int(input())
G=10**5
K=Imos_1(8*G+1)
for _ in range(N):
    x,r=map(int,input().split())
    K.Add(2*(x-r)+4*G+1,2*(x+r)+4*G-1,1)
print(max(K.Cumulative_Sum()))
0