結果

問題 No.1965 Heavier
ユーザー rin204
提出日時 2022-06-03 21:30:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 81,776 KB
実行使用メモリ 144,772 KB
最終ジャッジ日時 2024-09-21 02:28:02
合計ジャッジ時間 4,973 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = [a - b for a, b in zip(A, B)]
C.append(-1 << 30)
ans = 0
r = 0
for l in range(n):
    if l == r:
        r += 1
    while C[l] < C[r]:
        r += 1
    ans += r - l - 1
print(ans)
0