結果

問題 No.1965 Heavier
ユーザー 👑 KazunKazun
提出日時 2022-06-03 23:58:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 218 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 81,736 KB
実行使用メモリ 130,896 KB
最終ジャッジ日時 2023-10-21 02:31:24
合計ジャッジ時間 5,079 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,372 KB
testcase_01 AC 38 ms
53,372 KB
testcase_02 AC 38 ms
53,372 KB
testcase_03 AC 38 ms
53,372 KB
testcase_04 AC 38 ms
53,372 KB
testcase_05 AC 38 ms
53,372 KB
testcase_06 AC 142 ms
130,116 KB
testcase_07 AC 141 ms
130,140 KB
testcase_08 AC 125 ms
109,152 KB
testcase_09 AC 145 ms
130,580 KB
testcase_10 AC 144 ms
130,580 KB
testcase_11 AC 145 ms
130,584 KB
testcase_12 AC 39 ms
53,372 KB
testcase_13 AC 38 ms
53,372 KB
testcase_14 AC 38 ms
53,372 KB
testcase_15 AC 145 ms
130,008 KB
testcase_16 AC 145 ms
130,012 KB
testcase_17 AC 121 ms
99,628 KB
testcase_18 AC 156 ms
130,076 KB
testcase_19 AC 147 ms
108,960 KB
testcase_20 AC 161 ms
130,176 KB
testcase_21 AC 132 ms
104,960 KB
testcase_22 AC 128 ms
105,732 KB
testcase_23 AC 118 ms
97,904 KB
testcase_24 AC 127 ms
101,416 KB
testcase_25 AC 132 ms
129,208 KB
testcase_26 AC 131 ms
128,624 KB
testcase_27 AC 135 ms
130,896 KB
testcase_28 AC 136 ms
130,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

X=0
i=0
while i<N:
    j=i+1
    while j<N and A[j]-A[j-1]>abs(B[j]-B[j-1]):
        j+=1
    d=j-i
    X+=d*(d-1)//2
    i=j

print(X)
0