Submission #14758941


Source Code Expand

Copy
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M, K = map(int, readline().split())
AB = np.array(read().split(), np.int64)
A = AB[:N]
B = AB[N:]

Acum = np.zeros(N + 1, np.int64)
Acum[1:] = np.cumsum(A)
Bcum = np.zeros(M + 1, np.int64)
Bcum[1:] = np.cumsum(B)

Acum = Acum[Acum <= K]
Bcum = Bcum[Bcum <= K]

x = np.searchsorted(Acum, K - Bcum, side='right') - 1
x += np.arange(len(Bcum))

print(x.max())

Submission Info

Submission Time
Task C - Tsundoku
User maspy
Language Python (3.8.2)
Score 300
Code Size 519 Byte
Status
Exec Time 215 ms
Memory 53636 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01.txt, a02.txt, a03.txt
All 300 / 300 a01.txt, a02.txt, a03.txt, b04.txt, b05.txt, b06.txt, b07.txt, b08.txt, b09.txt, b10.txt, b11.txt, b12.txt, b13.txt, b14.txt, b15.txt, b16.txt, b17.txt, b18.txt, b19.txt, b20.txt
Case Name Status Exec Time Memory
a01.txt 130 ms 26804 KB
a02.txt 128 ms 26512 KB
a03.txt 130 ms 26432 KB
b04.txt 132 ms 26564 KB
b05.txt 202 ms 53096 KB
b06.txt 206 ms 53416 KB
b07.txt 123 ms 26512 KB
b08.txt 212 ms 53416 KB
b09.txt 160 ms 40116 KB
b10.txt 173 ms 39796 KB
b11.txt 171 ms 41160 KB
b12.txt 179 ms 44860 KB
b13.txt 215 ms 53636 KB
b14.txt 209 ms 53524 KB
b15.txt 208 ms 53392 KB
b16.txt 211 ms 53416 KB
b17.txt 210 ms 53448 KB
b18.txt 209 ms 53524 KB
b19.txt 203 ms 53436 KB
b20.txt 179 ms 34064 KB