buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, K, l, ans[200001];
long a[200001], b[200001];
cin >> N >> M >> K;
a[0] = 0;
b[0] = 0;
for (int i = 1; i < N + 1; i++) {
cin >> l;
a[i] = a[i - 1] + l;
}
for (int i = 1; i < M + 1; i++) {
cin >> l;
b[i] = b[i - 1] + l;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, K, l, ans[200001];
long a[200001], b[200001];
cin >> N >> M >> K;
a[0] = 0;
b[0] = 0;
for (int i = 1; i < N + 1; i++) {
cin >> l;
a[i] = a[i - 1] + l;
}
for (int i = 1; i < M + 1; i++) {
cin >> l;
b[i] = b[i - 1] + l;
... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 47]] | 1 | 235 |
#include <bits/stdc++.h>
#include <iostream>
#define ll long long int
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.... | #include <bits/stdc++.h>
#include <iostream>
#define ll long long int
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22],... | 1 | 254 |
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ri,sum=-1,0
for i in range(M):
if sum+B[i]<=K:
ri=i
sum+=B[i]
else :
break
sum2,ans=0,ri+1
for i in range(N):
sum2+=A[i]
if sum2>K:
break
while ri>=0 and sum2+sum>K:
... | N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ri,sum=-1,0
for i in range(M):
if sum+B[i]<=K:
ri=i
sum+=B[i]
else :
break
sum2,ans=0,ri+1
for i in range(N):
sum2+=A[i]
if sum2>K:
break
while ri>=0 and sum2+sum>K:
... | [["-", 0, 52, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 31, 22]] | 5 | 157 |
#include "bits/stdc++.h"
#include "math.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll, ll> P;
typedef vector<P> vp;
#define rep(i, a, b) for (ll i = (a); i < (b); ++i)
#define dre... | #include "bits/stdc++.h"
#include "math.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll, ll> P;
typedef vector<P> vp;
#define rep(i, a, b) for (ll i = (a); i < (b); ++i)
#define dre... | [["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 350 |
#include <algorithm>
#include <iostream>
#include <vector>
int main() {
int n, m, k;
std::cin >> n >> m >> k;
std::vector<long long> a(n + 2), b(m + 1);
for (int i = 1; i <= n; i++) {
std::cin >> a[i];
}
a[n + 1] = 100000000000;
for (int i = 1; i <= m; i++) {
std::cin >> b[i];
}
for (int i = ... | #include <algorithm>
#include <iostream>
#include <vector>
int main() {
int n, m, k;
std::cin >> n >> m >> k;
std::vector<long long> a(n + 2), b(m + 1);
for (int i = 1; i <= n; i++) {
std::cin >> a[i];
}
a[n + 1] = 100000000000;
for (int i = 1; i <= m; i++) {
std::cin >> b[i];
}
for (int i = ... | [["-", 0, 1, 0, 11, 12, 2, 63, 343, 141, 22], ["+", 0, 1, 0, 11, 12, 2, 63, 343, 141, 22]] | 1 | 247 |
#include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define irep(i, a, b) for (ll i = ll(a); i >= ll(b); i--)
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
... | #include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define irep(i, a, b) for (ll i = ll(a); i >= ll(b); i--)
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
... | [["-", 0, 52, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 12, 22]] | 1 | 406 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(), (x).end()
int main() {
int n, m, k;
cin >> n >> m >> k;
int a[n];
int b[m];
rep(i, n) cin >> a[i];
rep(i, n) cin >> b[i];
ll t = 0;
rep(i, m) t += b[i];... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(), (x).end()
int main() {
int n, m, k;
cin >> n >> m >> k;
int a[n];
int b[m];
rep(i, n) cin >> a[i];
rep(i, m) cin >> b[i];
ll t = 0;
rep(i, m) t += b[i];... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 191 |
/// BISMILLAHIR RAHMANIR RAHEEM
/// ALLAH IS WATCHING ME
/// ALLAH save us from COVID-19.Amin.
/// █▀█─█──█──█▀█─█─█
/// █▄█─█──█──█▄█─█▄█
/// █─█─█▄─█▄─█─█─█─█
/// كُلُّ نَفْسٍ ذَآئِقَةُ الْمَوْت
/// Every soul shall taste death.
/// TODO::
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_contain... | /// BISMILLAHIR RAHMANIR RAHEEM
/// ALLAH IS WATCHING ME
/// ALLAH save us from COVID-19.Amin.
/// █▀█─█──█──█▀█─█─█
/// █▄█─█──█──█▄█─█▄█
/// █─█─█▄─█▄─█─█─█─█
/// كُلُّ نَفْسٍ ذَآئِقَةُ الْمَوْت
/// Every soul shall taste death.
/// TODO::
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_contain... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47]] | 1 | 948 |
n, m, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
acum = [0] * (n + 1)
bcum = [0] * (m + 1)
for i in range(n):
acum[i + 1] = acum[i] + a[i]
for j in range(m):
bcum[j + 1] = bcum[j] + b[j]
max_ans = 0
j = m
for i in range(n):
if acum[i] > k:
... | n, m, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
acum = [0] * (n + 1)
bcum = [0] * (m + 1)
for i in range(n):
acum[i + 1] = acum[i] + a[i]
for j in range(m):
bcum[j + 1] = bcum[j] + b[j]
max_ans = 0
j = m
for i in range(n + 1):
if acum[i] > ... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 177 |
/*
Author: Babin Dutta
*/
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mp make_pair
#define boost \
ios_base::sync_with_stdio(false); ... | /*
Author: Babin Dutta
*/
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mp make_pair
#define boost \
ios_base::sync_with_stdio(false); ... | [["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 639 |
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <complex>
#include <iostream>
#define FIXED_FLOAT(x) std::fixed << std::setprecision(7) << (x)
#define fast \
ios::sync_with_stdio(0); ... |
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <complex>
#include <iostream>
#define FIXED_FLOAT(x) std::fixed << std::setprecision(7) << (x)
#define fast \
ios::sync_with_stdio(0); ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78]] | 1 | 357 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
/*---------*/
/* input */
/*---------*/
long long int N, M, K;
cin >> N >> M >> K;
vector<long long int> A(N + 1);
vector<long long int> B(M + 1);
int i, j;
long long int in;
for (i = 1; i <= N; i++) {
cin >> in;
A[i... | #include <iostream>
#include <vector>
using namespace std;
int main() {
/*---------*/
/* input */
/*---------*/
long long int N, M, K;
cin >> N >> M >> K;
vector<long long int> A(N + 1);
vector<long long int> B(M + 1);
int i, j;
int in;
for (i = 1; i <= N; i++) {
cin >> in;
A[i] = A[i - ... | [["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 212 |
#include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stac... | #include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stac... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 7,749 |
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
import numpy as np
def binarySearch(lis,key):
ng = -1
ok = len(lis)
while abs(ok-ng) > 1:
mid = (ok+ng)//2
if isOk(lis,mid,key): ok = mid
else: ng = mid
return... | def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
import numpy as np
def binarySearch(lis,key):
ng = -1
ok = len(lis)
while abs(ok-ng) > 1:
mid = (ok+ng)//2
if isOk(lis,mid,key): ok = mid
else: ng = mid
return... | [["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47]] | 5 | 224 |
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def binary_search(lis, item):
low = 0
high = len(lis) - 1
inRange = high
if lis[0] > item:
return 0
while low <= high:
mid = (low + high) //2
guess1 = lis... | def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def binary_search(lis, item):
low = 0
high = len(lis) - 1
inRange = high
if lis[0] > item:
return 0
while low <= high:
mid = (low + high) //2
guess1 = lis... | [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]] | 5 | 383 |
/*
karmany evadhikaras te
ma phalesu kadacana
ma karma-phala-hetur bhur
ma re sango'stv akarmani (B.G.-2.47)
Translation:
Lord Krsna to Arjuna.
You have a right to perform your prescribed duty,
but you are not entitled to the fruits of action.
Never consider yourself the cause o... | /*
karmany evadhikaras te
ma phalesu kadacana
ma karma-phala-hetur bhur
ma re sango'stv akarmani (B.G.-2.47)
Translation:
Lord Krsna to Arjuna.
You have a right to perform your prescribed duty,
but you are not entitled to the fruits of action.
Never consider yourself the cause o... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 318 |
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
import numpy as np
import bisect
ra=[0]+list(np.cumsum(a))
rb=[0]+list(np.cumsum(b))
ans=0
for i in range(n+1):
capa = k - ra[i]
if ra[i]>0:
break
j=bisect.bisect_right(rb,capa)
ans=max(ans,... | n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
import numpy as np
import bisect
ra=[0]+list(np.cumsum(a))
rb=[0]+list(np.cumsum(b))
ans=0
for i in range(n+1):
capa = k - ra[i]
if ra[i]>k:
break
j=bisect.bisect_right(rb,capa)
ans=max(ans,... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]] | 5 | 144 |
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5;
int n, m, k;
int a[MAX_N + 5], b[MAX_N + 5];
long long sa[MAX_N + 5], sb[MAX_N + 5];
long long ans = 0;
int main() {
// ios_base::sync_with_stdio(0);
// cin.tie(0); cout.tie(0);
scanf("%d %d %d", &n, &m, &k);
sa[0] = sb[0] = 0;
for (int i ... | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5;
int n, m, k;
int a[MAX_N + 5], b[MAX_N + 5];
long long sa[MAX_N + 5], sb[MAX_N + 5];
long long ans = 0;
int main() {
// ios_base::sync_with_stdio(0);
// cin.tie(0); cout.tie(0);
scanf("%d %d %d", &n, &m, &k);
sa[0] = sb[0] = 0;
for (int i ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 260 |
#include <bits/stdc++.h>
//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (a); i > (n); --i)
#define arep(i, x) for (auto &&i : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define rirep(i, x) for (auto... | #include <bits/stdc++.h>
//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (a); i > (n); --i)
#define arep(i, x) for (auto &&i : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define rirep(i, x) for (auto... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]] | 1 | 629 |
// Bismillahir Rahmanir Rahim. Ya Allah....
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> PII;
const int mod = 1e9 + 7;
const int mx = 1e5 + 5;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, k, c = 0;
cin >> n >> m >> k;
int x, pre[n];
ll sum = 0... | // Bismillahir Rahmanir Rahim. Ya Allah....
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> PII;
const int mod = 1e9 + 7;
const int mx = 1e5 + 5;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, k, x, c = 0;
cin >> n >> m >> k;
ll pre[n];
ll sum = 0;... | [["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 231 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, m, x;
cin >> n >> m >> x;
long long a[n], b[m];
for (long long i = 0; i < n; i++)
cin >> a[i];
for (long long i = 0; i < m; i++)
cin >> b[i];
long long ans = 0, sum = 0, i = 0, j = 0;
while (i < n && sum + a[i] <= x) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, m, x;
cin >> n >> m >> x;
long long a[n], b[m];
for (long long i = 0; i < n; i++)
cin >> a[i];
for (long long i = 0; i < m; i++)
cin >> b[i];
long long ans = 0, sum = 0, i = 0, j = 0;
while (i < n && sum + a[i] <= x) {
... | [["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]] | 1 | 193 |
import numpy as np
import bisect
n, m, k = map(int, input().split())
A = [0] + list(map(int,input().split())) # '0'冊目も入れとく
B = [0] + list(map(int,input().split())) # 同上
a = np.cumsum(A) # 'A'の累積
b = np.cumsum(B) # 'B'同上
ans = 0
for i in range(n+1): # 二分探索_方針: A側で読む本の冊数を固定する!
time = k - a[i] # ↑で固定した時の残り時間
tm... | import numpy as np
import bisect
n, m, k = map(int, input().split())
A = [0] + list(map(int,input().split())) # '0'冊目も入れとく
B = [0] + list(map(int,input().split())) # 同上
a = np.cumsum(A) # 'A'の累積
b = np.cumsum(B) # 'B'同上
ans = 0
for i in range(n+1): # 二分探索_方針: A側で読む本の冊数を固定する!
time = k - a[i] # ↑で固定した時の残り時間
if... | [["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 102], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]] | 5 | 136 |
import sys
import numpy as np
import math
import collections
from collections import deque
from functools import reduce
# input = sys.stdin.readline
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a_t, b_t = [0], [0]
for i in range(n):
a_t.append(a_t[i] ... | import sys
import numpy as np
import math
import collections
from collections import deque
from functools import reduce
# input = sys.stdin.readline
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a_t, b_t = [0], [0]
for i in range(n):
a_t.append(a_t[i] ... | [["-", 0, 57, 15, 23, 0, 666, 0, 206, 51, 22], ["+", 0, 57, 15, 23, 0, 666, 0, 206, 51, 22]] | 5 | 185 |
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#in... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#in... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 431 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int N, M, K;
cin >> N >> M >> K;
ll a = 0;
ll b = 0;
vector<ll> A(N + 1, 0);
for (int i = 1; i < N + 1; i++) {
ll tmp;
cin >> tmp;
a += tmp;
A[i] = a;
}
vector<ll> B(M + 1, 0);
for (int i = 1; i < M + ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int N, M, K;
cin >> N >> M >> K;
ll a = 0;
ll b = 0;
vector<ll> A(N + 1, 0);
for (int i = 1; i < N + 1; i++) {
ll tmp;
cin >> tmp;
a += tmp;
A[i] = a;
}
vector<ll> B(M + 1, 0);
for (int i = 1; i < M + ... | [["-", 15, 339, 51, 16, 31, 16, 31, 16, 17, 72], ["-", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13]] | 1 | 313 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
long long k;
cin >> n >> m >> k;
long long a[n + 1];
long long b[m + 1];
int counta = 0;
int countb = 0;
long long timea = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i <= n; i++) {
if (timea <= k ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
long long k;
cin >> n >> m >> k;
long long a[n + 1];
long long b[m + 1];
int counta = 0;
int countb = 0;
long long timea = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i <= n; i++) {
if (timea <= k ... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 52, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]] | 1 | 308 |
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<long long>>;
int main(void) {
long long N, M, K;
cin >> N >> M >> K;
vector<long long> A;
vector<long long> B;
vector<long long> Sa(N + 1);
vector<long long> Sb(M + 1);
int a, b;
int amax, bmax;
int result = 0;
for (int i ... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<long long>>;
int main(void) {
long long N, M, K;
cin >> N >> M >> K;
vector<long long> A;
vector<long long> B;
vector<long long> Sa(N + 1);
vector<long long> Sb(M + 1);
int a, b;
int amax, bmax;
int result = 0;
for (int i ... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]] | 1 | 311 |
# -*- coding: utf-8 -*-
# 標準入力を取得
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
# 求解処理
a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for j in range(M):
b.append(b[i] + B[i])
ans, j = 0, M
for i in range(N + 1):
if a[i] > K:
... | # -*- coding: utf-8 -*-
# 標準入力を取得
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
# 求解処理
a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for j in range(M):
b.append(b[j] + B[j])
ans, j = 0, M
for i in range(N + 1):
if a[i] > K:
... | [["-", 0, 652, 3, 4, 0, 657, 31, 206, 206, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 206, 206, 22], ["-", 0, 652, 3, 4, 0, 657, 12, 206, 206, 22], ["+", 0, 652, 3, 4, 0, 657, 12, 206, 206, 22]] | 5 | 170 |
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy imp... | from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy imp... | [["-", 36, 36, 0, 656, 0, 7, 75, 76, 0, 95], ["-", 36, 36, 0, 656, 0, 7, 75, 76, 0, 102]] | 5 | 209 |
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = 200005;
int ... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = 200005;
int ... | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["+", 15, 339, 51, 16, 12, 74, 39, 77, 39, 78], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 263 |
from sys import stdin
import bisect
def main():
input = stdin.readline
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [0] * (n + 1)
for i in range(n):
c[i + 1] = c[i] + a[i]
d = [0] * (m + 1)
for i in range(m):
... | from sys import stdin
import bisect
def main():
input = stdin.readline
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [0] * (n + 1)
for i in range(n):
c[i + 1] = c[i] + a[i]
d = [0] * (m + 1)
for i in range(m):
... | [["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["-", 8, 196, 0, 57, 15, 679, 31, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 47], ["-", 8, 196, 0, 57, 15, 679, 31, 666, 667, 18], ["+", 8, 196, 0, 57, 15, 679, 31, 666, 667, 19]] | 5 | 218 |
def resolve():
lines = sys.stdin.readlines()
n, m, k = tuple(map(int, lines[0].strip().split(' ')))
A = list(map(int, lines[1].strip().split(' ')))
B = list(map(int, lines[2].strip().split(' ')))
a = [0]
b = [0]
for i in range(n):
a.append(a[i] + A[i])
for i in range(m):
... | import sys
def resolve():
lines = sys.stdin.readlines()
n, m, k = tuple(map(int, lines[0].strip().split(' ')))
A = list(map(int, lines[1].strip().split(' ')))
B = list(map(int, lines[2].strip().split(' ')))
a = [0]
b = [0]
for i in range(n):
a.append(a[i] + A[i])
for i in ran... | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 205 |
# C - Tsundoku
from bisect import bisect
from itertools import accumulate
def main():
N, M, K, *AB = map(int, open(0).read().split())
cum_A, cum_B = tuple(accumulate(AB[:N])), tuple(accumulate(AB[N:]))
candidates = []
for i, a_time in enumerate(cum_A, 1):
if a_time > K:
candidates.... | # C - Tsundoku
from bisect import bisect
from itertools import accumulate
def main():
N, M, K, *AB = map(int, open(0).read().split())
cum_A, cum_B = tuple(accumulate([0] + AB[:N])), tuple(accumulate(AB[N:]))
candidates = []
for i, a_time in enumerate(cum_A):
if a_time > K:
candidat... | [["+", 0, 652, 3, 4, 0, 657, 31, 634, 0, 70], ["+", 0, 652, 3, 4, 0, 657, 31, 634, 0, 612], ["+", 0, 652, 3, 4, 0, 657, 31, 634, 0, 73], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 130 |
// you**can**do**anything
#include <bits/stdc++.h>
#define ll long long
#define read(i) scanf("%lli", &i)
const ll maxn = 1e6;
using namespace std;
int main() {
ll a, b, k;
cin >> a >> b >> k;
vector<ll> A(a + 1, 0), B(b + 1, 0);
for (ll i = 1; i <= a; i++) {
cin >> A[i];
A[i] += A[i - 1];
}
for ... | // you**can**do**anything
#include <bits/stdc++.h>
#define ll long long
#define read(i) scanf("%lli", &i)
const ll maxn = 1e6;
using namespace std;
int main() {
ll a, b, k;
cin >> a >> b >> k;
vector<ll> A(a + 1, 0), B(b + 1, 0);
for (ll i = 1; i <= a; i++) {
cin >> A[i];
A[i] += A[i - 1];
}
for ... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 241 |
from itertools import accumulate
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A = [0] + A
A = list(accumulate(A))
B = [0] + B
B = list(accumulate(B))
ans = 0
b_cnt = m
for a_cnt in range(n+1):
if a_cnt > k: continue
while A[a_cnt]+B[b_cnt] > k:... | from itertools import accumulate
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A = [0] + A
A = list(accumulate(A))
B = [0] + B
B = list(accumulate(B))
ans = 0
b_cnt = m
for a_cnt in range(n+1):
if A[a_cnt] > k: continue
while A[a_cnt]+B[b_cnt] >... | [["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 0, 70], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 0, 73]] | 5 | 140 |
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
#define SIZE 200005
ll N, M, K;
ll A[SIZE], B[SIZE];
int main() {
scanf("%lld %lld %lld", &N, &... | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
#define SIZE 200005
ll N, M, K;
ll A[SIZE], B[SIZE];
int main() {
scanf("%lld %lld %lld", &N, &... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 315 |
import bisect
from itertools import*
n,m,k,*x=[int(v)for l in open(0) for v in l.split()];a=accumulate([0]+x[:n]);b=[*accumulate(x[n:])];print(max(i+bisect.bisect(b,k-v)for i,v in enumerate(a)if k>v)) | import bisect
from itertools import*
n,m,k,*x=[int(v)for l in open(0) for v in l.split()];a=accumulate([0]+x[:n]);b=[*accumulate(x[n:])];print(max(i+bisect.bisect(b,k-v)for i,v in enumerate(a)if v<=k)) | [["-", 0, 652, 3, 668, 0, 678, 0, 666, 0, 22], ["-", 0, 652, 3, 668, 0, 678, 0, 666, 667, 47], ["+", 0, 652, 3, 668, 0, 678, 0, 666, 667, 19], ["+", 0, 652, 3, 668, 0, 678, 0, 666, 0, 22]] | 5 | 97 |
#include <bits/stdc++.h>
#include <iomanip>
#include <numeric>
#define ll long long
#define intm INT_MAX
#define llm LLONG_MAX
using namespace std;
typedef pair<int, int> P;
const int MOD = 998244353;
const ll mod = 1e9 + 7;
const int mxN = 2e5 + 9;
ll a[mxN];
ll b[mxN];
int main() {
ios_base::sync_with_stdio(fals... | #include <bits/stdc++.h>
#include <iomanip>
#include <numeric>
#define ll long long
#define intm INT_MAX
#define llm LLONG_MAX
using namespace std;
typedef pair<int, int> P;
const int MOD = 998244353;
const ll mod = 1e9 + 7;
const int mxN = 2e5 + 9;
ll a[mxN];
ll b[mxN];
int main() {
ios_base::sync_with_stdio(fals... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 333 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int sz = 1e5 + 1;
ll mod = 1e9 + 7;
bool cmp(pair<ll, ll> a, pair<ll, ll> b) {
if (a.first == b.first) {
return a.second < b.second;
} else {
return a.first > b.first;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int sz = 1e5 + 1;
ll mod = 1e9 + 7;
bool cmp(pair<ll, ll> a, pair<ll, ll> b) {
if (a.first == b.first) {
return a.second < b.second;
} else {
return a.first > b.first;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie... | [["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 342 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef int64_t i6;
typedef std::vector<std::vector<int64_t>> Graph;
#define rep(i, n) for (int64_t i = 0; i < n; ++i)
#define rep2(i, n) for (int64_t i = 1; i <= n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define Sort(x) sort(ALL(x))
#define Sort... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef int64_t i6;
typedef std::vector<std::vector<int64_t>> Graph;
#define rep(i, n) for (int64_t i = 0; i < n; ++i)
#define rep2(i, n) for (int64_t i = 1; i <= n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define Sort(x) sort(ALL(x))
#define Sort... | [["-", 8, 9, 0, 9, 0, 7, 15, 16, 17, 47], ["+", 8, 9, 0, 9, 0, 7, 15, 16, 17, 20]] | 1 | 479 |
//-----Sakib-----//
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// - - - - - - Data Types - - - - - - //
#define SF1(A) scanf("%d", &A... | //-----Sakib-----//
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// - - - - - - Data Types - - - - - - //
#define SF1(A) scanf("%d", &A... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]] | 1 | 1,207 |
N, M, K = [int(x) for x in input().split()]
stackA = [int(x) for x in input().split()]
stackB = [int(x) for x in input().split()]
indexB = 0
indexA = 0
books = 0
mostBooks = 0
time = 0
for x in stackB:
if time + x > K:
indexB -= 1
break
else:
time += x
indexB += 1
b... | N, M, K = [int(x) for x in input().split()]
stackA = [int(x) for x in input().split()]
stackB = [int(x) for x in input().split()]
indexB = 0
indexA = 0
books = 0
mostBooks = 0
time = 0
for x in stackB:
if time + x > K:
break
else:
time += x
indexB += 1
books += 1
indexB -=... | [["-", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612]] | 5 | 160 |
from bisect import *
n, m, k = map(int, input().split())
A = [0]
for x in map(int, input().split()):
if A[-1]+x <= k: A.append(A[-1]+x)
B = [0]
for x in map(int, input().split()):
if B[-1]+x <= k: B.append(B[-1]+x)
ans = 0
for i in range(len(A)):
j = bisect_right(B, k-A[i]) - 1
# if k >= A[i] + B[j]:
... | from bisect import *
n, m, k = map(int, input().split())
A = [0]
for x in map(int, input().split()):
if A[-1]+x > k: break
A.append(A[-1]+x)
B = [0]
for x in map(int, input().split()):
if B[-1]+x > k: break
B.append(B[-1]+x)
ans = 0
for i in range(len(A)):
j = bisect_right(B, k-A[i]) - 1
ans = ... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]] | 5 | 158 |
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
#define ... | #ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
#define ... | [["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22]] | 1 | 626 |
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a=[0]
b=[0]
for i in range(N):
a.append(a[i]+A[i])
for i in range(M):
b.append(b[i]+B[i])
j=M
ans=0
for i in range(N):#aは小さい方から
if a[i]>K: #a[0]=0なのでいきなりbreakすることはない
break
while b[j]>K-a[i] : #b... | N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a=[0]
b=[0]
for i in range(N):
a.append(a[i]+A[i])
for i in range(M):
b.append(b[i]+B[i])
j=M
ans=0
for i in range(N+1):#aは小さい方から
if a[i]>K: #a[0]=0なのでいきなりbreakすることはない
break
while b[j]>K-a[i] : ... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 163 |
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
s = 0
b_count = 0
for i in range(m):
if s + b[i] <= k:
s += b[i]
ans += 1
b_count = i
else:
break
a_count = 0
while True:
if a_count < n and s+a[a_count] <= k:
... | n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
s = 0
b_count = 0
for i in range(m):
if s + b[i] <= k:
s += b[i]
ans += 1
b_count = i+1
else:
break
a_count = 0
while True:
if a_count < n and s+a[a_count] <= k... | [["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 199 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n, m, k;
int main() {
cin >> n >> m >> k;
ll sm = 0, v = 0;
int ans = 0;
ll a[n + 5], b[m + 5];
for (int i = 0; i < n; i++) {
cin >> a[i];
sm += a[i];
}
for (int i = 0; i < m; i++) {
cin >> b[i];
}
ll bs = 0;
int bp ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n, m, k;
int main() {
cin >> n >> m >> k;
ll sm = 0, v = 0;
int ans = 0;
ll a[n + 5], b[m + 5];
for (int i = 0; i < n; i++) {
cin >> a[i];
sm += a[i];
}
for (int i = 0; i < m; i++) {
cin >> b[i];
}
ll bs = 0;
int bp ... | [["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 205 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
ll k;
cin >> k;
vector<ll> a(n + 1), b(n + 1);
for (int i = 0; i < n; i++) {
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
ll k;
cin >> k;
vector<ll> a(n + 1), b(m + 1);
for (int i = 0; i < n; i++) {
... | [["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22]] | 1 | 261 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int N, M;
long long K;
cin >> N >> M >> K;
vector<long long> A(N + 1, 0), B(M + 1, 0);
for (int i = 1; i <= N; i++)
cin >> A[i];
for (int i = 1; i <= M; i++)
cin >> B[i];
for (int i = 0; i <= N; i++)
A[i] += A[i - 1];
for (in... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int N, M;
long long K;
cin >> N >> M >> K;
vector<long long> A(N + 1, 0), B(M + 1, 0);
for (int i = 1; i <= N; i++)
cin >> A[i];
for (int i = 1; i <= M; i++)
cin >> B[i];
for (int i = 1; i <= N; i++)
A[i] += A[i - 1];
for (in... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 218 |
import sys
import math
import heapq
from collections import defaultdict, deque
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
def r():
return int(input())
def rm():
return map(int,input().split())
def rl():
return list(map(int,input().split()))
'''C Tsundoku'''
n,m,k=rm()
a=rl()
b=rl()
c=[0]*(n+1)... | import sys
import math
import heapq
from collections import defaultdict, deque
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
def r():
return int(input())
def rm():
return map(int,input().split())
def rl():
return list(map(int,input().split()))
'''C Tsundoku'''
n,m,k=rm()
a=rl()
b=rl()
c=[0]*(n+1)... | [["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22]] | 5 | 226 |
from collections import deque
def solve():
N, M, K = map(int, input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for i in range(M):
b.append(b[i] + B[i])
ans = 0
j = M
for... | from collections import deque
def solve():
N, M, K = map(int, input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for i in range(M):
b.append(b[i] + B[i])
ans = 0
j = M
... | [["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["-", 0, 7, 8, 196, 0, 52, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 52, 15, 666, 667, 47]] | 5 | 175 |
import sys
import math
from collections import deque
n,m,k=map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a=[0]
b=[0]
for i in range(n):
a.append(A[i]+a[i])
for i in range(m):
b.append(B[i]+b[i])
ans,j=0,m
for i in range(n):
if a[i] > k :
break
... | import sys
import math
from collections import deque
n,m,k=map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a=[0]
b=[0]
for i in range(n):
a.append(A[i]+a[i])
for i in range(m):
b.append(B[i]+b[i])
ans,j=0,m
for i in range(n+1):
if a[i] > k :
break... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 168 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n, m, k;
cin >> n >> m >> k;
vector<ll> a(n + 1), b(m + 1);
vector<ll> A(n + 1), B(m + 1);
for (int i = 1; i <= n; i++) {
cin >> A[i];
a[i] = a[i - 1] + A[i];
}
for (int i = 1; i <= m; i++) {
cin >> B[i];
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n, m, k;
cin >> n >> m >> k;
vector<ll> a(n + 1), b(m + 1);
vector<ll> A(n + 1), B(m + 1);
for (int i = 1; i <= n; i++) {
cin >> A[i];
a[i] = a[i - 1] + A[i];
}
for (int i = 1; i <= m; i++) {
cin >> B[i];
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 220 |
#import
#=input()
#=int(input())
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]
la = [0]
lb = [0]
for i in range(n):
la += [a[i]+la[i]]
for i in range(m):
lb += [b[i]+lb[i]]
j = m
ans = 0
for i in range(n):
... | #import
#=input()
#=int(input())
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]
la = [0]
lb = [0]
for i in range(n):
la += [a[i]+la[i]]
for i in range(m):
lb += [b[i]+lb[i]]
j = m
ans = 0
for i in range(n+1):... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 161 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
long k = sc.nextLong();
long[] in = new long[n + 1];
long[] in2 = new long[m + 1];
for (int i = 1; i < n + 1; i++) {
in[i... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
long k = sc.nextLong();
long[] in = new long[n + 1];
long[] in2 = new long[m + 1];
for (int i = 1; i < n + 1; i++) {
in[i... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20], ["-", 0, 11, 12, 492, 3, 4, 0, 16, 12, 22], ["+", 0, 11, 12, 492, 3, 4, 0, 16, 12, 22]] | 3 | 304 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 2e5;
int n, m, k;
int a[maxn + 1], b[maxn + 1];
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin >> n >> m >> k;
for (int i = 0; i < n; i++) {
cin >> a[i + 1];
a[i + 1]... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 2e5;
int n, m, k;
int a[maxn + 1], b[maxn + 1];
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin >> n >> m >> k;
for (int i = 0; i < n; i++) {
cin >> a[i + 1];
a[i + 1]... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 216 |
from itertools import accumulate
import bisect
n, m, k = map(int,input().split())
a_lst = [0] + list(accumulate(list(map(int,input().split()))))
b_lst = list(accumulate(list(map(int,input().split()))))
ans = 0
for i in range(n+1):
cnt = i
num = k - a_lst[i]
if num < 0:
continue
b_yomeru = bisec... | from itertools import accumulate
import bisect
n, m, k = map(int,input().split())
a_lst = [0] + list(accumulate(list(map(int,input().split()))))
b_lst = list(accumulate(list(map(int,input().split()))))
ans = 0
for i in range(n+1):
cnt = i
num = k - a_lst[i]
if num < 0:
continue
b_yomeru = bisec... | [["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]] | 5 | 129 |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll a[200005];
ll b[200005];
int main() {
ll n, m, k;
cin >> n >> m >> k;
ll t, ans = 0;
ll tmp = 0;
for (ll i = 1; i <= n; i++) {
cin >> t;
a[i] = a[i - 1] + t;
if (a[i] <= k)
tmp = i;
}
for (ll i = 1; i <= m; i++) {
... | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll a[200005];
ll b[200005];
int main() {
ll n, m, k;
cin >> n >> m >> k;
ll t, ans = 0;
ll tmp = 0;
for (ll i = 1; i <= n; i++) {
cin >> t;
a[i] = a[i - 1] + t;
if (a[i] <= k)
tmp = i;
}
for (ll i = 1; i <= m; i++) {
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 194 |
#include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
int main() {
long n, m, k;
cin >> n >> m >> k;
long a[n], b[m];
rep(i, n) cin >> a[i];
rep(i, m) cin >> b[i];
long a_now, b_now;
// cout << sizeof(a) / sizeof(*a) << endl;
a_now = b_now... | #include <bits/stdc++.h>
#include <vector>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
int main() {
long n, m, k;
cin >> n >> m >> k;
long a[n], b[m];
rep(i, n) cin >> a[i];
rep(i, m) cin >> b[i];
long a_now, b_now;
// cout << sizeof(a) / sizeof(*a) << endl;
a_now = b_now... | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47]] | 1 | 277 |
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
long long N, M, K, A, B = 0, i = 0, j = 0, suma = 0, max = 0, read = 0,
readmax = 0;
long long deskA[200001], deskB[200001];
scanf("%lld %lld %lld", &N, &M, &K);
for (i = 0; i < N; i++) {
... | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
long long N, M, K, A, B = 0, i = 0, j = 0, suma = 0, max = 0, read = 0,
readmax = 0;
long long deskA[200001], deskB[200001];
scanf("%lld %lld %lld", &N, &M, &K);
for (i = 0; i < N; i++) {
... | [["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 57, 75, 76, 0, 9, 0, 93, 0, 94], ["+", 0, 57, 75, 76, 0, 9, 0, 93, 0, 35], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 0 | 326 |
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)+sum(b)<k:
ans=m+n
else:
numa=[0]
numb=[0]
for i in range(n):
numa.append(numa[-1]+a[i])
for j in range(m):
numb.append(numb[-1]+b[i])
ans=0
for i in range(n+1):
... | n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)+sum(b)<k:
ans=m+n
else:
numa=[0]
numb=[0]
for i in range(n):
numa.append(numa[-1]+a[i])
for j in range(m):
numb.append(numb[-1]+b[j])
ans=0
for i in range(n+1):
... | [["-", 0, 652, 3, 4, 0, 657, 12, 206, 206, 22], ["+", 0, 652, 3, 4, 0, 657, 12, 206, 206, 22]] | 5 | 180 |
#include <bits/stdc++.h>
#define fast \
{ \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | #include <bits/stdc++.h>
#define fast \
{ \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | [["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 52, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 17, 20]] | 1 | 232 |
import bisect
n,m,k=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
acum1=[0]
for i in range(n):
acum1.append(acum1[-1]+arr1[i])
acum2=[0]
for i in range(m):
acum2.append(acum2[-1]+arr2[i])
ans=0
for i in range(1,n+1):
if acum1[i]>k:
break
ans=max(ans,i+bise... | import bisect
n,m,k=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
acum1=[0]
for i in range(n):
acum1.append(acum1[-1]+arr1[i])
acum2=[0]
for i in range(m):
acum2.append(acum2[-1]+arr2[i])
ans=0
for i in range(n+1):
if acum1[i]>k:
break
ans=max(ans,i+bisect... | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]] | 5 | 162 |
#!usr/bin/env pypy3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x ... | #!usr/bin/env pypy3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x ... | [["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]] | 5 | 321 |
N, M, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(j) for j in input().split()]
a, b = [0], [0]
for i in range(N):
a.append[a[i] + A[i]]
for i in range(M):
b.append[b[i] + B[i]]
ans, j = 0, M
for i in range(N+1):
if a[i] > K:
break
while b[j] > K - a[i]:
... | N, M, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(j) for j in input().split()]
a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for i in range(M):
b.append(b[i] + B[i])
ans, j = 0, M
for i in range(N+1):
if a[i] > K:
break
while b[j] > K - a[i]:
... | [["-", 0, 7, 8, 196, 0, 1, 0, 206, 0, 70], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 206, 206, 657, 12, 206, 0, 73], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 0, 7, 8, 196, 0, 1, 0, 206, 0, 73]] | 5 | 165 |
from bisect import bisect_right
from itertools import accumulate
N, M, K = [int(x) for x in input().split()]
a_book = [0] + list(accumulate([int(x) for x in input().split()]))
b_book = [0] + list(accumulate([int(x) for x in input().split()]))
check = {}
max_books = 0
for i, a in enumerate(a_book):
b_pos = bise... | from bisect import bisect_right
from itertools import accumulate
N, M, K = [int(x) for x in input().split()]
a_book = [0] + list(accumulate([int(x) for x in input().split()]))
b_book = [0] + list(accumulate([int(x) for x in input().split()]))
check = {}
max_books = 0
for i, a in enumerate(a_book):
if a > K:
... | [["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 121], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 656, 0, 7, 8, 196, 0, 57, 0, 102], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]] | 5 | 133 |
N, M, K=map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
A=[0]+A
B=[0]+B
import numpy as np
a=np.cumsum(A)
b=np.cumsum(B)
ans=0
j=M
for i in range(N):
if a[i]>K:
break
while b[j]>K-a[i]:
j-=1
ans=max(ans, i+j)
print(ans) | N, M, K=map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
A=[0]+A
B=[0]+B
import numpy as np
a=np.cumsum(A)
b=np.cumsum(B)
ans=0
j=M
for i in range(N+1):
if a[i]>K:
break
while b[j]>K-a[i]:
j-=1
ans=max(ans, i+j)
print(ans) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 139 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
#ifdef LOCAL_EXEC
#else
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#endif // LOCAL_EXEC
long long int n, i, j, k, m, ans = 0, a, b, mid;
cin >> n >> m >> k;
long long int A[n + 1], B[m + 1];
A[0] = 0;
B[0] = 0;
for (i... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
#ifdef LOCAL_EXEC
#else
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#endif // LOCAL_EXEC
long long int n, i, j, k, m, ans = 0, a, b, mid;
cin >> n >> m >> k;
long long int A[n + 1], B[m + 1];
A[0] = 0;
B[0] = 0;
for (i... | [["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22]] | 1 | 408 |
#include <bits/stdc++.h>
using namespace std;
void solve(std::istream &ist, std::ostream &ost) {
/* ------- 宣言と入力 ------- */
long long N, M, K;
ist >> N >> M >> K;
vector<long long> A;
vector<long long> B;
for (int i = 0; i < N; i++) {
int input;
ist >> input;
A.emplace_back(input);
}
f... | #include <bits/stdc++.h>
using namespace std;
void solve(std::istream &ist, std::ostream &ost) {
/* ------- 宣言と入力 ------- */
long long N, M, K;
ist >> N >> M >> K;
vector<long long> A;
vector<long long> B;
for (int i = 0; i < N; i++) {
int input;
ist >> input;
A.emplace_back(input);
}
f... | [["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 395 |
import itertools
import sys
input = sys.stdin.readline
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
a_cum = [0] + list(itertools.accumulate(a))
b_cum = [0] + list(itertools.accumulate(b))
y = m
for x in range(len(a_cum)):
if a_cum[x] > k:
... | import itertools
import sys
input = sys.stdin.readline
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
a_cum = [0] + list(itertools.accumulate(a))
b_cum = [0] + list(itertools.accumulate(b))
y = m # len(b_cum) - 1
for x in range(len(a_cum)):
i... | [["-", 8, 196, 0, 52, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 52, 15, 666, 0, 206, 51, 22], ["-", 0, 52, 15, 666, 0, 657, 12, 206, 51, 22], ["+", 0, 52, 15, 666, 0, 657, 12, 206, 51, 22]] | 5 | 149 |
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
sum_A = [0]
for i,a in enumerate(A, 1):
tmp = sum_A[i-1] + a
if tmp <= K:
sum_A.append(tmp)
mark_A = i
else:
break
sum_B = [0]
for i,b in enumerate(B, 1):
tmp = sum_B... | N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
sum_A = [0]
for i,a in enumerate(A, 1):
tmp = sum_A[i-1] + a
if tmp <= K:
sum_A.append(tmp)
mark_A = i
else:
break
sum_B = [0]
for i,b in enumerate(B, 1):
tmp = sum_B... | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 652, 63, 22], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 657, 31, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 61... | 5 | 183 |
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
from itertools import accumulate
A = [0] + list(accumulate(a))
B = [0] + list(accumulate(b))
ans = 0
j = m
for i in range(n + 1):
if A[i] > k:
break
while B[j] > k - a[i]:
j -= 1
ans... | n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
from itertools import accumulate
A = [0] + list(accumulate(a))
B = [0] + list(accumulate(b))
ans = 0
j = m
for i in range(n + 1):
if A[i] > k:
break
while B[j] > k - A[i]:
j -= 1
ans... | [["-", 0, 52, 15, 666, 0, 657, 12, 206, 51, 22], ["+", 0, 52, 15, 666, 0, 657, 12, 206, 51, 22]] | 5 | 137 |
#include <bits/stdc++.h>
#define mod 1000000007
#define pie M_PI
#define maxx 2147483647
#define FOR(i, a, b) for (int i = a; i < b; ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
const long long int maxs = 100000000;
int main() {
// ios_base::sync_with_stdio(0);
// cin.tie(NULL);
//... | #include <bits/stdc++.h>
#define mod 1000000007
#define pie M_PI
#define maxx 2147483647
#define FOR(i, a, b) for (int i = a; i < b; ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
const long long int maxs = 100000000;
int main() {
// ios_base::sync_with_stdio(0);
// cin.tie(NULL);
//... | [["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]] | 1 | 312 |
n, m, k = list(map(int, input().split()))
ns = list(map(int, input().split()))
ms = list(map(int, input().split()))
nss = [0]
for i, v in enumerate(ns):
nss.append(nss[i] + ns[i])
mss = [0]
for i, v in enumerate(ms):
mss.append(mss[i] + ms[i])
mx = 0
j = m
for i in range(n + 1):
if nss[i] > k:
br... | n, m, k = list(map(int, input().split()))
ns = list(map(int, input().split()))
ms = list(map(int, input().split()))
nss = [0]
for i, v in enumerate(ns):
nss.append(nss[i] + ns[i])
mss = [0]
for i, v in enumerate(ms):
mss.append(mss[i] + ms[i])
mx = 0
j = m
for i in range(n + 1):
if nss[i] > k:
br... | [["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 174 |
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#i... | // C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#i... | [["-", 64, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 64, 9, 0, 57, 64, 9, 0, 116, 0, 117]] | 1 | 767 |
n, m, k = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)
b = gets.chomp.split.map(&:to_i)
a.unshift(0)
b.unshift(0)
1.step(n) do |i|
a[i] += a[i - 1]
end
1.step(m) do |j|
b[j] += b[j - 1]
end
i = 0
j = m
res = 0
while j > 0 && i <= n
break if a[i] > k
j -= 1 while b[j] > k - a[i] && j > 0
r... | n, m, k = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)
b = gets.chomp.split.map(&:to_i)
a.unshift(0)
b.unshift(0)
1.step(n) do |i|
a[i] += a[i - 1]
end
1.step(m) do |j|
b[j] += b[j - 1]
end
i = 0
j = m
res = 0
while j >= 0 && i <= n
break if a[i] > k
j -= 1 while b[j] > k - a[i] && j > 0
... | [["-", 0, 493, 0, 89, 15, 738, 31, 738, 17, 47], ["+", 0, 493, 0, 89, 15, 738, 31, 738, 17, 20]] | 4 | 160 |
(n,m,k),*A,=[list(map(int,i.split())) for i in open(0)]
a=A[0]
b=A[1]
aa=[0]
bb=[0]
for i in range(n):
aa.append(aa[i]+a[i])
for i in range(m):
bb.append(bb[i]+b[i])
ans=0
for i in range(1,n+1):
if aa[i]>k:
break
while bb[m]>k-aa[i]:
m-=1
ans=max(ans,m+i)
print(ans) | (n,m,k),*A,=[list(map(int,i.split())) for i in open(0)]
a=A[0]
b=A[1]
aa=[0]
bb=[0]
for i in range(n):
aa.append(aa[i]+a[i])
for i in range(m):
bb.append(bb[i]+b[i])
ans=0
for i in range(n+1):
if aa[i]>k:
break
while bb[m]>k-aa[i]:
m-=1
ans=max(ans,m+i)
print(ans) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]] | 5 | 154 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef pair<string, string> Pstring;
typedef pair<double, double> Pdouble;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REP1(i, n) for (ll i = 1; i <= n; i++)
#define Precision13 cout <<... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef pair<string, string> Pstring;
typedef pair<double, double> Pdouble;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REP1(i, n) for (ll i = 1; i <= n; i++)
#define Precision13 cout <<... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 342 |
import bisect
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A2 = [0] * (N + 1)
for i in range(1, N + 1):
A2[i] = A2[i - 1] + A[i - 1]
B2 = [0] * (M + 1)
for i in range(1, M + 1):
B2[i] = B2[i - 1] + B[i - 1]
#print(A2, B2)
#print(bisect.bisect_left(B2... | import bisect
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A2 = [0] * (N + 1)
for i in range(1, N + 1):
A2[i] = A2[i - 1] + A[i - 1]
B2 = [0] * (M + 1)
for i in range(1, M + 1):
B2[i] = B2[i - 1] + B[i - 1]
#print(A2, B2)
#print(bisect.bisect_left(B2... | [["-", 0, 662, 12, 657, 31, 652, 63, 319, 319, 22], ["+", 0, 662, 12, 657, 31, 652, 63, 319, 319, 22]] | 5 | 200 |
#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define imei(...) "[ " << #__VA_ARGS__ << " = " << __VA_ARGS__ << " ] "
using namespace std;
void solve(int t) {
int n;
cin >> n;
}
vector<int> a, b;
int n, m, k;
int main(int argc, char *argv[]) {
int ans = 0;
cin >> n >> m >> k;
... | #include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define imei(...) "[ " << #__VA_ARGS__ << " = " << __VA_ARGS__ << " ] "
using namespace std;
void solve(int t) {
int n;
cin >> n;
}
vector<ll> a, b;
int n, m, k;
int main(int argc, char *argv[]) {
int ans = 0;
cin >> n >> m >> k;
... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]] | 1 | 233 |
from bisect import bisect
N, M, K = map(int, input().split())
A = [0]+list(map(int, input().split()))
B = list(map(int, input().split()))
R_B = [0]*(M+1)
i = 0
while i < M:
R_B[i+1] = R_B[i]+B[i]
i += 1
ans = 0
i = 0
while i < N and K >= A[i]:
K -= A[i]
idx = bisect(R_B, K)
ans = max(ans, i+idx-1)
i += 1
... | from bisect import bisect
N, M, K = map(int, input().split())
A = [0]+list(map(int, input().split()))
B = list(map(int, input().split()))
R_B = [0]*(M+1)
i = 0
while i < M:
R_B[i+1] = R_B[i]+B[i]
i += 1
ans = 0
i = 0
while i <= N and K >= A[i]:
K -= A[i]
idx = bisect(R_B, K)
ans = max(ans, i+idx-1)
i += 1... | [["-", 0, 656, 0, 52, 15, 679, 31, 666, 667, 18], ["+", 0, 656, 0, 52, 15, 679, 31, 666, 667, 19]] | 5 | 149 |
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const ll mod = 1000000007;
const ll inf = 1e18;
int main() {
ll n, m, k;
cin >> n >> m >> k;
ll a[n + 1], b[m + 1];
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < m; i++)
cin >> b[i];
ll sa[n + 1] = {}, sb[m +... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const ll mod = 1000000007;
const ll inf = 1e18;
int main() {
ll n, m, k;
cin >> n >> m >> k;
ll a[n + 1], b[m + 1];
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < m; i++)
cin >> b[i];
ll sa[n + 1] = {}, sb[m +... | [["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 283 |
import bisect
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
b = [0]
for i in range(N):
a += [a[i] + A[i]]
for i in range(M):
b += [b[i] + B[i]]
ans = 0
for i in range(N+1):
if A[i] <= K:
ans = max(ans, i + bisect.bisect_right(... | import bisect
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
b = [0]
for i in range(N):
a += [a[i] + A[i]]
for i in range(M):
b += [b[i] + B[i]]
ans = 0
for i in range(N+1):
if a[i] <= K:
ans = max(ans, i + bisect.bisect_right(... | [["-", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22]] | 5 | 155 |
// +build ignore
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
)
func solve(sc *scanner, wr *bufio.Writer) int {
N := sc.i()
M := sc.i()
K := sc.i()
A := make([]int, N+1)
for i := 1; i <= N; i++ {
A[i] = sc.i() + A[i-1]
}
B := make([]int, M+1)
for i := 1; i <= M; i++ {
B[i] = sc.i() + B[i-1... | // +build ignore
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
)
func solve(sc *scanner, wr *bufio.Writer) int {
N := sc.i()
M := sc.i()
K := sc.i()
A := make([]int, N+1)
for i := 1; i <= N; i++ {
A[i] = sc.i() + A[i-1]
}
B := make([]int, M+1)
for i := 1; i <= M; i++ {
B[i] = sc.i() + B[i-1... | [["-", 0, 7, 0, 430, 10, 431, 12, 432, 0, 433], ["+", 0, 7, 0, 430, 10, 431, 12, 432, 0, 433]] | 7 | 612 |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ff first
#define ss second
#define pb push_back
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ff first
#define ss second
#define pb push_back
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | [["-", 51, 16, 12, 16, 31, 16, 12, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 16, 12, 69, 28, 22]] | 1 | 349 |
from itertools import accumulate
import bisect
n,m,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
A=list(accumulate(a))
B=list(accumulate(b))
ans=1+bisect.bisect_right(B,k)
for i in range(len(a)):
r = (k-A[i])
if r<=0:
break
#print(r,bisect.bisect... | from itertools import accumulate
import bisect
n,m,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
A=list(accumulate(a))
B=list(accumulate(b))
ans=bisect.bisect_right(B,k)
for i in range(len(a)):
r = (k-A[i])
if r<0:
break
#print(r,bisect.bisect_le... | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 612], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18]] | 5 | 142 |
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
typedef pair<int, pint> ppint;
typedef pair<ll, pll> ppll;
typedef vector<int> vint;
typedef vector<ll> vll;
const double pi = 3.141592653589793;
const int INF10 = 1000000001;
const ll INF15 ... | //
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
typedef pair<int, pint> ppint;
typedef pair<ll, pll> ppll;
typedef vector<int> vint;
typedef vector<ll> vll;
const double pi = 3.141592653589793;
const int INF10 = 1000000001;
const ll INF15 ... | [["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22]] | 1 | 1,288 |
#include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <limits>
#include <math.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using vs = vector<string>;
using vb = vector<bool>;
using vll = vector<long long>;
using vvll = vector<... | #include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <limits>
#include <math.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using vs = vector<string>;
using vb = vector<bool>;
using vll = vector<long long>;
using vvll = vector<... | [["-", 8, 9, 0, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 9, 0, 7, 10, 43, 39, 78], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94]] | 1 | 288 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ii = pair<ll, ll>;
using vi = vector<ll>;
#define pb push_back
#define pf pop_front
#define mp make_pair
#define fi first
#define se second
#define INF (ll)1e18
#define all(x) (x).begin(), (x).end()
#define print(a) ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ii = pair<ll, ll>;
using vi = vector<ll>;
#define pb push_back
#define pf pop_front
#define mp make_pair
#define fi first
#define se second
#define INF (ll)1e18
#define all(x) (x).begin(), (x).end()
#define print(a) ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 276 |
N,M,K = map(int,input().split())
A = list(map(int, input().split()))
B =list(map(int, input().split()))
sumA=[0]
sumB=[0]
for i in range(N):
sumA.append(sumA[-1]+A[i])
for i in range(M):
sumB.append(sumB[-1]+B[i])
total=0
startB=len(sumB)-1
for a in range(len(sumA)):
for b in range(startB,-1,-1):
if s... | N,M,K = map(int,input().split())
A = list(map(int, input().split()))
B =list(map(int, input().split()))
sumA=[0]
sumB=[0]
for i in range(N):
sumA.append(sumA[-1]+A[i])
for i in range(M):
sumB.append(sumB[-1]+B[i])
total=0
startB=len(sumB)-1
for a in range(len(sumA)):
for b in range(startB,-1,-1):
if s... | [["+", 64, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 179 |
import bisect
N,M,K=map(int,input().split())
alist=list(map(int,input().split()))
blist=list(map(int,input().split()))
sum_alist=[0]
for i in range(N):
sum_alist.append(sum_alist[-1]+alist[i])
#print(sum_alist)
sum_blist=[0]
for i in range(M):
sum_blist.append(sum_blist[-1]+blist[i])
#print(sum_blist)
limit_a=bi... | import bisect
N,M,K=map(int,input().split())
alist=list(map(int,input().split()))
blist=list(map(int,input().split()))
sum_alist=[0]
for i in range(N):
sum_alist.append(sum_alist[-1]+alist[i])
#print(sum_alist)
sum_blist=[0]
for i in range(M):
sum_blist.append(sum_blist[-1]+blist[i])
#print(sum_blist)
limit_a=bi... | [["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 612], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 21]] | 5 | 208 |
def main():
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
AReqTime = [0]
BReqTime = [0]
for i in range(N):
AReqTime.append(AReqTime[i] + A[i])
for i in range(M):
BReqTime.append(BReqTime[i] + B[i])
j = M
... | def main():
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
AReqTime = [0]
BReqTime = [0]
for i in range(N):
AReqTime.append(AReqTime[i] + A[i])
for i in range(M):
BReqTime.append(BReqTime[i] + B[i])
j = M
... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 178 |
import java.util.*;
/*
NOTES:
-more than 10 digits (10^10), use long
-prefix sum of 1's and -1's to control flow of highlighting a region
-log(a)/log(b) = log base b of a
-create a position array if trying to see if elements show up next to each other
sequentially i.e. elements 1,2,3 are within 3 spots of each other ... |
import java.util.*;
/*
NOTES:
-more than 10 digits (10^10), use long
-prefix sum of 1's and -1's to control flow of highlighting a region
-log(a)/log(b) = log base b of a
-create a position array if trying to see if elements show up next to each other
sequentially i.e. elements 1,2,3 are within 3 spots of each other ... | [["-", 8, 196, 0, 503, 39, 224, 468, 506, 0, 507], ["+", 8, 196, 0, 503, 39, 224, 468, 506, 0, 96], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 227, 39, 506, 0, 96], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 45], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 46]] | 3 | 767 |
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, n) for (int i = 1; i <= n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#d... | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, n) for (int i = 1; i <= n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#d... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["-", 0, 52, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0... | 1 | 636 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mxN = 2e5;
int n, m;
ll k, a[mxN + 2] = {0}, b[mxN + 2] = {0};
int main() {
cin >> n >> m >> k;
for (int i = 0; i < n; i++) {
cin >> a[i + 1];
a[i + 1] += a[i];
}
for (int i = 0; i < m; i++) {
cin >> b[i + 1];
b[i + 1] ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mxN = 2e5;
int n, m;
ll k, a[mxN + 2] = {0}, b[mxN + 2] = {0};
int main() {
cin >> n >> m >> k;
for (int i = 0; i < n; i++) {
cin >> a[i + 1];
a[i + 1] += a[i];
}
for (int i = 0; i < m; i++) {
cin >> b[i + 1];
b[i + 1] ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 201 |
def main():
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if a[0] > K and b[0] > K:
return 0
a2=[0]
for i in a:a2.append(a2[-1]+i)
b2=[0]
for i in b:b2.append(b2[-1]+i)
ans = 0
j = M
for i in ran... | def main():
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if a[0] > K and b[0] > K:
return 0
a2=[0]
for i in a:a2.append(a2[-1]+i)
b2=[0]
for i in b:b2.append(b2[-1]+i)
ans = 0
j = M
for i in ran... | [["-", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["-", 8, 196, 0, 52, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 52, 15, 666, 0, 206, 51, 22], ["-", 0, 52, 15, 666, 0, 657, 12, 206, 51, 22], ["+", 0, 52, 15, 666, 0, 657, 12, 206, 51, 22]] | 5 | 184 |
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0]*N, [0]*M
total = 0
for i in range(N):
total += A[i]
a[i] = total
a = [0] + a
total = 0
for i in range(M):
total += B[i]
b[i] = total
b = [0] + b
ans, j = 0, M
for i in range(N):
... | N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0]*N, [0]*M
total = 0
for i in range(N):
total += A[i]
a[i] = total
a = [0] + a
total = 0
for i in range(M):
total += B[i]
b[i] = total
b = [0] + b
ans, j = 0, M
for i in range(N+1):... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 181 |
N, M, K = gets.split.map(&:to_i)
a = []
b = []
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
sa = []
sa[0] = 0
sb = []
sb[0] = 0
N.times do |i|
sa[i+1] = sa[i] + a[i]
end
M.times do |i|
sb[i+1] = sb[i] + b[i]
end
ans = 0
j = M
(N+1).times do |i|
break if a[i] > K
while sb[j] > K - sa[i]
j -= 1
... | N, M, K = gets.split.map(&:to_i)
a = []
b = []
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
sa = []
sa[0] = 0
sb = []
sb[0] = 0
N.times do |i|
sa[i+1] = sa[i] + a[i]
end
M.times do |i|
sb[i+1] = sb[i] + b[i]
end
ans = 0
j = M
(N+1).times do |i|
break if sa[i] > K
while sb[j] > K - sa[i]
j -= 1
en... | [["-", 8, 736, 0, 751, 15, 738, 31, 742, 500, 22], ["+", 8, 736, 0, 751, 15, 738, 31, 742, 500, 22]] | 4 | 168 |
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdint.h>
#include <string>
#include <vector>
using namespace std;
#define PI (3.14159265358979323846)
#define INF (2147483647)
#define INF_LL (9223372036854775807)
... | #include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdint.h>
#include <string>
#include <vector>
using namespace std;
#define PI (3.14159265358979323846)
#define INF (2147483647)
#define INF_LL (9223372036854775807)
... | [["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13]] | 1 | 351 |
#include <stdio.h>
int main(void) {
// Your code here!
long long int a[200001];
long long int b[200001];
int n, m, k;
a[0] = 0;
b[0] = 0;
scanf("%d %d %d", &n, &m, &k);
for (int i = 1; i <= n; i++) {
scanf("%lld", &a[i]);
a[i] += a[i - 1];
}
for (int i = 1; i <= m; i++) {
scanf("%lld"... | #include <stdio.h>
int main(void) {
// Your code here!
long long int a[200001];
long long int b[200001];
int n, m, k;
a[0] = 0;
b[0] = 0;
scanf("%d %d %d", &n, &m, &k);
for (int i = 1; i <= n; i++) {
scanf("%lld", &a[i]);
a[i] += a[i - 1];
}
for (int i = 1; i <= m; i++) {
scanf("%lld"... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 0 | 231 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.