提出 #57788153
ソースコード 拡げる
#D
import sys
input = sys.stdin.readline
N = int(input())
X = list(map(int, input().split()))
P = list(map(int, input().split()))
S = [0]
for i in P:
S.append(S[-1]+i)
Q = int(input())
for _ in range(Q):
first, last = 0, N-1
L, R = map(int, input().split())
while L > X[first]:
first += 1
while R < X[last]:
last -= 1
if first <= last:
print(S[last+1] - S[first])
else:
print(0)
提出情報
| 提出日時 | |
|---|---|
| 問題 | D - 1D Country |
| ユーザ | kkigon |
| 言語 | Python (CPython 3.11.4) |
| 得点 | 0 |
| コード長 | 460 Byte |
| 結果 | RE |
| 実行時間 | 2212 ms |
| メモリ | 39564 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 350 | ||||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_01.txt | AC | 9 ms | 8516 KiB |
| 00_sample_02.txt | AC | 9 ms | 8564 KiB |
| 01_test_01.txt | TLE | 2212 ms | 39244 KiB |
| 01_test_02.txt | TLE | 2209 ms | 39536 KiB |
| 01_test_03.txt | TLE | 2209 ms | 39548 KiB |
| 01_test_04.txt | TLE | 2209 ms | 39332 KiB |
| 01_test_05.txt | TLE | 2209 ms | 39508 KiB |
| 01_test_06.txt | TLE | 2209 ms | 39424 KiB |
| 01_test_07.txt | TLE | 2209 ms | 39488 KiB |
| 01_test_08.txt | TLE | 2209 ms | 39416 KiB |
| 01_test_09.txt | TLE | 2209 ms | 39564 KiB |
| 01_test_10.txt | TLE | 2209 ms | 39448 KiB |
| 01_test_11.txt | TLE | 2208 ms | 18380 KiB |
| 01_test_12.txt | TLE | 2208 ms | 19340 KiB |
| 01_test_13.txt | AC | 246 ms | 9812 KiB |
| 01_test_14.txt | TLE | 2207 ms | 9616 KiB |
| 01_test_15.txt | TLE | 2208 ms | 12156 KiB |
| 01_test_16.txt | TLE | 2209 ms | 39384 KiB |
| 01_test_17.txt | TLE | 2209 ms | 39492 KiB |
| 01_test_18.txt | TLE | 2209 ms | 39528 KiB |
| 01_test_19.txt | TLE | 2209 ms | 39508 KiB |
| 01_test_20.txt | TLE | 2209 ms | 39448 KiB |
| 01_test_21.txt | TLE | 2209 ms | 39148 KiB |
| 01_test_22.txt | TLE | 2209 ms | 39204 KiB |
| 01_test_23.txt | AC | 320 ms | 39140 KiB |
| 01_test_24.txt | RE | 10 ms | 8540 KiB |