結果

問題 No.1965 Heavier
ユーザー titiatitia
提出日時 2022-06-09 02:07:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 249 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 969 ms
コンパイル使用メモリ 11,852 KB
実行使用メモリ 42,440 KB
最終ジャッジ日時 2023-10-21 04:19:35
合計ジャッジ時間 6,960 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,104 KB
testcase_01 AC 26 ms
10,104 KB
testcase_02 AC 26 ms
10,104 KB
testcase_03 AC 25 ms
10,104 KB
testcase_04 AC 27 ms
10,104 KB
testcase_05 AC 27 ms
10,104 KB
testcase_06 AC 235 ms
41,156 KB
testcase_07 AC 233 ms
41,420 KB
testcase_08 AC 219 ms
41,352 KB
testcase_09 AC 223 ms
40,064 KB
testcase_10 AC 226 ms
40,068 KB
testcase_11 AC 216 ms
40,068 KB
testcase_12 AC 26 ms
10,104 KB
testcase_13 AC 25 ms
10,104 KB
testcase_14 AC 24 ms
10,104 KB
testcase_15 AC 226 ms
41,388 KB
testcase_16 AC 225 ms
41,384 KB
testcase_17 AC 166 ms
30,956 KB
testcase_18 AC 229 ms
40,860 KB
testcase_19 AC 228 ms
41,424 KB
testcase_20 AC 233 ms
40,836 KB
testcase_21 AC 203 ms
39,140 KB
testcase_22 AC 202 ms
37,460 KB
testcase_23 AC 151 ms
29,032 KB
testcase_24 AC 201 ms
34,428 KB
testcase_25 AC 212 ms
42,440 KB
testcase_26 AC 209 ms
40,856 KB
testcase_27 AC 246 ms
42,440 KB
testcase_28 AC 249 ms
42,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


now=0
for i in range(N-1):
    if A[i+1]-A[i]>abs(B[i+1]-B[i]):
        now+=1
    else:
        ANS+=now*(now+1)//2
        now=0
ANS+=now*(now+1)//2

print(ANS)
    
0