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; #define fr first #define se second #define int long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define vi vector<int> #define mi map<int, int> #define pqb priority_queue<int> #define set_bits(x) __builtin_popcountll(x) #define mod 1000000007 ...
#include <bits/stdc++.h> using namespace std; #define fr first #define se second #define int long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define vi vector<int> #define mi map<int, int> #define pqb priority_queue<int> #define set_bits(x) __builtin_popcountll(x) #define mod 1000000007 ...
[["-", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22], ["-", 8, 9, 0, 14, 49, 53, 54, 55, 0, 24], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 8, 9, 0, 14, 49, 53, 54, 55, 0, 25], ["-", 0, 14, 8, 9, 0, 14, 8, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 14, 8, 9, 0, 46]]
1
194
#include <iostream> #include <string> using namespace std; int main() { string S, T; cin >> S >> T; int i, cnt = 0; for (i = 0; i < S.length(); i++) if (S[i] == T[i]) cnt++; cout << cnt << endl; }
#include <iostream> #include <string> using namespace std; int main() { string S, T; cin >> S >> T; int i, cnt = 0; for (i = 0; i < S.length(); i++) if (S[i] != T[i]) cnt++; cout << cnt << endl; }
[["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 79]]
1
70
#include <algorithm> #include <bits/stdc++.h> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string a, b; cin >> a >> b; int n, t; t = 0; n = a.size(); rep(i, n) { if (a[i] = b[i]) { t = t +...
#include <algorithm> #include <bits/stdc++.h> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string a, b; cin >> a >> b; int n, t; t = 0; n = a.size(); rep(i, n) { if (a[i] == b[i]) { t = t ...
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
107
#include <bits/stdc++.h> using namespace std; int main() { string str, str1; cin >> str >> str1; int n = str.length(), c = 0; for (int i = 0; i < n; i++) { if (str != str1) c++; } cout << c << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string str, str1; cin >> str >> str1; int n = str.length(), c = 0; for (int i = 0; i < n; i++) { if (str[i] != str1[i]) c++; } cout << c << endl; return 0; }
[["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 73]]
1
70
#include <bits/stdc++.h> using namespace std; int main() { string s; string s1; cin >> s >> s1; int ans = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == s[i + 1]) { } else { ans = ans + 1; } } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { string s; string s1; cin >> s >> s1; int ans = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == s1[i]) { } else { ans = ans + 1; } } cout << ans; }
[["-", 0, 57, 15, 339, 51, 16, 12, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 69, 28, 22], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
78
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S; cin >> T; int ans = 0; for (int i = 0; i < S.size(); i++) { if (S[i] == T[i]) { ans++; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S; cin >> T; int ans = 0; for (int i = 0; i < S.size(); i++) { if (S[i] != T[i]) { ans++; } } cout << ans << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
73
s = input() t - input() def hamming_dist(str1,str2): ans = 0 a,b = len(str1),len(str2) if a > b: ans = a - b length = b elif a < b: ans = b - a length = a else: length = a for i in range(length): if str1[i] != str2[i]: ans += 1 retu...
s = input() t = input() def hamming_dist(str1,str2): ans = 0 a,b = len(str1),len(str2) if a > b: ans = a - b length = b elif a < b: ans = b - a length = a else: length = a for i in range(length): if str1[i] != str2[i]: ans += 1 retu...
[["-", 36, 36, 0, 656, 0, 1, 0, 657, 17, 33], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32]]
5
98
S, T = input().split() leng = len(S) count = 0 for i in range(len(S)): if S[i] != T[i]: count += 1 print(count)
S = input() T = input() leng = len(S) count = 0 for i in range(len(S)): if S[i] != T[i]: count += 1 print(count)
[["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
49
S = input() T = input() ans = 0 for i in range(len(S)-1): if S[i] != T[i]: ans += 1 print(ans)
S = input() T = input() ans = 0 for i in range(len(S)): if S[i] != T[i]: ans += 1 print(ans)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
44
#include <bits/stdc++.h> using namespace std; string s, t; int ans; int main() { cin >> s; cin >> t; int n = s.length(); for (int i = 1; i <= n; i++) { if (s[i] != t[i]) ans++; } cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; string s, t; int ans; int main() { cin >> s; cin >> t; int n = s.length(); for (int i = 0; i < n; i++) { if (s[i] != t[i]) ans++; } cout << ans; return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
75
import os str = input() str2 = input() count = 0 for i in range(1, len(str)): if str[i] != str2[i]: count = count + 1 print(count)
import os str = input() str2 = input() count = 0 for i in range(0, len(str)): if str[i] != str2[i]: count = count + 1 print(count)
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
48
#include <bits/stdc++.h> #define fastio \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define display(v) ...
#include <bits/stdc++.h> #define fastio \ ios::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define display(v) ...
[["+", 0, 7, 8, 1, 0, 11, 12, 91, 17, 111]]
1
432
S=input() T=input() cnt=0 for i in len(S): if(S[i]==T[i]): cnt+=1 print(cnt)
S=input() T=input() cnt=0 for i in range(len(S)): if(S[i]!=T[i]): cnt+=1 print(cnt)
[["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25], ["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 79]]
5
41
#ifdef __APPLE__ #include <algorithm> #include <cmath> #include <ctgmath> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #else #include <bits...
#ifdef __APPLE__ #include <algorithm> #include <cmath> #include <ctgmath> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #else #include <bits...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
389
#include <bits/stdc++.h> #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define fr(i, a, b) for (int i = a; i < b; i++) #define frr(i, a, b) for (int i = a; i >= b; i--...
#include <bits/stdc++.h> #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define fr(i, a, b) for (int i = a; i < b; i++) #define frr(i, a, b) for (int i = a; i >= b; i--...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
127
a=input() b=input() ans=0 for i,j in a,b: if i != j: ans+=1 print(ans)
a=input() b=input() ans=0 for i,j in zip(a,b): if i != j: ans+=1 print(ans)
[["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25]]
5
34
from sys import stdin,stdout LI=lambda:list(map(int,input().split())) MAP=lambda:map(int,input().split()) IN=lambda:int(input()) S=lambda:input() import math def p(a):print(" ".join(list(map(str,a)))) from collections import Counter s=S() t=t() x=0 for i in range(len(s)): if s[i]!=t[i]:x+=1 print(x)
from sys import stdin,stdout LI=lambda:list(map(int,input().split())) MAP=lambda:map(int,input().split()) IN=lambda:int(input()) S=lambda:input() import math def p(a):print(" ".join(list(map(str,a)))) from collections import Counter s=S() t=S() x=0 for i in range(len(s)): if s[i]!=t[i]:x+=1 print(x)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
131
#include <bits/stdc++.h> // 2의 제곱수 판정 #define POW2(X) (X) == ((X) & (-(X))) // 기본설정 typedef long long ll; using namespace std; int dirx[4] = {1, 0, -1, 0}; int diry[4] = {0, 1, 0, -1}; // 전역변수 int main(void) { cin.tie(NULL); ios_base::sync_with_stdio(false); string s1, s2; int cnt = 0; cin >> s1 >> s2; ...
#include <bits/stdc++.h> // 2의 제곱수 판정 #define POW2(X) (X) == ((X) & (-(X))) // 기본설정 typedef long long ll; using namespace std; int dirx[4] = {1, 0, -1, 0}; int diry[4] = {0, 1, 0, -1}; // 전역변수 int main(void) { cin.tie(NULL); ios_base::sync_with_stdio(false); string s1, s2; int cnt = 0; cin >> s1 >> s2; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
131
#include <bits/stdc++.h> using namespace std; #define ll long long #define deb(x) cerr << #x << ":" << x << "\n" #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, null_t...
#include <bits/stdc++.h> using namespace std; #define ll long long #define deb(x) cerr << #x << ":" << x << "\n" #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, null_t...
[["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]]
1
138
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { sc := NewScanner() S, T := sc.Next(), sc.Next() cnt := 0 for i := 0; i < len(S); i++ { if S[i] != T[i] { cnt++ } fmt.Println(cnt) } } type Scanner struct { r *bufio.Reader buf []byte p int } func NewScanner() *Scanner { r...
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { sc := NewScanner() S, T := sc.Next(), sc.Next() cnt := 0 for i := 0; i < len(S); i++ { if S[i] != T[i] { cnt++ } } fmt.Println(cnt) } type Scanner struct { r *bufio.Reader buf []byte p int } func NewScanner() *Scanner { rd...
[["+", 0, 435, 8, 196, 0, 7, 8, 196, 0, 46], ["+", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["-", 0, 435, 8, 196, 0, 7, 8, 196, 0, 165], ["-", 0, 435, 8, 196, 0, 7, 8, 196, 0, 46]]
7
899
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll i, dap = 0; string s, t; cin >> s; cin >> t; for (i = 1; i < s.length(); i++) dap += (s[i] != t[i]); cout << dap; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll i, dap = 0; string s, t; cin >> s; cin >> t; for (i = 0; i < s.length(); i++) dap += (s[i] != t[i]); cout << dap; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
1
76
#include <algorithm> #include <cstdio> #include <iostream> #include <locale.h> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> using namespace std; int main() { int n, m, k; long long int a[200002], b[200002]; // int possa = 0; long long int ssx = 0, ax; /...
#include <algorithm> #include <cstdio> #include <iostream> #include <locale.h> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> using namespace std; int main() { int n, m, k; long long int a[200002], b[200002]; // int possa = 0; long long int ssx = 0, ax; /...
[["-", 51, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 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]]
1
269
n, m, k = gets.split.map(&:to_i) a_arr = gets.split.map(&:to_i) b_arr = gets.split.map(&:to_i) sum = 0 sum_a_arr = [[0, 0]] a_arr.each_with_index do |num, i| sum += num sum_a_arr << [sum, i + 1] end sum = 0 sum_b_arr = [[0, 0]] b_arr.each_with_index do |num, i| sum += num sum_b_arr << [sum, i + 1] end max = ...
n, m, k = gets.split.map(&:to_i) a_arr = gets.split.map(&:to_i) b_arr = gets.split.map(&:to_i) sum = 0 sum_a_arr = [[0, 0]] a_arr.each_with_index do |num, i| sum += num sum_a_arr << [sum, i + 1] end sum = 0 sum_b_arr = [[0, 0]] b_arr.each_with_index do |num, i| sum += num sum_b_arr << [sum, i + 1] end max = ...
[["+", 8, 736, 0, 89, 15, 738, 12, 738, 17, 72], ["+", 8, 736, 0, 89, 15, 738, 12, 738, 12, 612]]
4
168
#include <iostream> using namespace std; int n, m, k; int a[200001], b[200001]; // 累積和を格納する void solve() { int ans = 0; int j = m; // aを先頭から見ていく for (int i = 0; i <= n; i++) { // aだけでkを超えたら満たせないのでbreak if (a[i] > k) break; // bを後ろからみる while (b[j] + a[i] > k) { j--; } ans = m...
#include <iostream> using namespace std; typedef long long ll; int n, m, k; ll a[200001], b[200001]; // 累積和を格納する void solve() { int ans = 0; int j = m; // aを先頭から見ていく for (int i = 0; i <= n; i++) { // aだけでkを超えたら満たせないのでbreak if (a[i] > k) break; // bを後ろからみる while (b[j] + a[i] > k) { j...
[["+", 36, 36, 36, 36, 0, 30, 0, 134, 0, 157], ["+", 36, 36, 0, 30, 0, 134, 39, 86, 0, 96], ["+", 36, 36, 36, 36, 0, 30, 0, 134, 49, 78], ["+", 36, 36, 36, 36, 0, 30, 0, 134, 0, 35], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78]]
1
218
#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, 0), B(M + 1, 0); ll a, b; for (ll i = 1; i < N + 1; i++) { cin >> a; A[i] = a + A[i - 1]; } for (ll i = 1; i < M + 1; i++) { cin >> b; B[i] = b + B[i - 1]; ...
#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, 0), B(M + 1, 0); ll a, b; for (ll i = 1; i < N + 1; i++) { cin >> a; A[i] = a + A[i - 1]; } for (ll i = 1; i < M + 1; i++) { cin >> b; B[i] = b + B[i - 1]; ...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
230
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { int n, m, k; cin >> n >> m >> k; vector<ll> a(n + 1, 0), b(m + 1, 0); for (int i = 1; i <= n; i++) cin >> a[i], a[i] += a[i - 1]; for (int i = 1; i <= m; i++) cin >> b[i], b[i] += b[i - ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { int n, m, k; cin >> n >> m >> k; vector<ll> a(n + 1, 0), b(m + 1, 0); for (int i = 1; i <= n; i++) cin >> a[i], a[i] += a[i - 1]; for (int i = 1; i <= m; i++) cin >> b[i], b[i] += b[i - ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
209
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <vector> using namespace std; using ll = long long int; using P = pair<int, int>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) ll mod = 1000000007; int main() { ll n, m, k; cin >> n >> m >> k; vector<ll> a(n + 1, mod), b...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <vector> using namespace std; using ll = long long int; using P = pair<int, int>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) ll mod = 1000000007; int main() { ll n, m, k; cin >> n >> m >> k; vector<ll> a(n + 1, mod), b...
[["-", 31, 69, 28, 2, 3, 4, 0, 16, 17, 72], ["-", 31, 69, 28, 2, 3, 4, 0, 16, 12, 13]]
1
255
n, m, k = map(int, input().split()) aa = list(map(int, input().split())) bb = list(map(int, input().split())) asum = [0] bsum = [0] for i in range(len(aa)): asum.append(asum[i]+aa[i]) for i in range(len(bb)): bsum.append(bsum[i]+bb[i]) j = len(bsum)-1 ans = 0 for i in range(len(asum)): while j > 0: ...
n, m, k = map(int, input().split()) aa = list(map(int, input().split())) bb = list(map(int, input().split())) asum = [0] bsum = [0] for i in range(len(aa)): asum.append(asum[i]+aa[i]) for i in range(len(bb)): bsum.append(bsum[i]+bb[i]) j = len(bsum)-1 ans = 0 for i in range(len(asum)): while j >= 0: ...
[["-", 0, 7, 8, 196, 0, 52, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 52, 15, 666, 667, 20]]
5
172
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double lld; ll MOD = (1e9) + 7; const int dr[] = {+1, -1, +0, +0, +1, -1, +1, -1}; const int dc[] = {+0, +0, +1, -1, +1, -1, -1, +1}; const int kx[] = {+1, +2, -1, -2, +1, +2, -1, -2}; const int ky[] = {+2, +1, +2, +1, -2, -1, -2, -1};...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double lld; ll MOD = (1e9) + 7; const int dr[] = {+1, -1, +0, +0, +1, -1, +1, -1}; const int dc[] = {+0, +0, +1, -1, +1, -1, -1, +1}; const int kx[] = {+1, +2, -1, -2, +1, +2, -1, -2}; const int ky[] = {+2, +1, +2, +1, -2, -1, -2, -1};...
[["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 12, 13]]
1
581
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define pb push_back #define pf push_front #define pof pop_front #define pob pop_back #define mp make_pair #define pll pair<ll, ll> #define pii pair<int, int> #define pdd pair<double, double> #defin...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define pb push_back #define pf push_front #define pof pop_front #define pob pop_back #define mp make_pair #define pll pair<ll, ll> #define pii pair<int, int> #define pdd pair<double, double> #defin...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 16, 31, 2, 63, 22]]
1
385
#include <bits/stdc++.h> #define rush() \ int T; \ scanf("%d", &T); \ int kase = 1; ...
#include <bits/stdc++.h> #define rush() \ int T; \ scanf("%d", &T); \ int kase = 1; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78]]
1
306
def getmax(x,y): if x>y: return x else: return y 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[i]にはAの本をi冊読んだ時の時間がそれぞれ保存されている. a.append(a[i]+A[i]) #計算量を減らすため,a[i](1冊前までにかかる時間)を用いる for i in range(M...
def getmax(x,y): if x>y: return x else: return y 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[i]にはAの本をi冊読んだ時の時間がそれぞれ保存されている. a.append(a[i]+A[i]) #計算量を減らすため,a[i](1冊前までにかかる時間)を用いる for i in range(M...
[["-", 8, 196, 0, 57, 15, 666, 0, 206, 206, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 206, 22]]
5
185
#include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define yn(x) ((x) ? "Yes" : "No") typedef pair<int, int> ii; typedef pair<int, ii> iii; const int siz = 2e5 + 10; const int SIZ = 1e6 + 10; const...
#include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define yn(x) ((x) ? "Yes" : "No") typedef pair<int, int> ii; typedef pair<int, ii> iii; const int siz = 2e5 + 10; const int SIZ = 1e6 + 10; const...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
306
#C n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) asum=[0] bsum=[0] for i in range(n): asum.append(asum[-1]+a[i]) for i in range(m): bsum.append(bsum[-1+b[i]]) ans=0 for i in range(n+1): if asum[i]>0: break while asum[i]+bsum[m]>0 and m>0: ...
n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) asum=[0] bsum=[0] for i in range(n): asum.append(asum[-1]+a[i]) for i in range(m): bsum.append(bsum[-1]+b[i]) ans=0 for i in range(n+1): if asum[i]>k: break while asum[i]+bsum[m]>k and m>0: m...
[["+", 0, 652, 3, 4, 0, 657, 31, 206, 0, 73], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 0, 73], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 8, 196, 0, 52, 15, 679, 31, 666, 0, 612], ["+", 8, 196, 0, 52, 15, 679, 31, 666, 0, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
164
n,m,k = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = [0]*(n+1) d = [0]*(m+1) for i in range(n): c[i+1] = a[i]+c[i] for i in range(m): d[i+1] = b[i]+d[i] for i in range(m+1)[::-1]: if d[i] <= k: x = i break ans = 0 for i in range(1,n+1): ...
n,m,k = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = [0]*(n+1) d = [0]*(m+1) for i in range(n): c[i+1] = a[i]+c[i] for i in range(m): d[i+1] = b[i]+d[i] for i in range(m+1)[::-1]: if d[i] <= k: x = i break ans = x for i in range(1,n+1): ...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22]]
5
216
from sys import stdin nii=lambda:map(int,stdin.readline().split()) lnii=lambda:list(map(int,stdin.readline().split())) from bisect import bisect_right from itertools import accumulate n,m,k=nii() a=lnii() b=lnii() ar=[0]+list(accumulate(a)) br=list(accumulate(b)) ans=0 for i in range(n+1): time=ar[i] if time>k: ...
from sys import stdin nii=lambda:map(int,stdin.readline().split()) lnii=lambda:list(map(int,stdin.readline().split())) from bisect import bisect_right from itertools import accumulate n,m,k=nii() a=lnii() b=lnii() ar=[0]+list(accumulate(a)) br=list(accumulate(b)) ans=0 for i in range(n+1): time=ar[i] if time>k: ...
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
145
from bisect import * n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) a_b=[0] for i in range(1,n+1): a_b.append(a_b[i-1]+a[i-1]) b_b=[0] for i in range(1,m+1): b_b.append(b_b[i-1]+b[i-1]) ans=0 for i in range(n+1): t_ans=i if t_ans>k: break t_ans+=bisect...
from bisect import * n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) a_b=[0] for i in range(1,n+1): a_b.append(a_b[i-1]+a[i-1]) b_b=[0] for i in range(1,m+1): b_b.append(b_b[i-1]+b[i-1]) ans=0 for i in range(n+1): t_ans=i if a_b[i]>k: break t_ans+=bisec...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 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, 206, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 0, 73]]
5
175
package main import ( "bufio" "fmt" "os" "strconv" ) func nextInt() int { sc.Scan() i, e := strconv.Atoi(sc.Text()) if e != nil { panic(e) } return i } var sc = bufio.NewScanner(os.Stdin) func main() { // Code for C - Tsundoku var N, M, K int fmt.Scan(&N, &M, &K) sc.Split(bufio.ScanWords) var temp ...
package main import ( "bufio" "fmt" "os" "strconv" ) func nextInt() int { sc.Scan() i, e := strconv.Atoi(sc.Text()) if e != nil { panic(e) } return i } var sc = bufio.NewScanner(os.Stdin) func main() { // Code for C - Tsundoku var N, M, K int fmt.Scan(&N, &M, &K) sc.Split(bufio.ScanWords) var temp ...
[["-", 0, 7, 0, 430, 10, 431, 12, 432, 0, 433], ["+", 0, 7, 0, 430, 10, 431, 12, 432, 0, 433], ["-", 8, 196, 0, 7, 0, 430, 15, 16, 31, 433], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 31, 433]]
7
363
/********************************************************************************************** ******************************AUTHOR:********************************************************** ****************************ASHISH *RANJAN****************************************************** *******************************...
/********************************************************************************************** ******************************AUTHOR:********************************************************** ****************************ASHISH *RANJAN****************************************************** *******************************...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
289
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; typedef long long ll; const int maxn = 1e6 + 50; const int inf = 0x3f3f3f3f; const...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; typedef long long ll; const int maxn = 1e6 + 50; const int inf = 0x3f3f3f3f; const...
[["+", 0, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]]
1
272
from itertools import accumulate from bisect import bisect def main(): n, m, k = map(int, input().split()) a = tuple(map(int, input().split())) b = tuple(map(int, input().split())) aa = tuple(accumulate(a)) ba = tuple(accumulate(b)) r = 0 for i1 in range(n): if aa[i1] > k: ...
from itertools import accumulate from bisect import bisect def main(): n, m, k = map(int, input().split()) a = tuple(map(int, input().split())) b = tuple(map(int, input().split())) aa = tuple(accumulate(a)) ba = tuple(accumulate(b)) r = 0 for i1 in range(n): if aa[i1] > k: ...
[["-", 12, 652, 3, 4, 0, 657, 12, 206, 206, 22], ["+", 12, 652, 3, 4, 0, 657, 12, 206, 206, 22]]
5
188
def judge(n,array1,array2,K): for i in range(n): if len(array1) > i and len(array2) > n-i: sum = array1[i] + array2[n-i] if sum <= K: return True return False N, M, K = list(map(int,input().split())) As = list(map(int,input().split())) Bs = list(map(int,input().s...
def judge(n,array1,array2,K): for i in range(n+1): if len(array1) > i and len(array2) > n-i: sum = array1[i] + array2[n-i] if sum <= K: return True return False N, M, K = list(map(int,input().split())) As = list(map(int,input().split())) Bs = list(map(int,input()...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
238
if __name__ == '__main__': N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) acc_A = [] acc_B = [] acc_A.append(0) acc_B.append(0) sum_a = 0 sum_b = 0 for a in A: sum_a += a acc_A.append(sum_a) ...
if __name__ == '__main__': N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) acc_A = [] acc_B = [] acc_A.append(0) acc_B.append(0) sum_a = 0 sum_b = 0 for a in A: sum_a += a acc_A.append(sum_a) ...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]]
5
201
#include <bits/stdc++.h> using namespace std; void solve() { int n, m, k; cin >> n >> m >> k; int a[n]; int b[m]; int sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int j = n - 1; for (int i = 0; i < m; i++) { cin >> b[i]; } int ans = 0; for (int i = 0; i <= m; i...
#include <bits/stdc++.h> using namespace std; void solve() { int n, m, k; cin >> n >> m >> k; int a[n]; int b[m]; long long sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } int j = n - 1; for (int i = 0; i < m; i++) { cin >> b[i]; } int ans = 0; for (int i = 0; i <...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
191
#include <iostream> #include <queue> using namespace std; long long n, a[200005], b[200005], m, k, ans, sumA[200005], sumB[200005]; long long bs(long long t) { if (t < sumB[1]) return 0; if (t >= sumB[m]) return m; long long l = 1, r = m; while (l <= r) { long long mid = (l + r) / 2; if (sumB...
#include <iostream> #include <queue> using namespace std; long long n, a[200005], b[200005], m, k, ans, sumA[200005], sumB[200005]; long long bs(long long t) { if (t < sumB[1]) return 0; if (t >= sumB[m]) return m; long long l = 1, r = m; while (l <= r) { long long mid = (l + r) / 2; if (sumB...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 15, 16, 31, 23, 0, 24], ["+", 8, 9, 0, 7, 15, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 25]]
1
302
n, m, k = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) As = [0] * (n + 1) Bs = [0] * (m + 1) for i in range(n): As[i + 1] = A[i] + As[i - 1] for i in range(m): Bs[i + 1] = B[i] + Bs[i - 1] l = 0 r = n + m + 1 while r - l > 1: p = (l + r) // 2 best = k + 1 ...
n, m, k = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) As = [0] * (n + 1) Bs = [0] * (m + 1) for i in range(n): As[i + 1] = A[i] + As[i] for i in range(m): Bs[i + 1] = B[i] + Bs[i] l = 0 r = n + m + 1 while r - l > 1: p = (l + r) // 2 best = k + 1 for i i...
[["-", 0, 662, 12, 657, 12, 206, 206, 657, 17, 33], ["-", 0, 662, 12, 657, 12, 206, 206, 657, 12, 612]]
5
222
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e18; const ll Maxn = 2e5 + 10; ll N, M, K; ll a[Maxn], b[Maxn], prea[Maxn], preb[Maxn]; ll finds(ll nums) { ll l = 0, r = M; while (l < r) { ll mid = (l + r) >> 1; if (l == r - 1) { if (preb[r] <= nums) { retur...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e18; const ll Maxn = 2e5 + 10; ll N, M, K; ll a[Maxn], b[Maxn], prea[Maxn], preb[Maxn]; ll finds(ll nums) { ll l = 0, r = M; while (l < r) { ll mid = (l + r) >> 1; if (l == r - 1) { if (preb[r] <= nums) { retur...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
304
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int main() { int n, m; ll k; cin >> n >> m >> k; vector<ll> sa(n + 1, 0), sb(n + 1, 0); rep(i, n) { l...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1000000007; #define INF 1LL << 30 #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int main() { int n, m, k; cin >> n >> m >> k; vector<ll> sa(n + 1, 0), sb(m + 1, 0); rep(i, n) { ll a; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22]]
1
207
N, M, K = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) Asum = [0] Bsum = [0] a = 0 b = 0 for i in range(N): a += A[i] Asum.append(a) for i in range(M): b += B[i] Bsum.append(b) Asum.append(0) Bsum.append(0) res, j = 0, 0 for i in range(N+1): if Asum[...
N, M, K = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) Asum = [0] Bsum = [0] a = 0 b = 0 for i in range(N): a += A[i] Asum.append(a) for i in range(M): b += B[i] Bsum.append(b) Asum.append(0) Bsum.append(0) res, j = 0, M for i in range(N+1): if Asum[...
[["-", 0, 656, 0, 1, 0, 662, 12, 432, 0, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 432, 0, 22], ["-", 0, 52, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110]]
5
176
#include <bits/stdc++.h> #define ll long long #define N 200010 using namespace std; int n, m, ans = 0; ll a[N], b[N], k; int main() { a[0] = 0; b[0] = 0; cin >> n >> m >> k; for (int i = 1; i <= n; i++) { cin >> a[i]; a[i] += a[i - 1]; } for (int i = 1; i <= m; i++) { cin >> b[i]; b[i] += b[...
#include <bits/stdc++.h> #define ll long long #define N 200010 using namespace std; int n, m, ans = 0; ll a[N], b[N], k; int main() { a[0] = 0; b[0] = 0; cin >> n >> m >> k; for (int i = 1; i <= n; i++) { cin >> a[i]; a[i] += a[i - 1]; } for (int i = 1; i <= m; i++) { cin >> b[i]; b[i] += b[...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
215
n, m, k = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 ia = 0 ib = 0 nowtime = 0 cnt = 0 for i in range(n): if nowtime + a[i] <= k: nowtime += a[i] cnt += 1 ia = i else: break ans = cnt for i in range(m): while ...
n, m, k = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 ia = -1 ib = -1 nowtime = 0 cnt = 0 for i in range(n): if nowtime + a[i] <= k: nowtime += a[i] cnt += 1 ia = i else: break ans = cnt # print(ans, nowtime) for i ...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 664, 17, 33], ["+", 0, 656, 0, 1, 0, 662, 12, 664, 28, 612]]
5
169
def main(): N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) cum_A = [0] for a in A: if a + cum_A[-1] <= K: cum_A.append(a + cum_A[-1]) cum_B = [0] for b in B: if b + cum_B[-1] <= K: cum_B.appe...
def main(): N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) cum_A = [0] for a in A: if a + cum_A[-1] <= K: cum_A.append(a + cum_A[-1]) else: break cum_B = [0] for b in B: if b + cum_B[...
[["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102], ["+", 0, 57, 75, 76, 8, 196, 0, 93, 0, 94]]
5
209
#include <bits/stdc++.h> #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define all(x) (x).begin(), (x).en...
#include <bits/stdc++.h> #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define all(x) (x).begin(), (x).en...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
328
import bisect n, m, k = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) ra = [0] * (n + 1) rb = [0] * (m + 1) for i in range(n): ra[i + 1] = a[i] + ra[i] for j in range(m): rb[j + 1] = b[j] + rb[j] ans = 0 for i in range(1, n + 1): zan = k - ra[i] if ...
import bisect n, m, k = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) ra = [0] * (n + 1) rb = [0] * (m + 1) for i in range(n): ra[i + 1] = a[i] + ra[i] for j in range(m): rb[j + 1] = b[j] + rb[j] ans = 0 for i in range(n + 1): zan = k - ra[i] if zan...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
187
#pragma GCC optimize("O2") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\...
#pragma GCC optimize("O2") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 75, 76, 0, 93, 0, 35]]
1
279
/* ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠺⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⠀⠈⢿⣦⣄⣈⣁⣀⣠⣴⣦⡀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣶⡄⠙⢿⣿⣿⣿⣿⣿⡿⠓⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠙⣿⣿⠿⠛⠛⠛⠛⣿⣿⡄⠀⠈⠉⠉⠉⣁⣀⡀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⣸⣿⡇⠀⠀⠀⣴⣿⣿⡿⠿⢷⣄⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠠⣤⣤⣴⣾⣿⡿⠁⠀⢀⣾⣿⣿⠏⠀⠀⠈⣿⣧⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣏⠀⠀⣠⣾⣿⣿⠏⠀⠀⠀⠀⢹⣿⡄⠀⠀ ⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠻⣿⣿⡟⠻⠿⠛⠁⠀⠀⠀⠀⠀⣾⣿⡇⠀⠀ ⠀⠀...
/* ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠺⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⠀⠈⢿⣦⣄⣈⣁⣀⣠⣴⣦⡀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣶⡄⠙⢿⣿⣿⣿⣿⣿⡿⠓⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠙⣿⣿⠿⠛⠛⠛⠛⣿⣿⡄⠀⠈⠉⠉⠉⣁⣀⡀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⣸⣿⡇⠀⠀⠀⣴⣿⣿⡿⠿⢷⣄⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠠⣤⣤⣴⣾⣿⡿⠁⠀⢀⣾⣿⣿⠏⠀⠀⠈⣿⣧⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣏⠀⠀⣠⣾⣿⣿⠏⠀⠀⠀⠀⢹⣿⡄⠀⠀ ⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠻⣿⣿⡟⠻⠿⠛⠁⠀⠀⠀⠀⠀⣾⣿⡇⠀⠀ ⠀⠀...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
386
#include <bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define vll vector<ll> #define mll map<ll, ll> #define MOD 1000000007 #define pll pair<ll, ll> constexpr ll INF = 1999999999999999997; #define fastio ios_base::sync_with_stdio(false), cin.tie(NULL...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define vll vector<ll> #define mll map<ll, ll> #define MOD 1000000007 #define pll pair<ll, ll> constexpr ll INF = 1999999999999999997; #define fastio ios_base::sync_with_stdio(false), cin.tie(NULL...
[["-", 51, 16, 31, 2, 3, 4, 0, 2, 63, 22], ["+", 51, 16, 31, 2, 3, 4, 0, 2, 63, 22]]
1
255
/* � Ashiq Uddin Pranto Department of Computer Science and Engineering BATCH 27 University Of Rajshahi,Bangladesh */ #include <bits/stdc++.h> #define ll long long #define ld long double #define FOR(x, y) for (ll i = x; i <= y; i++) #define pb(x) push_back(x) #define mp make_pair #define pii pair<int, int> #de...
/* � Ashiq Uddin Pranto Department of Computer Science and Engineering BATCH 27 University Of Rajshahi,Bangladesh */ #include <bits/stdc++.h> #define ll long long #define ld long double #define FOR(x, y) for (ll i = x; i <= y; i++) #define pb(x) push_back(x) #define mp make_pair #define pii pair<int, int> #de...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
807
#include <bits/stdc++.h> #define x first #define y second #define all(v) v.begin(), v.end() #define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end()) using namespace std; typedef long long ll; ll n, m, k, a[202020], b[202020], c[404040]; int main() { cin >> n >> m >> k; for (int i = 1; i <= n; i++) ...
#include <bits/stdc++.h> #define x first #define y second #define all(v) v.begin(), v.end() #define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end()) using namespace std; typedef long long ll; ll n, m, k, a[202020], b[202020], c[404040]; int main() { cin >> n >> m >> k; for (int i = 1; i <= n; i++) ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
199
#include <bits/stdc++.h> using namespace std; const long long N = 2e5 + 5; long long n, m, T, a[N], b[N]; int main() { cin >> n >> m >> T; for (long long i = 1; i <= n; i++) cin >> a[i]; for (long long i = 1; i <= m; i++) cin >> b[i]; long long res = 0, R = 0, Sum = 0; while (R < n && Sum + b[R + ...
#include <bits/stdc++.h> using namespace std; const long long N = 2e5 + 5; long long n, m, T, a[N], b[N]; int main() { cin >> n >> m >> T; for (long long i = 1; i <= n; i++) cin >> a[i]; for (long long i = 1; i <= m; i++) cin >> b[i]; long long res = 0, R = 0, Sum = 0; while (R < m && Sum + b[R + ...
[["-", 0, 52, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 12, 22]]
1
201
#include <bits/stdc++.h> using namespace std; #define fo(i, n) for (int i = 0; i < n; i++) #define vi vector<int> #define pb push_back #define mp make_pair #define lli long long int #define all(c) c.begin(), c.end() #define lower(c) tolower(c) #define upper(c) toupper(c) #define max(c) *max_element(c.begin(), c.end()...
#include <bits/stdc++.h> using namespace std; #define fo(i, n) for (int i = 0; i < n; i++) #define vi vector<int> #define pb push_back #define mp make_pair #define lli long long int #define all(c) c.begin(), c.end() #define lower(c) tolower(c) #define upper(c) toupper(c) #define max(c) *max_element(c.begin(), c.end()...
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13]]
1
330
import sys, re from math import ceil, floor, sqrt, pi, factorial, gcd from copy import deepcopy from collections import Counter, deque from heapq import heapify, heappop, heappush from itertools import accumulate, product, combinations, combinations_with_replacement from bisect import bisect, bisect_left, bisect_right ...
import sys, re from math import ceil, floor, sqrt, pi, factorial, gcd from copy import deepcopy from collections import Counter, deque from heapq import heapify, heappop, heappush from itertools import accumulate, product, combinations, combinations_with_replacement from bisect import bisect, bisect_left, bisect_right ...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18]]
5
441
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define REP(i, n) for (ll i = 0; i < (n); i++) #define FOR(i, a, b) for (ll i = (a); i < (b...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define REP(i, n) for (ll i = 0; i < (n); i++) #define FOR(i, a, b) for (ll i = (a); i < (b...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
433
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; vector<int> a(n + 1), b(m + 1); 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] += b[i]; } int ok = 0, ng = n + m + 1; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; vector<long long> a(n + 1), b(m + 1); 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] += b[i]; } int ok = 0, ng = n + m ...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 0, 52, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 22]]
1
226
#include "bits/stdc++.h" using namespace std; typedef long long ll; const int MOD = 1000000007; const int INF = 1001001001; const double PI = acos(-1); #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int gcd(int x, int y) { return y ? gcd(y, x % y) : x; } int main() { int n, ...
#include "bits/stdc++.h" using namespace std; typedef long long ll; const int MOD = 1000000007; const int INF = 1001001001; const double PI = acos(-1); #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) (x).begin(), (x).end() int gcd(int x, int y) { return y ? gcd(y, x % y) : x; } int main() { ll n, m...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 78]]
1
245
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m, k, ans = 0; cin >> n >> m >> k; int a[n], b[m]; rep(i, n) cin >> a[i]; rep(i, m) cin >> b[i]; long Sa[n + 1], Sb[m + 1]; Sa[0] = 0; Sb[0] = 0; rep(i, n) Sa[i + 1] = Sa[i] + a[i]; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, m, k, ans = 0; cin >> n >> m >> k; int a[n], b[m]; rep(i, n) cin >> a[i]; rep(i, m) cin >> b[i]; long Sa[n + 1], Sb[m + 1]; Sa[0] = 0; Sb[0] = 0; rep(i, n) Sa[i + 1] = Sa[i] + a[i]; ...
[["-", 75, 76, 0, 9, 0, 43, 49, 50, 51, 13], ["+", 75, 76, 0, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
251
#include <bits/stdc++.h> #include <chrono> #include <math.h> using namespace std; using ll = long long; using ld = long double; using namespace std::chrono; #define fo(i, z, n) for (int i = z; i < n; i++) #define Fo(i, z, n) for (ll i = z; i < n; i++) #define INT_BITS 32 #define mod 1000000007 #define vi vector<int> #d...
#include <bits/stdc++.h> #include <chrono> #include <math.h> using namespace std; using ll = long long; using ld = long double; using namespace std::chrono; #define fo(i, z, n) for (int i = z; i < n; i++) #define Fo(i, z, n) for (ll i = z; i < n; i++) #define INT_BITS 32 #define mod 1000000007 #define vi vector<int> #d...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
300
def judge(num): if num>n+m: return False for i in range(max(0,num-m),min(n,num)+1): if a_cumsum[i] + b_cumsum[num-i]<=k: return True return False n,m,k = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) a_cumsum = [0] b_cumsum = [0] for i in a: a_cum...
def judge(num): if num>n+m: return False for i in range(max(0,num-m),min(n,num)+1): if a_cumsum[i] + b_cumsum[num-i]<=k: return True return False n,m,k = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) a_cumsum = [0] b_cumsum = [0] for i in a: a_c...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
198
N, M, K = map(int, input().split(' ')) A_ls = [0] + list(map(int, input().split(' '))) for i in range(N): A_ls[i + 1] += A_ls[i] B_ls = [0] + list(map(int, input().split(' '))) for i in range(M): B_ls[i + 1] = B_ls[i] b_cnt, rst = M, 0 for a_cnt in range(N + 1): if A_ls[a_cnt] > K: break while...
N, M, K = map(int, input().split(' ')) A_ls = [0] + list(map(int, input().split(' '))) for i in range(N): A_ls[i + 1] += A_ls[i] B_ls = [0] + list(map(int, input().split(' '))) for i in range(M): B_ls[i + 1] += B_ls[i] b_cnt, rst = M, 0 for a_cnt in range(N + 1): if A_ls[a_cnt] > K: break while...
[["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107]]
5
167
N, M, K = map(int, input().split(' ')) A_ls = [0] + list(map(int, input().split(' '))) for i in range(len(A_ls) - 1): A_ls[i + 1] += A_ls[i] B_ls = [0] + list(map(int, input().split(' '))) for i in range(len(B_ls) - 1): B_ls[i + 1] += B_ls[i] b_cnt,result = M, 0 for a_cnt in range(N): if A_ls[a_cnt] > K: ...
N, M, K = map(int, input().split(' ')) A_ls = [0] + list(map(int, input().split(' '))) for i in range(len(A_ls) - 1): A_ls[i + 1] += A_ls[i] B_ls = [0] + list(map(int, input().split(' '))) for i in range(len(B_ls) - 1): B_ls[i + 1] += B_ls[i] b_cnt,result = M, 0 for a_cnt in range(N + 1): if A_ls[a_cnt] >...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
171
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, x, n) for (int i = x; i < (n); i++) #define ALL(c) (c).begin(), (c).end() #define pb push_back #define eb emplace_back const long long INF = 1LL << 60; // 仮想的な無限大の値; using namespace std; using ll = long long; using P = pair<int, in...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, x, n) for (int i = x; i < (n); i++) #define ALL(c) (c).begin(), (c).end() #define pb push_back #define eb emplace_back const long long INF = 1LL << 60; // 仮想的な無限大の値; using namespace std; using ll = long long; using P = pair<int, in...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
381
n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) sa=[] sma=0 for i in range(n): sma+=a[i] sa.append(sma) sb=[] smb=0 for i in range(m): smb+=b[i] sb.append(smb) import bisect lain=bisect.bisect_right(sa,k)-1 if lain<0: sm=0 else: sm=a[lain] stin=bi...
n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) sa=[] sma=0 for i in range(n): sma+=a[i] sa.append(sma) sb=[] smb=0 for i in range(m): smb+=b[i] sb.append(smb) import bisect lain=bisect.bisect_right(sa,k)-1 if lain<0: sm=0 else: sm=sa[lain] stin=b...
[["-", 8, 196, 0, 1, 0, 662, 12, 206, 51, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 206, 51, 22]]
5
266
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define st first #define nd second #define endl '\n' #define what_is(x) cerr << #x << " is " << x...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define st first #define nd second #define endl '\n' #define what_is(x) cerr << #x << " is " << x...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
292
n, m, k = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) sum_a = [0] for i in range(n): sum_a.append(sum_a[i] + a[i]) sum_b = [0] for i in range(m): sum_b.append(sum_b[i] + b[i]) a_i = 0 b_i = 0 for i in range(n+1): if sum_a[i] > k: break ...
n, m, k = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) sum_a = [0] for i in range(n): sum_a.append(sum_a[i] + a[i]) sum_b = [0] for i in range(m): sum_b.append(sum_b[i] + b[i]) a_i = 0 b_i = 0 for i in range(n+1): if sum_a[i] > k: break ...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612]]
5
230
#include <stdio.h> #define rep(i, l, r) for (int i = l; i < r; i++) typedef long long ll; ll max(ll x, ll y) { return (x > y) ? x : y; } int main() { ll n, m, k, sumA[200001], sumB[200001]; scanf("%lld%lld%lld", &n, &m, &k); ll a, b; sumA[0] = sumB[0] = 0; rep(i, 0, n) { scanf("%lld", &a); sumA[i + ...
#include <stdio.h> #define rep(i, l, r) for (int i = l; i < r; i++) typedef long long ll; ll max(ll x, ll y) { return (x > y) ? x : y; } int main() { ll n, m, k, sumA[200001], sumB[200001]; scanf("%lld%lld%lld", &n, &m, &k); ll a, b; sumA[0] = sumB[0] = 0; rep(i, 0, n) { scanf("%lld", &a); sumA[i + ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
0
241
import bisect n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) ans=0 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]) for j in range(n+1): K=k-A[j] if K<0: break else: ans=max(ans,bisect.bisect_left(B,K)+j-1) pr...
import bisect n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) ans=0 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]) for j in range(n+1): K=k-A[j] if K<0: break else: ans=max(ans,bisect.bisect_right(B,K)+j-1) p...
[["-", 0, 657, 31, 657, 31, 652, 63, 319, 319, 22], ["+", 0, 657, 31, 657, 31, 652, 63, 319, 319, 22]]
5
161
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; typedef long long ll; int main() { ll n, m, k; cin >> n >> m >> k; vector<ll> A(1, 0); vector<ll> B(1, 0); for (int i = 0; i < n; i++) { int k; cin >> k; A.emplace_back(k); } for (int i = 0; i <...
#include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; typedef long long ll; int main() { ll n, m, k; cin >> n >> m >> k; vector<ll> A(1, 0); vector<ll> B(1, 0); for (int i = 0; i < n; i++) { int k; cin >> k; A.emplace_back(k); } for (int i = 0; i <...
[["-", 0, 52, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 18], ["-", 0, 52, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 52, 8, 9, 0, 57, 64, 9, 0, 46]]
1
304
N,M,K = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) T = 0 ###Aだけなら何冊読めるか a = 0 for i in range(N): if T + A[i]> K: break T += A[i] a += 1 m = a count = a num = 0 while a >= 0 and num < M: #print(m,a,T) while num < M and K-T >= B[num]: ...
N,M,K = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) T = 0 ###Aだけなら何冊読めるか a = 0 for i in range(N): if T + A[i] > K: break T += A[i] a += 1 m = a count = a num = 0 while a >= 0 and num < M: #print(m,a,T) while num < M and K-T >= B[num]: ...
[["+", 0, 52, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 17, 110], ["+", 0, 52, 8, 196, 0, 1, 0, 677, 12, 612]]
5
161
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; #define endl '\n' void solvetask() { int n, m,...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; #define endl '\n' void solvetask() { int n, m,...
[["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47]]
1
281
n,m,k = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) for i in range(1,n): a[i] += a[i-1] for i in range(1,m): b[i] += b[i-1] a = [0]+a b = [0]+b ans = 0 ALL = 0 from bisect import bisect for i in range(1,n+1): ALL = a[i] if ALL > k: continue ...
n,m,k = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) for i in range(1,n): a[i] += a[i-1] for i in range(1,m): b[i] += b[i-1] a = [0]+a b = [0]+b ans = 0 ALL = 0 from bisect import bisect for i in range(n+1): ALL = a[i] if ALL > k: continue e...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
171
x,y,z=gets.split.map(&:to_i) A=gets.split.map(&:to_i) B=gets.split.map(&:to_i) a=b=[0] A.each do |i| a<< a[-1]+i end B.each do |i| b<< b[-1]+i end ans=0 0.upto(x) do |n| k=z-a[n] break if k<0 m=b.bsearch_index{|i|k<i} m=(m)? m-1: y ans=[ans,n+m].max end p ans
x,y,z=gets.split.map(&:to_i) A=gets.split.map(&:to_i) B=gets.split.map(&:to_i) a=*b=[0] A.each do |i| a<< a[-1]+i end B.each do |i| b<< b[-1]+i end ans=0 0.upto(x) do |n| k=z-a[n] break if k<0 m=b.bsearch_index{|i|k<i} m=(m)? m-1: y ans=[ans,n+m].max end p ans
[["+", 36, 36, 0, 493, 0, 662, 12, 741, 0, 48]]
4
142
#include <bits/stdc++.h> #define FAST_IO \ ios::sync_with_stdio(false); \ cin.tie(0); #define ll long long int #define rep(i, n) for (ll i = 0; i < (n); i++) using namespace std; ll MOD = 1000000007; bo...
#include <bits/stdc++.h> #define FAST_IO \ ios::sync_with_stdio(false); \ cin.tie(0); #define ll long long int #define rep(i, n) for (ll i = 0; i < (n); i++) using namespace std; ll MOD = 1000000007; bo...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
1,443
import typing def binary_serch(x:int, b_sum:list): l = 0 r = len(b_sum) - 1 mid = (l + r + 1) // 2 res = mid while True: if x == b_sum[mid]: return mid elif x < b_sum[mid]: res = mid - 1 r = mid mid = (l + r + 1) // 2 elif b_su...
import typing def binary_serch(x:int, b_sum:list): l = 0 r = len(b_sum) - 1 mid = (l + r + 1) // 2 res = mid while True: if x == b_sum[mid]: return mid elif x < b_sum[mid]: res = mid - 1 r = mid mid = (l + r + 1) // 2 elif b_su...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102], ["+", 0, 57, 75, 76, 8, 196, 0, 93, 0, 94]]
5
278
from itertools import groupby, accumulate, product, permutations, combinations def solve(): ans = 0 N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) A = [0]+list(accumulate(A)) B = [0]+list(accumulate(B)) b = M for a in range(N+1...
from itertools import groupby, accumulate, product, permutations, combinations def solve(): ans = 0 N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) A = [0]+list(accumulate(A)) B = [0]+list(accumulate(B)) b = M for a in range(N+1...
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 612], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
154
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<string, string> pss; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<ll> vl; typedef vector<vector<ll>> vvl; typedef vector<pii> vii; #define rep(x, n) for (in...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<string, string> pss; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<ll> vl; typedef vector<vector<ll>> vvl; typedef vector<pii> vii; #define rep(x, n) for (in...
[["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 22]]
1
478
#include <iostream> using namespace std; int a[200006], b[200006], f[200006]; int main() { int N, M, K; cin >> N >> M >> K; for (int i = 0; i < N; i++) { cin >> a[i]; } for (int i = 0; i < M; i++) { cin >> b[i]; } int u = 0, pt = 0; for (int i = 0; i < M; i++) { if (u + a[i] <= K) { u ...
#include <iostream> using namespace std; int a[200006], b[200006], f[200006]; int main() { int N, M, K; cin >> N >> M >> K; for (int i = 0; i < N; i++) { cin >> a[i]; } for (int i = 0; i < M; i++) { cin >> b[i]; } int u = 0, pt = 0; for (int i = 0; i < M; i++) { if (u + b[i] <= K) { u ...
[["-", 15, 339, 51, 16, 31, 16, 12, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 16, 12, 69, 28, 22], ["-", 64, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 69, 28, 22]]
1
275
#include <bits/stdc++.h> using namespace std; const int INF = 0x7f7f7f7f; const int N = 2e5 + 5; long long A[N] = {}, B[N] = {}; int n, m; int bs(int k) { int l = 1, r = m, mid; while (l <= r) { mid = (l + r) >> 1; if (B[mid] <= k) l = mid + 1; else r = mid - 1; } return r; } int main() ...
#include <bits/stdc++.h> using namespace std; const int INF = 0x7f7f7f7f; const int N = 2e5 + 5; long long A[N] = {}, B[N] = {}; int n, m; int bs(long long k) { int l = 1, r = m, mid; while (l <= r) { mid = (l + r) >> 1; if (B[mid] <= k) l = mid + 1; else r = mid - 1; } return r; } int m...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 49, 53, 54, 55, 0, 56, 39, 86, 0, 96], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
268
#include <bits/stdc++.h> using namespace std; //#define LOCAL #define fastIO ios::sync_with_stdio(0), cin.tie(0) #define endl '\n' #define forn(i, a, b) for (ll i = a; i <= b; i++) #define ft first #define sd second #define sz size() #define pb push_back #define pob pop_back() #define pf push_front #define pof pop_fron...
#include <bits/stdc++.h> using namespace std; //#define LOCAL #define fastIO ios::sync_with_stdio(0), cin.tie(0) #define endl '\n' #define forn(i, a, b) for (ll i = a; i <= b; i++) #define ft first #define sd second #define sz size() #define pb push_back #define pob pop_back() #define pf push_front #define pof pop_fron...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 0,...
1
309
#include <bits/stdc++.h> typedef long long int ll; using namespace std; ll a[200005], b[200005]; ll n, m, k; void solve() { cin >> n >> m >> k; ll asum = 0, bsum = 0; for (int i = 1; i <= n; i++) { int c; cin >> c; asum += c; a[i] = asum; } for (int i = 1; i <= m; i++) { int c; cin >>...
#include <bits/stdc++.h> typedef long long int ll; using namespace std; ll a[200005], b[200005]; ll n, m, k; void solve() { cin >> n >> m >> k; ll asum = 0, bsum = 0; for (int i = 1; i <= n; i++) { int c; cin >> c; asum += c; a[i] = asum; } for (int i = 1; i <= m; i++) { int c; cin >>...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
237
n, m, k = map(int, input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) for i in range(1,n): A[i] += A[i-1] for i in range(1,m): B[i] += B[i-1] A.insert(0,0) B.insert(0,0) j = m ans = 0 for i in range(m): if A[i] > k: break while B[j] > k-A[i]: j ...
n, m, k = map(int, input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) for i in range(1,n): A[i] += A[i-1] for i in range(1,m): B[i] += B[i-1] A.insert(0,0) B.insert(0,0) j = m ans = 0 for i in range(n+1): if A[i] > k: break while B[j] > k-A[i]: ...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
163
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define ri register #define inf 0x7fffffff #define E (1) #define mk make_pair #define int long long //#define double long dou...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define ri register #define inf 0x7fffffff #define E (1) #define mk make_pair #define int long long //#define double long dou...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
400
#include <limits.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 200002 typedef long long ll; ll max(ll a, ll b) { if (a > b) return a; else return b; } ll min(ll a, ll b) { if (a < b) return a; else return b; } /*qsort(array,n...
#include <limits.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 200002 typedef long long ll; ll max(ll a, ll b) { if (a > b) return a; else return b; } ll min(ll a, ll b) { if (a < b) return a; else return b; } /*qsort(array,n...
[["-", 0, 16, 12, 74, 51, 2, 3, 4, 0, 13], ["+", 0, 16, 12, 74, 51, 2, 3, 4, 0, 13]]
0
504
#include <limits.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 200002 typedef long long ll; ll max(ll a, ll b) { if (a > b) return a; else return b; } ll b_search(ll left, ll right, ll *num, ll ans) { while (right - left > 1) { ll mid ...
#include <limits.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 200002 typedef long long ll; ll max(ll a, ll b) { if (a > b) return a; else return b; } ll b_search(ll left, ll right, ll *num, ll ans) { while (right - left > 1) { ll mid ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
0
327
#include <bits/stdc++.h> #define ll long long #define F first #define S second #define scn(n) scanf("%d", &n) using namespace std; int main() { int n, m; ll k; cin >> n >> m >> k; ll arr1[n + 2] = {0}; ll arr2[m + 2] = {0}; for (int i = 1; i <= n; i++) { cin >> arr1[i]; arr1[i] += arr1[i - 1]; ...
#include <bits/stdc++.h> #define ll long long #define F first #define S second #define scn(n) scanf("%d", &n) using namespace std; int main() { int n, m; ll k; cin >> n >> m >> k; ll arr1[n + 2] = {0}; ll arr2[m + 2] = {0}; for (int i = 1; i <= n; i++) { cin >> arr1[i]; arr1[i] += arr1[i - 1]; ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
212
#include <algorithm> #include <assert.h> #include <cmath> #include <cstdio> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <unordered_map> #include <vector> #defi...
#include <algorithm> #include <assert.h> #include <cmath> #include <cstdio> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <unordered_map> #include <vector> #defi...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
1
311
from bisect import bisect_left as bl from itertools import accumulate as ac n,m,k=map(int,input().split()) a=list(ac([0]+list(map(int,input().split())))) b=list(ac([0]+list(map(int,input().split())))) l=0 for i in range(n+1): if k<a[i]: break else: l=max(l,i+bl(b,k-a[i])-1) print(l)
from bisect import bisect_right as br from itertools import accumulate as ac n,m,k=map(int,input().split()) a=list(ac([0]+list(map(int,input().split())))) b=list(ac([0]+list(map(int,input().split())))) l=0 for i in range(n+1): if k<a[i]: break else: l=max(l,i+br(b,k-a[i])-1) print(l)
[["-", 0, 656, 0, 686, 141, 704, 141, 673, 0, 22], ["+", 0, 656, 0, 686, 141, 704, 141, 673, 0, 22], ["-", 36, 36, 0, 656, 0, 686, 141, 704, 705, 22], ["+", 36, 36, 0, 656, 0, 686, 141, 704, 705, 22], ["-", 3, 4, 0, 657, 31, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 31, 657, 12, 652, 63, 22]]
5
134
N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) sum = 0 i = 0 j = 0 while (sum + A[i]) <= K: sum += A[i] i += 1 if i >= N: break while (sum + B[j]) <= K: sum += B[j] j += 1 if j >= M: break max = i + j if sum <= K: print(max) els...
N, M, K = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) sum = 0 i = 0 j = 0 while (sum + A[i]) <= K: sum += A[i] i += 1 if i >= N: break while (sum + B[j]) <= K: sum += B[j] j += 1 if j >= M: break max = i + j if max == M+N: print(max) e...
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 0, 656, 0, 57, 15, 666, 0, 657,...
5
200
#include <bits/stdc++.h> using namespace std; #define rep(i, m, n) for (int(i) = (int)(m); i < (int)(n); ++i) #define rep2(i, m, n) for (int(i) = (int)(n)-1; i >= (int)(m); --i) #define REP(i, n) rep(i, 0, n) #define REP2(i, n) rep2(i, 0, n) #define all(hoge) (hoge).begin(), (hoge).end() #define en '\n' using ll = lon...
#include <bits/stdc++.h> using namespace std; #define rep(i, m, n) for (int(i) = (int)(m); i < (int)(n); ++i) #define rep2(i, m, n) for (int(i) = (int)(n)-1; i >= (int)(m); --i) #define REP(i, n) rep(i, 0, n) #define REP2(i, n) rep2(i, 0, n) #define all(hoge) (hoge).begin(), (hoge).end() #define en '\n' using ll = lon...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 28, 22], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 17, 131], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 119, 120], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 25]]
1
1,408
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; const ll mod = 1e9 + 7; const int maxn = 200005; vector<int> a; bool cmp(const int &a, const int &b) { return abs(a) > abs(b); } ll qpow(ll a, ll b) { //快速幂 ll res = 1; while (b) { if (b & 1) res = res * a % mo...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; const ll mod = 1e9 + 7; const int maxn = 200005; vector<int> a; bool cmp(const int &a, const int &b) { return abs(a) > abs(b); } ll qpow(ll a, ll b) { //快速幂 ll res = 1; while (b) { if (b & 1) res = res * a % mo...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 18]]
1
777
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define fi first #define se second #define mp make_pair #define pb push_back #define all(v) v.begin(), v.end() using namespace std; typedef long long LL; const LL MOD = 1e9 + 7; const double PI = 2 * acos(0); bool cmp(LL x, LL y) { if (x < 0) x = -x; ...
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define fi first #define se second #define mp make_pair #define pb push_back #define all(v) v.begin(), v.end() using namespace std; typedef long long LL; const LL MOD = 1e9 + 7; const double PI = 2 * acos(0); bool cmp(LL x, LL y) { if (x < 0) x = -x; ...
[["+", 64, 9, 0, 43, 49, 50, 51, 91, 17, 33]]
1
760