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
x,y,a,b,c = map(int,input().split()) lst_r = list(map(int,input().split())) lst_g = list(map(int,input().split())) lst_n = list(map(int,input().split())) lst_r = sorted(lst_r, ascending=False)[:x] lst_g = sorted(lst_g, ascending=False)[:y] lst_all = sorted(lst_r + lst_g + lst_n, ascending=False)[:x+y] print(sum(lst_all...
x,y,a,b,c = map(int,input().split()) lst_r = list(map(int,input().split())) lst_g = list(map(int,input().split())) lst_n = list(map(int,input().split())) lst_r = sorted(lst_r, reverse=True)[:x] lst_g = sorted(lst_g, reverse=True)[:y] lst_all = sorted(lst_r + lst_g + lst_n, reverse=True)[:x+y] print(sum(lst_all))
[["-", 12, 206, 51, 652, 3, 4, 0, 653, 141, 22], ["+", 12, 206, 51, 652, 3, 4, 0, 653, 141, 22], ["-", 12, 206, 51, 652, 3, 4, 0, 653, 51, 147], ["+", 12, 206, 51, 652, 3, 4, 0, 653, 51, 146]]
5
128
X, Y, A, B, C = map(int, input().split()) *P, = map(int, input().split()) *Q, = map(int, input().split()) *R, = map(int, input().split()) P = sorted(P, reverse=True)[:X] Q = sorted(Q, reverse=True)[:-Y] print(sum(sorted(P + Q + R, reverse=True)[:-(X + Y)]))
X, Y, A, B, C = map(int, input().split()) *P, = map(int, input().split()) *Q, = map(int, input().split()) *R, = map(int, input().split()) P = sorted(P, reverse=True)[:X] Q = sorted(Q, reverse=True)[:Y] print(sum(sorted(P + Q + R, reverse=True)[:X + Y]))
[["-", 0, 662, 12, 206, 206, 663, 0, 664, 17, 33], ["-", 3, 4, 0, 206, 206, 663, 0, 664, 17, 33], ["-", 0, 206, 206, 663, 0, 664, 28, 23, 0, 24], ["-", 0, 206, 206, 663, 0, 664, 28, 23, 0, 25]]
5
126
from heapq import heappush, heappop x, y, a, b, c = map(int, input().split()) p = list(map(int, input().split())) q = list(map(int, input().split())) r = list(map(int, input().split())) hp = [] for e in p: heappush(hp, [-e, 0]) for e in q: heappush(hp, [-e, 1]) for e in r: heappush(hp, [-e, 2]) ans = 0 c...
from heapq import heappush, heappop x, y, a, b, c = map(int, input().split()) p = list(map(int, input().split())) q = list(map(int, input().split())) r = list(map(int, input().split())) hp = [] for e in p: heappush(hp, [-e, 0]) for e in q: heappush(hp, [-e, 1]) for e in r: heappush(hp, [-e, 2]) ans = 0 c...
[["-", 0, 656, 0, 1, 0, 662, 12, 634, 0, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 634, 0, 21], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 21], ["+", 0, 656, 0, 1, 0, 662, 12, 634, 0, 22]]
5
204
def main(): x, y, a, b, c = map(int, input().split()) p = list(map(int, input().split())) q = list(map(int, input().split())) r = list(map(int, input().split())) p.sort() q.sort() for i in range(-1, -x - 1, -1): r.append(p[i]) for i in range(-1, -y - 1, -1): r.append(q[i]...
def main(): x, y, a, b, c = map(int, input().split()) p = list(map(int, input().split())) q = list(map(int, input().split())) r = list(map(int, input().split())) p.sort() q.sort() for i in range(-1, -x - 1, -1): r.append(p[i]) for i in range(-1, -y - 1, -1): r.append(q[i]...
[["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 102], ["-", 0, 652, 3, 4, 0, 206, 206, 663, 0, 102]]
5
171
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC omodtimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace __gnu_pbds; using namespace std; template <typename T> using or...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC omodtimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace __gnu_pbds; using namespace std; template <typename T> using or...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 20]]
1
532
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int X, Y, A, B, C; cin >> X >> Y >> A >> B >> C; vector<ll> p(A), q(B), r(C); for (int i = 0; i < A; ++i) cin >> p[i]; for (int i = 0; i < B; ++i) cin >> q[i]; for (int i = ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); int X, Y, A, B, C; cin >> X >> Y >> A >> B >> C; vector<ll> p(A), q(B), r(C); for (int i = 0; i < A; ++i) cin >> p[i]; for (int i = 0; i < B; ++i) cin >> q[i]; for (int i = ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 51, 16, 12, 23, 0, 16, 31, 16, 31, 22], ["+", 51, 16, 12, 23, 0, 16, 31, 16, 31, 22]]
1
394
def main(): #from sys import stdin, setrecursionlimit #setrecursionlimit(10**9) #r = input() #n = int(input()) #a, b = map(int, input().split()) #s, y = input().split() #a = input().split() #a = list(map(int, input().split())) #a = [list(input().split()) for i in range(n)] #a = [...
def main(): #from sys import stdin, setrecursionlimit #setrecursionlimit(10**9) #r = input() #n = int(input()) #a, b = map(int, input().split()) #s, y = input().split() #a = input().split() #a = list(map(int, input().split())) #a = [list(input().split()) for i in range(n)] #a = [...
[["+", 0, 206, 51, 652, 3, 4, 0, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
155
X, Y, A, B, C = gets.split.map &:to_i P = gets.split.map &:to_i Q = gets.split.map &:to_i R = gets.split.map &:to_i P = P.max(X).sort Q = Q.max(Y).sort PQ = (P + Q).sort R.sort! p PQ.zip(R).map{|a, b| [a, (b || 0)].max }.inject:+
X, Y, A, B, C = gets.split.map &:to_i P = gets.split.map &:to_i Q = gets.split.map &:to_i R = gets.split.map &:to_i P = P.max(X).sort Q = Q.max(Y).sort PQ = (P + Q).sort R.sort!.reverse! p PQ.zip(R).map{|a, b| [a, (b || 0)].max }.inject:+
[["+", 36, 36, 36, 36, 0, 493, 0, 652, 17, 131], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
106
X, Y, A, B, C = map(int, input().split()) p = list(map(int, input().split())) q = list(map(int, input().split())) r = list(map(int, input().split())) p.sort(reverse=True) q.sort(reverse=True) r.sort(reverse=True) A_p = p[:X] B_q = q[:Y] C_r = r ans = A_p + B_q + C_r ans.sort(reverse=True) sum(ans[: X+Y])
X, Y, A, B, C = map(int, input().split()) p = list(map(int, input().split())) q = list(map(int, input().split())) r = list(map(int, input().split())) p.sort(reverse=True) q.sort(reverse=True) r.sort(reverse=True) A_p = p[:X] B_q = q[:Y] C_r = r ans = A_p + B_q + C_r ans.sort(reverse=True) print(sum(ans[: X+Y]))
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
139
from pprint import pprint from bisect import bisect_left import numpy def read(): X, Y, A, B, C = list(map(int, input().strip().split())) P = list(map(int, input().strip().split())) Q = list(map(int, input().strip().split())) R = list(map(int, input().strip().split())) return X, Y, A, B, C, P, Q, ...
from pprint import pprint from bisect import bisect_left import numpy def read(): X, Y, A, B, C = list(map(int, input().strip().split())) P = list(map(int, input().strip().split())) Q = list(map(int, input().strip().split())) R = list(map(int, input().strip().split())) return X, Y, A, B, C, P, Q, ...
[["-", 75, 665, 15, 679, 31, 666, 0, 206, 51, 22], ["+", 75, 665, 15, 679, 31, 666, 0, 206, 51, 22], ["-", 15, 679, 31, 666, 0, 206, 206, 657, 31, 22], ["+", 15, 679, 31, 666, 0, 206, 206, 657, 31, 22]]
5
466
X, Y, A, B, C = input().split() P = list(map(int,input().split())) Q = list(map(int,input().split())) R = list(map(int,input().split())) P.sort(reverse=True) Q.sort(reverse=True) R.sort(reverse=True) ANS_list = P[:X] ANS_list.extend(Q[:Y]) ANS_list.sort() c = 0 for i in range(len(R)): if ANS_list[i] >= R[i]: ...
X, Y, A, B, C = map(int,input().split()) P = list(map(int,input().split())) Q = list(map(int,input().split())) R = list(map(int,input().split())) P.sort(reverse=True) Q.sort(reverse=True) R.sort(reverse=True) ANS_list = P[:X] ANS_list.extend(Q[:Y]) ANS_list.sort() c = 0 for i in range(len(R)): if ANS_list[i] >= R[i]...
[["+", 0, 656, 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], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
179
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, n) for...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, n) for...
[["-", 0, 69, 341, 342, 0, 16, 31, 16, 31, 22], ["+", 0, 69, 341, 342, 0, 16, 31, 16, 31, 22]]
1
438
# coding: utf-8 X, Y, A, B, C = map(int, input().split()) P = list(map(int, input().split())) Q = list(map(int, input().split())) R = list(map(int, input().split())) P.sort(reverse=True) Q.sort(reverse=True) R.sort(reverse=False) ans = 0 L = P[:X] + Q[:Y] L.sort() idx = 0 for i in range(X+Y): if idx >= C: b...
# coding: utf-8 X, Y, A, B, C = map(int, input().split()) P = list(map(int, input().split())) Q = list(map(int, input().split())) R = list(map(int, input().split())) P.sort(reverse=True) Q.sort(reverse=True) R.sort(reverse=True) ans = 0 L = P[:X] + Q[:Y] L.sort() idx = 0 for i in range(X+Y): if idx >= C: br...
[["-", 0, 1, 0, 652, 3, 4, 0, 653, 51, 147], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 51, 146]]
5
168
x, y, a, b, c = map(int, input().split()) p = sorted(list(map(int, input().split())), reverse=True) q = sorted(list(map(int, input().split())), reverse=True) r = sorted(list(map(int, input().split())), reverse=True) p = p[:x] q = q[:x] a = p + q + r a = sorted(a, reverse=True) print(sum(a[:x+y]))
x, y, a, b, c = map(int, input().split()) p = sorted(list(map(int, input().split())), reverse=True) q = sorted(list(map(int, input().split())), reverse=True) r = sorted(list(map(int, input().split())), reverse=True) p = p[:x] q = q[:y] a = p + q + r a = sorted(a, reverse=True) print(sum(a[:(x+y)]))
[["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 22], ["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 22], ["+", 3, 4, 0, 206, 206, 663, 0, 23, 0, 24], ["+", 3, 4, 0, 206, 206, 663, 0, 23, 0, 25]]
5
138
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define ll long long #define pi acos(-1) const int w = 5e5 + 5; const ll mod = 998244353; ll a[w], b[w], c[w]; int n, m; int cmp(ll x, ll y) { return x > y; } int main() { int i, j; int x, y, z; cin >> n >> m >> x >> y >> z; for (i = 1...
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define ll long long #define pi acos(-1) const int w = 5e5 + 5; const ll mod = 998244353; ll a[w], b[w], c[w]; int n, m; int cmp(ll x, ll y) { return x > y; } int main() { int i, j; int x, y, z; cin >> n >> m >> x >> y >> z; for (i = 1...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
493
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long int ll; int main() { ll x, y, a, b, c; cin >> x >> y >> a >> b >> c; vector<ll> va(a); for (int i = 0; i < a; ++i) cin >> va[i]; vector<ll> vb(b); for (int i = 0; i < b; ++i) cin >> vb[i]; vector<ll...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long int ll; int main() { ll x, y, a, b, c; cin >> x >> y >> a >> b >> c; vector<ll> va(a); for (int i = 0; i < a; ++i) cin >> va[i]; vector<ll> vb(b); for (int i = 0; i < b; ++i) cin >> vb[i]; vector<ll...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
307
X, Y, A, B, C = [int(x) for x in input().split()] p = sorted([int(x) for x in input().split()], reverse=True)[:X] q = sorted([int(x) for x in input().split()], reverse=True)[:Y] pq = deque(sorted(p + q, reverse=True)) r = deque(sorted([int(x) for x in input().split()])) ans = sum(pq) for i in range(len(r)): if r[...
from collections import deque X, Y, A, B, C = [int(x) for x in input().split()] p = sorted([int(x) for x in input().split()], reverse=True)[:X] q = sorted([int(x) for x in input().split()], reverse=True)[:Y] pq = deque(sorted(p + q, reverse=True)) r = deque(sorted([int(x) for x in input().split()])) ans = sum(pq) fo...
[["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["+", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22]]
5
170
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define REP(i, m, n) for (int i = (m); i < (n); i++) #define rep(i, n) REP(i, 0, n) #define pb push_back #define all(a) a.begin(), a.end() #define rall(c) (c).rbegin(), (c).rend() #define mp make_pair typedef long long ll; t...
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define REP(i, m, n) for (int i = (m); i < (n); i++) #define rep(i, n) REP(i, 0, n) #define pb push_back #define all(a) a.begin(), a.end() #define rall(c) (c).rbegin(), (c).rend() #define mp make_pair typedef long long ll; t...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22]]
1
499
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, n) for (int i = (n - 1); i >= 0; --i) typedef long long ll; typedef pair<int, int> Pi; const int MAX = 200005; const int INF = 1001001001; const int MOD = 1000000007; int main() { int X, Y, A, B, C; cin...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, n) for (int i = (n - 1); i >= 0; --i) typedef long long ll; typedef pair<int, int> Pi; const int MAX = 200005; const int INF = 1001001001; const int MOD = 1000000007; int main() { int X, Y, A, B, C; cin...
[["-", 64, 9, 0, 1, 0, 11, 12, 118, 119, 120], ["+", 64, 9, 0, 1, 0, 11, 12, 118, 119, 120]]
1
348
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, b, a) for (int i = (b)-1; i >= 0; --i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = (n)-1; i >= 0; --i) #define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr) #define SORT(v) ...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, b, a) for (int i = (b)-1; i >= 0; --i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = (n)-1; i >= 0; --i) #define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr) #define SORT(v) ...
[["-", 64, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 64, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
514
#include <bits/stdc++.h> using namespace std; #define pb push_back #define F first #define S second #define mkp make_pair #define pii pair<int, int> typedef long long ll; const int inf = 0x3f3f3f3f; const int maxn = 1e5 + 5; #define int ll ll p[maxn], q[maxn], r[maxn]; set<ll> s1, s2; int32_t main() { int x, y, a, b,...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define F first #define S second #define mkp make_pair #define pii pair<int, int> typedef long long ll; const int inf = 0x3f3f3f3f; const int maxn = 1e5 + 5; #define int ll ll p[maxn], q[maxn], r[maxn]; multiset<ll> s1, s2; int32_t main() { int x, y, ...
[["-", 36, 36, 0, 30, 0, 43, 39, 344, 141, 78], ["+", 36, 36, 0, 30, 0, 43, 39, 344, 141, 78]]
1
512
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using lint = long long; void solve() { int x, y, a, b, c; std::cin >> x >> y >> a >> b >> c; std::vector<lint> ps(a), qs(b), rs(c); for (auto &p : ps) std::cin >> p; for (auto &q : qs) std::cin >> q; for (auto &r : rs) ...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using lint = long long; void solve() { int x, y, a, b, c; std::cin >> x >> y >> a >> b >> c; std::vector<lint> ps(a), qs(b), rs(c); for (auto &p : ps) std::cin >> p; for (auto &q : qs) std::cin >> q; for (auto &r : rs) ...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 8, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 70], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 73]]
1
415
"use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError( "Invalid attempt to destructure non-iterable instance.\nIn order to be iter...
"use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError( "Invalid attempt to destructure non-iterable instance.\nIn order to be iter...
[["+", 8, 556, 0, 198, 0, 200, 51, 16, 17, 106], ["+", 8, 556, 0, 198, 0, 200, 51, 16, 12, 555]]
2
857
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <initializer_list> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <stack> #include <tuple> #include <unorder...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <initializer_list> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <stack> #include <tuple> #include <unorder...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22]]
1
730
#include <bits/stdc++.h> #define ll long long #define double long double #define rep(i, n) for (int i = 0; i < (n); i++) #define REP(i, n) for (int i = 1; i <= (n); i++) #define mod (ll)(1e9 + 7) #define inf (ll)(3e18 + 7) #define pi (double)acos(-1) #define P pair<int, int> #define PiP pair<int, pair<int, int>> #defin...
#include <bits/stdc++.h> #define ll long long #define double long double #define rep(i, n) for (int i = 0; i < (n); i++) #define REP(i, n) for (int i = 1; i <= (n); i++) #define mod (ll)(1e9 + 7) #define inf (ll)(3e18 + 7) #define pi (double)acos(-1) #define P pair<int, int> #define PiP pair<int, pair<int, int>> #defin...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 12, 22]]
1
383
#include <bits/stdc++.h> using namespace std; #define dforsn(i, s, n) for (int i = int(n - 1); i >= int(s); i--) #define forsn(i, s, n) for (int i = int(s); i < int(n); i++) #define dforn(i, n) for (int i = int(n - 1); i >= 0; i--) #define forn(i, n) for (int i = 0; i < int(n); i++) #define D(a) cerr << #a << " = " <<...
#include <bits/stdc++.h> using namespace std; #define dforsn(i, s, n) for (int i = int(n - 1); i >= int(s); i--) #define forsn(i, s, n) for (int i = int(s); i < int(n); i++) #define dforn(i, n) for (int i = int(n - 1); i >= 0; i--) #define forn(i, n) for (int i = 0; i < int(n); i++) #define D(a) cerr << #a << " = " <<...
[["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78]]
1
338
x,y,a,b,c=map(int,input().split()) p,q,r=[reversed(sorted(list(map(int,input().split())))) for i in range(3)] p=p[0:x] q=q[0:y] p.append(0) q.append(0) r.append(0) s=0 i,j,k=0,0,0 for _ in range(x+y): if p[i]>=q[j] and p[i]>=r[k]: s+=p[i] i+=1 elif q[j]>=r[k]: s+=q[j] j+=1 else: s+=r[k] ...
x,y,a,b,c=map(int,input().split()) p,q,r=[list(reversed(sorted(list(map(int,input().split()))))) for i in range(3)] p=p[0:x] q=q[0:y] p.append(0) q.append(0) r.append(0) s=0 i,j,k=0,0,0 for _ in range(x+y): if p[i]>=q[j] and p[i]>=r[k]: s+=p[i] i+=1 elif q[j]>=r[k]: s+=q[j] j+=1 else: s+=r[k...
[["+", 0, 1, 0, 662, 12, 658, 8, 652, 63, 22], ["+", 0, 662, 12, 658, 8, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
181
from collections import deque X,Y,A,B,C = (int(i) for i in input().split()) P = [int(i) for i in input().split()] Q = [int(i) for i in input().split()] R = [int(i) for i in input().split()] P.sort(reverse=True) Q.sort(reverse=True) R.sort(reverse=True) P_deque = deque(P) Q_deque = deque(Q) R_deque = deque(R) red_coun...
from collections import deque X,Y,A,B,C = (int(i) for i in input().split()) P = [int(i) for i in input().split()] Q = [int(i) for i in input().split()] R = [int(i) for i in input().split()] P.sort(reverse=True) Q.sort(reverse=True) R.sort(reverse=True) P_deque = deque(P) Q_deque = deque(Q) R_deque = deque(R) red_coun...
[["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22]]
5
294
x, y, al, bl, cl = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = list(map(int, input().split())) a.sort(reverse=True) b.sort(reverse=True) c.sort(reverse=True) am = x-1 bm = y-1 cm = 0 while True: #print(am) #print(bm) #print(cm) if cm >= cl: ...
#E x, y, al, bl, cl = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = list(map(int, input().split())) a.sort(reverse=True) b.sort(reverse=True) c.sort(reverse=True) am = x-1 bm = y-1 cm = 0 while True: #print(am) #print(bm) #print(cm) if cm >= cl: ...
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 0, 656, 0, 57, 15, 666, 0, 664, 17, 33], ["+", 0, 656, 0, 57, 15, 666, 0, 664, 28, 612]]
5
380
x, y, a, b, c = map(int, input().split()) a_list = list(map(int, input().split())) a_list.sort(reverse=True) b_list = list(map(int, input().split())) b_list.sort(reverse=True) c_list = list(map(int, input().split())) c_list.sort(reverse=True) a_index =0 b_index =0 c_index = 0 count = 0 for i in range(x+y): if (a_...
x, y, a, b, c = map(int, input().split()) a_list = list(map(int, input().split())) a_list.sort(reverse=True) b_list = list(map(int, input().split())) b_list.sort(reverse=True) c_list = list(map(int, input().split())) c_list.sort(reverse=True) a_index =0 b_index =0 c_index = 0 count = 0 for i in range(x+y): if (a_...
[["-", 31, 679, 12, 23, 0, 679, 12, 666, 667, 47], ["+", 31, 679, 12, 23, 0, 679, 12, 666, 667, 20], ["-", 15, 679, 12, 23, 0, 679, 12, 666, 667, 47], ["+", 15, 679, 12, 23, 0, 679, 12, 666, 667, 20]]
5
273
#include <bits/stdc++.h> #define rep(a, b, c) for (int a = b; a <= c; a++) #define per(a, b, c) for (int a = b; a >= c; a--) #define pb push_back #define mk make_pair #define pii pair<int, int> #define fi first #define se second #define mem(a, b) memset(a, b, sizeof(a)) #define inf 0x3f3f3f3f #define ls(x) (x << 1) #de...
#include <bits/stdc++.h> #define rep(a, b, c) for (int a = b; a <= c; a++) #define per(a, b, c) for (int a = b; a >= c; a--) #define pb push_back #define mk make_pair #define pii pair<int, int> #define fi first #define se second #define mem(a, b) memset(a, b, sizeof(a)) #define inf 0x3f3f3f3f #define ls(x) (x << 1) #de...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
766
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_...
[["-", 0, 2, 3, 4, 0, 83, 0, 83, 0, 13], ["+", 0, 2, 3, 4, 0, 83, 0, 83, 0, 13]]
1
531
//{{{ #include <bits/stdc++.h> using namespace std; const string truename = "Yes"; const string falsename = "No"; struct IoSetup { IoSetup() { cin.tie(nullptr); // ios::sync_with_stdio(false); cout << fixed << setprecision(12); cerr << fixed << setprecision(12); }; } ioSetup; //{{{ rep rrep loop ...
//{{{ #include <bits/stdc++.h> using namespace std; const string truename = "Yes"; const string falsename = "No"; struct IoSetup { IoSetup() { cin.tie(nullptr); // ios::sync_with_stdio(false); cout << fixed << setprecision(12); cerr << fixed << setprecision(12); }; } ioSetup; //{{{ rep rrep loop ...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
2,663
#include <bits/stdc++.h> #define F first #define S second #define mp make_pair #define pb push_back //#define ll __int128 #define ll long long #define LEFT(a) ((a) << 1) #define RIGHT(a) (LEFT(a) + 1) #define MID(a, b) ((a + b) >> 1) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #d...
#include <bits/stdc++.h> #define F first #define S second #define mp make_pair #define pb push_back //#define ll __int128 #define ll long long #define LEFT(a) ((a) << 1) #define RIGHT(a) (LEFT(a) + 1) #define MID(a, b) ((a + b) >> 1) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #d...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
429
#include <bits/stdc++.h> #define ll long long using namespace std; ll X, Y, A, B, C, ans, a[500010], b[500010], c[500010], aa[500010], bb[500010], cc[500010]; bool cmp(ll x, ll y) { return x > y; } int main() { ll i, l, r, le, re, mid, mx; scanf("%lld%lld%lld%lld%lld", &X, &Y, &A, &B, &C); for (i = 1; i <= A;...
#include <bits/stdc++.h> #define ll long long using namespace std; ll X, Y, A, B, C, ans, a[500010], b[500010], c[500010], aa[500010], bb[500010], cc[500010]; bool cmp(ll x, ll y) { return x > y; } int main() { ll i, l, r, le, re, mid, mx; scanf("%lld%lld%lld%lld%lld", &X, &Y, &A, &B, &C); for (i = 1; i <= A;...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
1
470
#include <bits/stdc++.h> typedef long long ll; const int kN = 1e5 + 5; const int kInf = 0x3f3f3f3f; int p[kN], q[kN], r[kN]; ll ans = 0; int main() { int x, y, a, b, c; scanf("%d%d%d%d%d", &x, &y, &a, &b, &c); p[0] = q[0] = kInf; for (int i = 1; i <= a; ++i) scanf("%d", p + i); for (int i = 1; i <= b;...
#include <bits/stdc++.h> typedef long long ll; const int kN = 1e5 + 5; const int kInf = 0x3f3f3f3f; int p[kN], q[kN], r[kN]; ll ans = 0; int main() { int x, y, a, b, c; scanf("%d%d%d%d%d", &x, &y, &a, &b, &c); p[0] = q[0] = kInf; for (int i = 1; i <= a; ++i) scanf("%d", p + i); for (int i = 1; i <= b;...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19]]
1
409
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int x, y, a, b, c; cin >> x >> y >> a >> b >> c; vector<int> va(a); vector<int> vb(b); vector<int> vc(c); for (int i = 0; i < a; i++) { cin >> va[i]; } for (int i = 0; i < b; i++) { ci...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int x, y, a, b, c; cin >> x >> y >> a >> b >> c; vector<int> va(a); vector<int> vb(b); vector<int> vc(c); for (int i = 0; i < a; i++) { cin >> va[i]; } for (int i = 0; i < b; i++) { ci...
[["-", 0, 43, 49, 50, 51, 69, 341, 342, 0, 22], ["+", 0, 43, 49, 50, 51, 69, 341, 342, 0, 22]]
1
436
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int X, Y, A, B, C; cin >> X >> Y >> A >> B >> C; vector<int> p(A), q(B), r(C); for (int &t : p) cin >> t; for (int &t : q) cin >> t; for (int &t : r) cin >> t; sort(p.begin(), p.end()); sort(q.begi...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int X, Y, A, B, C; cin >> X >> Y >> A >> B >> C; vector<int> p(A), q(B), r(C); for (int &t : p) cin >> t; for (int &t : q) cin >> t; for (int &t : r) cin >> t; sort(p.begin(), p.end()); sort(q.begi...
[["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 18], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 19]]
1
350
#include <bits/stdc++.h> #include <iostream> using namespace std; const long long MAXN = 3e5 + 5; const long long MOD = 1e9 + 7; long long n; long long sz[MAXN]; long long fact[MAXN]; long long dp[MAXN]; long long dp2[MAXN]; long long invfact[MAXN]; long long inv[MAXN]; vector<long long> v1[MAXN]; void dfs(long long c...
#include <bits/stdc++.h> #include <iostream> using namespace std; const long long MAXN = 3e5 + 5; const long long MOD = 1e9 + 7; long long n; long long sz[MAXN]; long long fact[MAXN]; long long dp[MAXN]; long long dp2[MAXN]; long long invfact[MAXN]; long long inv[MAXN]; vector<long long> v1[MAXN]; void dfs(long long c...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
517
#include <stdio.h> int ta[200010], nt[400010], to[400010], cc[400010]; long long u[200010], ANS[200020], ans[200020]; int mbk(long long a, int n, int m) { return n ? (mbk((a * a) % m, n / 2, m) * (n % 2 ? a : 1)) % m : 1; } int inv(int a, int m) { return mbk((long long)a, m - 2, m); } long long pp[200010], M = 1e9 + ...
#include <stdio.h> int ta[200010], nt[400010], to[400010], cc[400010]; long long u[200010], ANS[200020], ans[200020]; int mbk(long long a, int n, int m) { return n ? (mbk((a * a) % m, n / 2, m) * (n % 2 ? a : 1)) % m : 1; } int inv(int a, int m) { return mbk((long long)a, m - 2, m); } long long pp[200010], M = 1e9 + ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
0
745
#include <bits/stdc++.h> typedef long long ll; const int mod = 1e9 + 7; const int N = 2e5 + 5; ll po(ll a, ll b) { ll ans = 1; while (b) { if (b & 1) ans = ans * a % mod; a = a * a % mod, b >>= 1; } return ans; } ll inv(ll x) { return po(x, mod - 2); } ll jc[N << 1], jcinv[N << 1]; inline ll c(ll ...
#include <bits/stdc++.h> typedef long long ll; const int mod = 1e9 + 7; const int N = 2e5 + 5; ll po(ll a, ll b) { ll ans = 1; while (b) { if (b & 1) ans = ans * a % mod; a = a * a % mod, b >>= 1; } return ans; } ll inv(ll x) { return po(x, mod - 2); } ll jc[N << 1], jcinv[N << 1]; inline ll c(ll ...
[["-", 0, 2, 3, 4, 0, 16, 31, 69, 28, 22], ["-", 3, 4, 0, 16, 31, 69, 341, 342, 0, 70], ["-", 3, 4, 0, 16, 31, 69, 341, 342, 0, 22], ["-", 3, 4, 0, 16, 31, 69, 341, 342, 0, 73], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 31, 22]]
1
651
#include <bits/stdc++.h> using namespace std; using ll = long long; using VI = vector<int>; using VL = vector<ll>; using VVI = vector<vector<int>>; using VVL = vector<vector<ll>>; using PII = std::pair<int, int>; using PLL = std::pair<ll, ll>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) fo...
#include <bits/stdc++.h> using namespace std; using ll = long long; using VI = vector<int>; using VL = vector<ll>; using VVI = vector<vector<int>>; using VVL = vector<vector<ll>>; using PII = std::pair<int, int>; using PLL = std::pair<ll, ll>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) fo...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22]]
1
1,676
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define rng(a) a.begin(), a.end() using namespace std; typedef long long int ll; typedef pair<l...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define rng(a) a.begin(), a.end() using namespace std; typedef long long int ll; typedef pair<l...
[["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
1,386
#include <bits/stdc++.h> #define be(v) (v).begin(), (v).end() #define pb(q) push_back(q) typedef long long ll; using namespace std; const ll mod = 1000000007, N = 200001; #define doublecout(a) cout << fixed << setprecision(10) << a << endl; ll fac[N], finv[N], inv[N]; void cominit() { fac[0] = fac[1] = 1; finv[0] ...
#include <bits/stdc++.h> #define be(v) (v).begin(), (v).end() #define pb(q) push_back(q) typedef long long ll; using namespace std; const ll mod = 1000000007, N = 200001; #define doublecout(a) cout << fixed << setprecision(10) << a << endl; ll fac[N], finv[N], inv[N]; void cominit() { fac[0] = fac[1] = 1; finv[0] ...
[["-", 31, 23, 0, 69, 341, 342, 0, 69, 28, 22], ["-", 0, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["-", 0, 69, 341, 342, 0, 69, 341, 342, 0, 22], ["-", 0, 69, 341, 342, 0, 69, 341, 342, 0, 73], ["+", 0, 11, 31, 23, 0, 69, 341, 342, 0, 22]]
1
922
import sys sys.setrecursionlimit(10**12) def modinv(a,m=10**9+7): if a==0: return 1 else: b=m (x, lastx) = (0, 1) (y, lasty) = (1, 0) while b != 0: q = a // b (a, b) = (b, a % b) (x, lastx) = (lastx - q * x, x) (y, lasty) = (lasty ...
import sys sys.setrecursionlimit(10**7) def modinv(a,m=10**9+7): if a==0: return 1 else: b=m (x, lastx) = (0, 1) (y, lasty) = (1, 0) while b != 0: q = a // b (a, b) = (b, a % b) (x, lastx) = (lastx - q * x, x) (y, lasty) = (lasty -...
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
397
import sys reader = (s.rstrip() for s in sys.stdin) input = reader.__next__ mod = 10**9+7 class PERM_COMB_MOD(): def __init__(self, max_n=510000, mod=10**9+7): self.fac = [0]*max_n self.finv = [0]*max_n self.inv = [0]*max_n self.fac[0] = self.fac[1] = 1 self.finv[0] = self....
import sys reader = (s.rstrip() for s in sys.stdin) input = reader.__next__ mod = 10**9+7 class PERM_COMB_MOD(): def __init__(self, max_n=510000, mod=10**9+7): self.fac = [0]*max_n self.finv = [0]*max_n self.inv = [0]*max_n self.fac[0] = self.fac[1] = 1 self.finv[0] = self....
[["-", 8, 196, 0, 1, 0, 662, 31, 206, 206, 22], ["+", 8, 196, 0, 1, 0, 662, 31, 206, 206, 22]]
5
782
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef tree<ll, null_typ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; typedef tree<ll, null_typ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
1,026
//#include "pch.h" #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include...
//#include "pch.h" #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include...
[["+", 0, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 0, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 0, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 9, 0, 1, 0, 35]]
1
660
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> ...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
612
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using ll = long long; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define repeat(i, j, k) for (int i = (j); i < (int)(k); i++) #define all(v) v.begin(), v.end() #define debug(x) cerr << #x << " : " << x << endl template <class T> bool ...
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using ll = long long; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define repeat(i, j, k) for (int i = (j); i < (int)(k); i++) #define all(v) v.begin(), v.end() #define debug(x) cerr << #x << " : " << x << endl template <class T> bool ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
562
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #includ...
[["-", 0, 57, 15, 339, 51, 16, 31, 91, 17, 111], ["+", 0, 57, 15, 339, 51, 16, 12, 91, 17, 111], ["+", 0, 57, 15, 339, 51, 16, 31, 91, 17, 111], ["-", 0, 57, 15, 339, 51, 16, 12, 91, 17, 111]]
1
742
#ifndef DEBUG #define NDEBUG #endif #include <algorithm> #include <cassert> #include <iostream> #include <iterator> #include <limits> #include <numeric> #include <set> #include <string> #include <type_traits> #include <utility> #include <vector> using namespace std; // template {{{ // misc {{{ using Z = long long; [[...
#ifndef DEBUG #define NDEBUG #endif #include <algorithm> #include <cassert> #include <iostream> #include <iterator> #include <limits> #include <numeric> #include <set> #include <string> #include <type_traits> #include <utility> #include <vector> using namespace std; // template {{{ // misc {{{ using Z = long long; [[...
[["-", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78]]
1
932
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll i = 0; i < (ll)n; i++) #define dump(x) \ cerr << "Line " << __LINE__ << ": " << #x << " = " << (x) << "\n"; #define spa << " " << #define fi first #define se second #define ALL(a) (a...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll i = 0; i < (ll)n; i++) #define dump(x) \ cerr << "Line " << __LINE__ << ": " << #x << " = " << (x) << "\n"; #define spa << " " << #define fi first #define se second #define ALL(a) (a...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 49, 50, 51, 218, 8, 9, 0, 37, 0, 22], ["+", 49, 50, 51, 218, 8, 9, 0, 37, 0, 22]]
1
2,110
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back using ll = long long; using namespace std; const ll MAX = 200200; const ll MOD = 1000000007; ll fac[MAX], finv[MAX], inv[MAX]; // 前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (ll i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back using ll = long long; using namespace std; const ll MAX = 200200; const ll MOD = 1000000007; ll fac[MAX], finv[MAX], inv[MAX]; // 前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (ll i...
[["-", 0, 338, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 338, 8, 9, 0, 1, 0, 11, 17, 32]]
1
633
#include <bits/stdc++.h> using namespace std; template <typename T> void print(T t) { cout << t << endl; } template <typename T, typename... Args> void print(T t, Args... args) { cout << t << " "; print(args...); } #define IOS \ ios::sync_with_s...
#include <bits/stdc++.h> using namespace std; template <typename T> void print(T t) { cout << t << endl; } template <typename T, typename... Args> void print(T t, Args... args) { cout << t << " "; print(args...); } #define IOS \ ios::sync_with_s...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 13]]
1
791
#include <bits/stdc++.h> using namespace std; #define __ << " " << #define ___ << " " #define bash push_back #define ALL(x) x.begin(), x.end() //#define int long long struct IoSetup { IoSetup() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10); cerr << fixed << setprecision(...
#include <bits/stdc++.h> using namespace std; #define __ << " " << #define ___ << " " #define bash push_back #define ALL(x) x.begin(), x.end() //#define int long long struct IoSetup { IoSetup() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10); cerr << fixed << setprecision(...
[["+", 3, 4, 0, 69, 341, 342, 0, 16, 17, 72], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13]]
1
2,057
#%% import sys sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python import math from collections import deque #heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone #import fractions#古いatcoderコンテストの場合GCDなどはここからimportする from functools import lru_cache#pypyでもうごく #@lru_cache(maxsize = None)#maxsizeは保存するデータ数の...
#%% import sys sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python import math from collections import deque #heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone #import fractions#古いatcoderコンテストの場合GCDなどはここからimportする from functools import lru_cache#pypyでもうごく #@lru_cache(maxsize = None)#maxsizeは保存するデータ数の...
[["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
1,885
#%% import sys sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python import math #heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone #import fractions#古いatcoderコンテストの場合GCDなどはここからimportする from functools import lru_cache#pypyでもうごく #@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率 def input(): ...
#%% import sys sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python import math #heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone #import fractions#古いatcoderコンテストの場合GCDなどはここからimportする from functools import lru_cache#pypyでもうごく #@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率 def input(): ...
[["+", 0, 1, 0, 677, 12, 657, 12, 319, 500, 22], ["+", 0, 1, 0, 677, 12, 657, 12, 319, 0, 131]]
5
1,384
package main import ( "fmt" ) func main(){ var n, m int fmt.Scanf("%d:%d", &n, &m); ans := n * (n - 1) / 2 + m * (m - 1) fmt.Println(ans) }
package main import ( "fmt" ) func main(){ var n, m int fmt.Scanf("%d %d", &n, &m); ans := n * (n - 1) / 2 + m * (m - 1) / 2 fmt.Println(ans) }
[["+", 0, 431, 12, 432, 0, 16, 12, 16, 17, 85], ["+", 0, 431, 12, 432, 0, 16, 12, 16, 12, 433]]
7
66
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int e, o; e = n * (n - 1) / 2; o = m * (m - 1) / 2; cout << e + m << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int e, o; e = n * (n - 1) / 2; o = m * (m - 1) / 2; cout << e + o << endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
63
#include <stdio.h> int main(void) { int N, M; scanf("%d %d", &N, &M); printf("%d", ((N * (N - 1)) / 1 * 2) + ((M * (M - 1)) / 1 * 2)); // Your code here! }
#include <stdio.h> int main(void) { int N, M; scanf("%d %d", &N, &M); printf("%d", ((N * (N - 1)) / 2) + ((M * (M - 1)) / 2)); // Your code here! }
[["-", 0, 16, 31, 23, 0, 16, 31, 16, 12, 13], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 17, 48], ["-", 0, 16, 12, 23, 0, 16, 31, 16, 12, 13], ["-", 3, 4, 0, 16, 12, 23, 0, 16, 17, 48]]
0
67
N,M = map(int,input().split()) print(N*(N-1)//2 - M*(M-1)//2)
N,M = map(int,input().split()) print(N*(N-1)//2 + M*(M-1)//2)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]]
5
38
#include <iostream> using namespace std; int Func(int m) { return m * m - 1 / 2; } int main() { int N, M; cin >> N >> M; cout << Func(N) + Func(M) << endl; }
#include <iostream> using namespace std; int Func(int m) { return m * (m - 1) / 2; } int main() { int N, M; cin >> N >> M; cout << Func(N) + Func(M) << endl; }
[["+", 0, 37, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 0, 37, 0, 16, 31, 16, 12, 23, 0, 25]]
1
54
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(); int ans = N * (N - 1) + M * (M - 1) / 2; System.out.println(ans); } }
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(); int ans = N * (N - 1) / 2 + M * (M - 1) / 2; System.out.println(ans); } }
[["+", 0, 503, 49, 200, 51, 16, 31, 16, 17, 85], ["+", 0, 503, 49, 200, 51, 16, 31, 16, 12, 499]]
3
83
n, m = map(int, input().split()) a = n * (n - 1) // 2 b = m*(m-1)//2 print(a*b)
n, m = map(int, input().split()) a = n * (n - 1) // 2 b = m*(m-1)// 2 print(a + b)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 48], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]]
5
44
a,b = map(int,input().split()) if (a != 0) and (b != 0): print(str(int(a*(a-1)/2 + b*(b-1)/2))) elif (a == 0) and (b == 0): print("0") elif (a == 0) and (b != 0): print(str(int(b*(b-1)/2))) else: print(str(inr(a*(a-1)/2)))
a,b = map(int,input().split()) if (a != 0) and (b != 0): print(str(int(a*(a-1)/2 + b*(b-1)/2))) elif (a == 0) and (b == 0): print("0") elif (a == 0) and (b != 0): print(str(int(b*(b-1)/2))) else: print(str(int(a*(a-1)/2)))
[["-", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22]]
5
127
n,m=map(int,input().split()) print((n*(n-1)//2)*(m*(m-1)//2))
n,m=map(int,input().split()) print((n*(n-1)//2)+(m*(m-1)//2))
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 48], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]]
5
42
/* author : nishi5451 created: 11.08.2020 22:50:52 */ #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) + m * (m - 1) << endl; return 0; }
/* author : nishi5451 created: 11.08.2020 22:50:52 */ #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl; return 0; }
[["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 85], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 17, 85], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 12, 13]]
1
60
#include <iostream> using namespace std; int main() { int n, m; int ans = 0; cin >> n >> m; if (n != 0) ans += n * (n - 1) / 2; if (m != 0) ans += m * (n - 1) / 2; cout << ans << endl; }
#include <iostream> using namespace std; int main() { int n, m; int ans = 0; cin >> n >> m; if (n != 0) ans += n * (n - 1) / 2; if (m != 0) ans += m * (m - 1) / 2; cout << ans << endl; }
[["-", 12, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 31, 22]]
1
70
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define F first #define S second #define pii pair<int, int> #define pll pair<ll, ll> #define pcc pair<char, char> #define vi vector<int> #define vl vector<ll> #define sd(x) scanf("%d", &x) #define slld(x) scanf("%lld", &x) #define p...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define F first #define S second #define pii pair<int, int> #define pll pair<ll, ll> #define pcc pair<char, char> #define vi vector<int> #define vl vector<ll> #define sd(x) scanf("%d", &x) #define slld(x) scanf("%lld", &x) #define p...
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22]]
1
842
#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 2e5 + 7; const LL MOD = 1e9 + 7; LL f[N], g[N], fac[N], inv[N]; vector<int> p[N]; int sz[N], n; LL qpow(LL x, LL y) { LL z = 1; while (y) { if (y & 1) z = z * x % MOD; x = x * x % MOD; y /= 2; } return z; } voi...
#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 2e5 + 7; const LL MOD = 1e9 + 7; LL f[N], g[N], fac[N], inv[N]; vector<int> p[N]; int sz[N], n; LL qpow(LL x, LL y) { LL z = 1; while (y) { if (y & 1) z = z * x % MOD; x = x * x % MOD; y /= 2; } return z; } voi...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["+", 31, 16, 31, 16, 12, 69, 341, 342, 0, 22]]
1
714
#include <cstdio> #include <vector> using namespace std; #define MOD 1000000007 vector<int> e[200010]; int N, a, b, f[200010], g[200010], s[200010], ans[200010]; long long fact[200010], inv[200010]; long long power(long long x, int y) { long long ans = 1; while (y) { if (y & 1) { ans = ans * x % MOD; ...
#include <cstdio> #include <vector> using namespace std; #define MOD 1000000007 vector<int> e[200010]; int N, a, b, f[200010], g[200010], s[200010], ans[200010]; long long fact[200010], inv[200010]; long long power(long long x, int y) { long long ans = 1; while (y) { if (y & 1) { ans = ans * x % MOD; ...
[["+", 31, 16, 31, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 31, 16, 31, 16, 31, 16, 31, 74, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
665
// pragma //#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define YOU using #define DONT namespace #define SAY std YOU DONT SAY; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ll, int> pli; type...
// pragma //#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define YOU using #define DONT namespace #define SAY std YOU DONT SAY; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ll, int> pli; type...
[["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["+", 51, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
1,101
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect from operator import itemgetter #from heapq import heappush, heappop #import numpy as np #from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson #from scipy.sparse import csr_ma...
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect from operator import itemgetter #from heapq import heappush, heappop #import numpy as np #from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson #from scipy.sparse import csr_ma...
[["-", 0, 652, 3, 4, 0, 657, 12, 657, 17, 48], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 676]]
5
167
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cout << ((n * n - 1) / 2) + ((m * m - 1) / 2); }
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cout << (n * (n - 1) / 2) + (m * (m - 1) / 2); }
[["-", 12, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["-", 0, 1, 0, 16, 12, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 16, 12, 23, 0, 24]]
1
49
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() using namespace std; typedef long long ll; typedef vector<ll> dlist; typedef vector<dlist> matrix; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t, n, m; cin >> n >> m; cout << (n * (n + 1)) / 2 + (m * (m + 1)) / 2 << "\n"; retur...
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() using namespace std; typedef long long ll; typedef vector<ll> dlist; typedef vector<dlist> matrix; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t, n, m; cin >> n >> m; cout << ((n * (n - 1)) / 2) + (m * (m - 1)) / 2 << "\n"; ret...
[["+", 12, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]]
1
98
n,m= map(int, input().split()) print(((n+(n-1))+m(m-1))/2)
n,m= map(int, input().split()) print(int(((n*(n-1))+m*(m-1))/2))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 657, 31, 23, 0, 657, 31, 23, 0, 24], ["-", 31, 23, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 31, 23, 0, 657, 31, 23, 0, 657, 17, 48], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 17, 48], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
39
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; int a = N * (N + 1) / 2; int b = M * (M + 1) / 2; cout << a + b << endl; }
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; int a = N * (N - 1) / 2; int b = M * (M - 1) / 2; cout << a + b << endl; }
[["-", 51, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
57
#include <iostream> using namespace std; int main() { int n, m; scanf("%d %d", n, m); printf("%d", n * (n - 1) / 2 + m * (m - 1) / 2); }
#include <iostream> using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); printf("%d", n * (n - 1) / 2 + m * (m - 1) / 2); }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
1
55
#include <bits/stdc++.h> using namespace std; int main(void) { long long n, m; cin >> n >> m; cout << n * (n - 1) + m * (m - 1); return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { long long n, m; cin >> n >> m; cout << (n * (n - 1) + m * (m - 1)) / 2; return 0; }
[["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]]
1
46
def main(): N, M = map(int, input().split()) e = N*(N-1)/2 o = M*(M-1)/2 ans = int(e + o) print(e, o, ans) if __name__ == '__main__': main()
def main(): N, M = map(int, input().split()) e = N*(N-1)/2 o = M*(M-1)/2 ans = int(e + o) print(ans) if __name__ == '__main__': main()
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21]]
5
69
N , M = map(int,input().split()) ans += N * (N - 1) / 2 ans += M * (M - 1) / 2 print( ans )
N , M = map(int,input().split()) ans = 0 ans += N * (N - 1) // 2 ans += M * (M - 1) // 2 print( ans )
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22], ["-", 0, 656, 0, 1, 0, 677, 12, 657, 17, 85], ["+", 0, 656, 0, 1, 0, 677, 12, 657, 17, 676]]
5
42
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int mama = N * (N - 1) / 2; int papa = M * (N - 1) / 2; cout << mama + papa << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int mama = N * (N - 1) / 2; int papa = M * (M - 1) / 2; cout << mama + papa << endl; }
[["-", 51, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 31, 22]]
1
57
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; sum = N * (N - 1) + M * (M - 1); cout << sum; }
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; int sum = 0; sum = N * (N - 1) / 2 + M * (M - 1) / 2; cout << sum; }
[["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 85], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 13]]
1
50
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <bitset> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector>...
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <bitset> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector>...
[["-", 12, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 31, 22]]
1
406
N, M = map(int, readline().split()) print(N * (N - 1) / 2 + M * (M - 1) /2)
N, M = map(int, input().split()) print(int(N * (N - 1) / 2 + M * (M - 1) /2))
[["-", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22], ["+", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
38
def main(): n,m = map(int,input().split()) print(n + (n - 1) / 2 + m * (m - 1) / 2) main()
def main(): n,m = map(int,input().split()) print(n * (n - 1) // 2 + m * (m - 1) // 2) main()
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 657, 31, 657, 17, 48], ["-", 3, 4, 0, 657, 31, 657, 12, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 676], ["-", 0, 652, 3, 4, 0, 657, 12, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 676]]
5
46
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); printf("%d %d\n", n * (n - 1) / 2 + m * (m - 1) / 2); return 0; }
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); printf("%d\n", n * (n - 1) / 2 + m * (m - 1) / 2); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
57
n,m=map(input().split()) a=n*(n-1)/2+m*(m-1)/2 print(str(a))
n,m=map(int, input().split()) a=n*(n-1)/2+m*(m-1)/2 print(str(int(a)))
[["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
42
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; cout << (n + m) * (n + m - 1) - n * m << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; cout << (n + m) * (n + m - 1) / 2 - n * m << endl; return 0; }
[["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 85], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13]]
1
48
#include <stdio.h> int main(void) { int n, m; scanf("%d %d", &n, &m); n = (n * n - 1) / 2; m = (m * m - 1) / 2; n = n + m; printf("%d\n", n); return 0; }
#include <stdio.h> int main(void) { int n, m; scanf("%d %d", &n, &m); n = (n * (n - 1)) / 2; m = (m * (m - 1)) / 2; n = n + m; printf("%d\n", n); return 0; }
[["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25]]
0
70
// CODING ME ACCHHA KARNEKA HAI TERKO TO BAS PRACTICE KARTE REH #include <bits/stdc++.h> #define pragma using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define aisort sort(a, a + n) #define adsort sort(a, a + n, greater<ll>()) #define PI 2 * acos(0) typedef p...
// CODING ME ACCHHA KARNEKA HAI TERKO TO BAS PRACTICE KARTE REH #include <bits/stdc++.h> #define pragma using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define aisort sort(a, a + n) #define adsort sort(a, a + n, greater<ll>()) #define PI 2 * acos(0) typedef p...
[["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33]]
1
413
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) * m * (m - 1) / 2 << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl; }
[["-", 31, 16, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 85], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72]]
1
59
#include <stdio.h> int main(void) { int N; int M; scanf("%d", N); scanf("%d", M); int cnt_a = 0; int cnt_b = 0; cnt_a = (N * (N - 1)) / 2; cnt_b = (M * (M - 1)) / 2; int sum = cnt_a + cnt_b; printf("%d\n", sum); return 0; }
#include <stdio.h> int main(void) { int N; int M; scanf("%d", &N); scanf("%d", &M); int cnt_a = 0; int cnt_b = 0; cnt_a = (N * (N - 1)) / 2; cnt_b = (M * (M - 1)) / 2; int sum = cnt_a + cnt_b; printf("%d\n", sum); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
91
n,m=map(int,input().split()) print(int((n*(n-1)/2 + m*(m-1)*2)))
n,m=map(int,input().split()) print(int((n*(n-1)/2 + m*(m-1)/2)))
[["-", 3, 4, 0, 23, 0, 657, 12, 657, 17, 48], ["+", 3, 4, 0, 23, 0, 657, 12, 657, 17, 85]]
5
43
N,M = map(int, input().split()) print(N*(N-1)+M*(M-1)//2)
N,M = map(int, input().split()) print((N*(N-1)+M*(M-1))//2)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 657, 12, 23, 0, 25]]
5
36
n,m = map(int,input().split()) print(n*(n+1)/2+m*(m+1)/2)
n,m = map(int,input().split()) print(int(n*(n-1)/2+m*(m-1)/2))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 31, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 31, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["-", 12, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 2...
5
38
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <vector> using namespace std; // BEGIN NO SAD #define rep(i, a, b) for (int i = a; i < (b); +...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <vector> using namespace std; // BEGIN NO SAD #define rep(i, a, b) for (int i = a; i < (b); +...
[["-", 0, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 0, 16, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 12, 23, 0, 16, 17, 33]]
1
217
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); System.out.println((n * n - 1) / 2 + (m * m - 1) / 2); scan.close(); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int m = scan.nextInt(); System.out.println(n * (n - 1) / 2 + m * (m - 1) / 2); scan.close(); } }
[["-", 3, 4, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 16, 12, 23, 0, 24], ["-", 3, 4, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 16, 31, 16, 12, 23, 0, 24]]
3
86
N,M = map(int,input().split()) ans = (N+M)*(N+M+1)//2 - N*M print(ans)
N,M = map(int,input().split()) ans = (N+M)*(N+M-1)//2 - N*M print(ans)
[["-", 31, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 31, 657, 31, 657, 12, 23, 0, 657, 17, 33]]
5
41