結果

問題 No.1965 Heavier
ユーザー 👑 KazunKazun
提出日時 2022-06-03 23:53:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,592 KB
実行使用メモリ 130,844 KB
最終ジャッジ日時 2023-10-21 02:30:59
合計ジャッジ時間 4,780 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,356 KB
testcase_01 AC 38 ms
53,356 KB
testcase_02 AC 38 ms
53,356 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 38 ms
53,356 KB
testcase_06 AC 143 ms
130,060 KB
testcase_07 AC 144 ms
130,080 KB
testcase_08 AC 131 ms
109,092 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 135 ms
129,152 KB
testcase_26 AC 133 ms
128,568 KB
testcase_27 AC 140 ms
130,844 KB
testcase_28 AC 138 ms
130,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

X=0
l=r=0
while l<N:
    r=l+1
    while r<N:
        if A[r]-A[l]>abs(B[r]-B[l]):
            r+=1
        else:
            break

    d=r-l
    X+=d*(d-1)//2

    l=r

print(X)
0