結果

問題 No.1965 Heavier
ユーザー rin204rin204
提出日時 2022-06-03 21:30:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 81,840 KB
実行使用メモリ 144,452 KB
最終ジャッジ日時 2023-10-21 01:38:47
合計ジャッジ時間 5,173 ms
ジャッジサーバーID
(参考情報)
judge9 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,376 KB
testcase_01 AC 38 ms
53,376 KB
testcase_02 AC 37 ms
53,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 34 ms
53,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 133 ms
122,696 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 141 ms
142,772 KB
testcase_26 AC 139 ms
142,188 KB
testcase_27 AC 145 ms
144,452 KB
testcase_28 AC 143 ms
144,448 KB
権限があれば一括ダウンロードができます

ソースコード

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