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 <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <numeric> #incl...
#include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <math.h> #include <numeric> #incl...
[["-", 31, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 17, 33]]
1
1,878
#include <stdio.h> int main() { int m, n; scanf("%d", &m, &n); printf("%d", (m * (m - 1) + n * (n - 1)) / 2); return 0; }
#include <stdio.h> int main() { int m, n; scanf("%d%d", &m, &n); printf("%d", (m * (m - 1) + n * (n - 1)) / 2); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
56
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, 657, 31, 657, 31, 657, 17, 48], ["-", 31, 657, 31, 652, 3, 4, 0, 657, 17, 72], ["+", 31, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 17, 48], ["-", 12, 657, 31, 652, 3, 4, 0, 657, 17, 72], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 17, 33]]
5
39
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << N * (N - 1) + M * (M - 1) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << N * (N - 1) / 2 + M * (M - 1) / 2 << endl; }
[["+", 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
43
#include <bits/stdc++.h> using namespace std; using ll = long long; using vb = vector<bool>; using vvb = vector<vb>; using vd = vector<double>; using vvd = vector<vd>; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; using pii = pair<int, int>; using pll = pair<ll, ll>; usi...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vb = vector<bool>; using vvb = vector<vb>; using vd = vector<double>; using vvd = vector<vd>; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; using pii = pair<int, int>; using pll = pair<ll, ll>; usi...
[["-", 0, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
792
n, m = gets.split.map(&:to_i) puts = n*(n-1) / 2 + m*(m-1) / 2
n, m = gets.split.map(&:to_i) puts n*(n-1) / 2 + m*(m-1) / 2
[["-", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32]]
4
34
#include <bits/stdc++.h> using namespace std; using str = string; using ll = long long; #define REP(i, n) for (int i = 0; i < int(n); i++) #define RREP(i, n) for (int i = int(n) - 1; i >= 0; i--) #define FOR(i, f, t) for (int i = int(f); i <= int(t); i++) #define RFOR(i, f, t) for (int i = int(f); i >= int(t); i--) #de...
#include <bits/stdc++.h> using namespace std; using str = string; using ll = long long; #define REP(i, n) for (int i = 0; i < int(n); i++) #define RREP(i, n) for (int i = int(n) - 1; i >= 0; i--) #define FOR(i, f, t) for (int i = int(f); i <= int(t); i++) #define RFOR(i, f, t) for (int i = int(f); i >= int(t); i--) #de...
[["+", 0, 1, 0, 16, 12, 16, 31, 16, 17, 85], ["+", 0, 1, 0, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 12, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 12, 16, 12, 16, 12, 13]]
1
148
N,M=map(int,input().split()) print(N*(N-1)+M*(M-1))
N,M=map(int,input().split()) print(N*(N-1)//2+M*(M-1)//2)
[["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 676], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 612], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 676], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 12, 612]]
5
34
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int a = N * (N - 1); int b = M * (M - 1); cout << a + b << endl; }
#include <bits/stdc++.h> 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; }
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
53
a = list(map(int, input().split())) def a1(): if a[0] == 1 or a[0] == 0: a[0] = 1 return a[0] else: return a[0] * (a[0] - 1) / 2 def b1(): if a[1] == 1 or a[1] == 0: a[1] = 1 return a[1] else: return a[1] * (a[1] - 1) / 2 print(a1() + b1())
a = list(map(int, input().split())) def a1(): if a[0] == 1 or a[0] == 0: a[0] = 0 return a[0] else: return a[0] * (a[0] - 1) / 2 def b1(): if a[1] == 1 or a[1] == 0: a[1] = 0 return a[1] else: return a[1] * (a[1] - 1) / 2 print(int(a1() + b1()))
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 25]]
5
125
N,M=input().split( ) N=int(N) M=int(M) M2=(M*(M-1))/2 #MC2 N2=(N*(N-1))/2 A=M2+N2 A=int(A)
N,M=input().split( ) N=int(N) M=int(M) M2=(M*(M-1))/2 #MC2 N2=(N*(N-1))/2 A=M2+N2 A=int(A) print(A)
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
61
#include <iostream> using namespace std; int main(void) { int N, M; int ans; cin >> N >> M; ans = N + M * (N + M - 1) / 2; ans -= N * M; cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main(void) { int N, M; int ans; cin >> N >> M; ans = (N + M) * (N + M - 1) / 2; ans -= N * M; cout << ans << endl; return 0; }
[["+", 0, 11, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 16, 31, 23, 0, 25]]
1
58
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int M = in.nextInt(); int S = N * (N - 1) + M * (M - 1); System.out.print(S); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int M = in.nextInt(); int S = N * (N - 1) / 2 + M * (M - 1) / 2; System.out.print(S); } }
[["+", 0, 503, 49, 200, 51, 16, 31, 16, 17, 85], ["+", 0, 503, 49, 200, 51, 16, 31, 16, 12, 499], ["+", 0, 503, 49, 200, 51, 16, 12, 16, 17, 85], ["+", 0, 503, 49, 200, 51, 16, 12, 16, 12, 499]]
3
81
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define int long long #define pb push_back #define ins insert #define rs resize #define br break; #define cont continue; #define vi vector<int> #d...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define int long long #define pb push_back #define ins insert #define rs resize #define br break; #define cont continue; #define vi vector<int> #d...
[["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33]]
1
285
def main(): import sys input = sys.stdin.buffer.readline n, m = map(int, input().split()) print(int(n*(n-1)/2 + m(m-1)/2)) if __name__ == '__main__': main()
def main(): import sys input = sys.stdin.buffer.readline n, m = map(int, input().split()) print(int(n*(n-1)/2 + m*(m-1)/2)) if __name__ == '__main__': main()
[["+", 3, 4, 0, 657, 12, 657, 31, 657, 17, 48]]
5
66
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #include <iostream> #include <stdio.h> using namespace std; int main() { int n, m; cin >> n, m; int ans = (n * (n - 1) + m * (m - 1)) / 4; cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #include <iostream> #include <stdio.h> using namespace std; int main() { int n, m; cin >> n >> m; int ans = (n * (n - 1) + m * (m - 1)) / 2; cout << ans << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 34, 0, 21], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
67
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; cout << a * (a + 1) / 2 + b * (b + 1) / 2 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; cout << a * (a - 1) / 2 + b * (b - 1) / 2 << endl; }
[["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
47
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; int ans = (n * (n + 1) + m * (m + 1)) / 2; cout << ans << endl; return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; int ans = (n * (n - 1) + m * (m - 1)) / 2; cout << ans << endl; return 0; }
[["-", 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
65
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; int main() { ll n, m, ans; cin >> n >> m; // ans = 0; ans = n * (n - 1) / 2 + m * (m - 1) * 2; cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; int main() { ll n, m, ans; cin >> n >> m; // ans = 0; ans = n * (n - 1) / 2 + m * (m - 1) / 2; cout << ans << endl; }
[["-", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 85]]
1
62
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (N * (N + 1) / 2) + (M * (M + 1) / 2) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (N * (N - 1) / 2) + (M * (M - 1) / 2) << endl; }
[["-", 0, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
51
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define endl '\n' #define ll long long const int N = 2e5 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); if (fopen(".INP", "r")) { freopen(".INP", "r", stdin); freopen(".OUT", "w", stdout); } l...
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define endl '\n' #define ll long long const int N = 2e5 + 5; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); if (fopen(".INP", "r")) { freopen(".INP", "r", stdin); freopen(".OUT", "w", stdout); } l...
[["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
124
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) + m * (m - 1) << endl; return 0; }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; cout << (n * (n - 1) + m * (m - 1)) / 2 << endl; return 0; }
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
46
#include <bits/stdc++.h> typedef long long ll; const int INF = 1e9; const int MOD = 1e9 + 7; using namespace std; //ループマクロ #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; 0 <= i; i--) #define ROP(i, n) for (int i = 1; i <= n; i++) /...
#include <bits/stdc++.h> typedef long long ll; const int INF = 1e9; const int MOD = 1e9 + 7; using namespace std; //ループマクロ #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; 0 <= i; i--) #define ROP(i, n) for (int i = 1; i <= n; i++) /...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 13]]
1
178
n,m = 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, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21]]
5
40
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << N * (N - 1) + M * (M - 1) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (N * (N - 1) + M * (M - 1)) / 2 << endl; }
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
43
N, M = list(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))
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
41
n, m = map(int, input().split()) if n == 1 and m == 1: ans = 0 elif n >= 2 and m == 0: ans = 1/2 * n * (n-1) elif n == 0 and m >= 2: ans = 1/2 * n * (n-1) else: ans =1/2*(n*(n-1)+m*(m-1)) print(int(ans))
n, m = map(int, input().split()) if n == 1 and m == 1: ans = 0 elif n >= 2 and m == 0: ans = 1/2 * n * (n-1) elif n == 0 and m >= 2: ans = 1/2 * m * (m-1) else: ans =1/2*(n*(n-1)+m*(m-1)) print(int(ans))
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22]]
5
104
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(); if (N == 1 && M == 1) { System.out.println(0); } else { System.out.println((N * N - 1 / 2) + (M * M - 1 / 2)); } s...
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(); if (N == 1 && M == 1) { System.out.println(0); } else { System.out.println((N * (N - 1) / 2) + (M * (M - 1) / 2)); } ...
[["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 25], ["+", 12, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 16, 12, 23, 0, 25]]
3
110
#include <bits/stdc++.h> #include <cmath> using namespace std; int main() { int N, M; cin >> N >> M; cout << N * (N - 1) + M * (M - 1); }
#include <bits/stdc++.h> #include <cmath> using namespace std; int main() { int N, M; cin >> N >> M; cout << (N * (N - 1) + M * (M - 1)) / 2; }
[["+", 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
43
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N, M; cout << N * (N - 1) / 2 + M * (M - 1) / 2 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << N * (N - 1) / 2 + M * (M - 1) / 2 << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 34, 0, 21], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]]
1
50
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N, M; cout << ((N * (N - 1)) / 2) + ((M * (M - 1)) / 2) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << ((N * (N - 1)) / 2) + ((M * (M - 1)) / 2) << endl; }
[["-", 0, 14, 8, 9, 0, 1, 0, 34, 0, 21], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]]
1
55
N,M=map(int,input().split()) ans=(N*N-1)/2+(M*M-1)/2 print(int(ans))
N,M=map(int,input().split()) ans=N*(N-1)/2+M*(M-1)/2 print(int(ans))
[["-", 0, 662, 12, 657, 31, 657, 31, 23, 0, 24], ["+", 12, 657, 31, 657, 31, 657, 12, 23, 0, 24], ["-", 0, 662, 12, 657, 12, 657, 31, 23, 0, 24], ["+", 12, 657, 12, 657, 31, 657, 12, 23, 0, 24]]
5
44
#include <bits/stdc++.h> #define for0(i, b) for (int i = 0; i < b; i++) #define for1(i, b) for (int i = 1; i <= b; i++) #define reps(i, a, b) for (int i = a; i < b.length(); i++) typedef long long ll; #define MOD 1000000007 using namespace std; int main() { int n, m; cin >> n >> m; cout << (n * n - 1 + m * m - ...
#include <bits/stdc++.h> #define for0(i, b) for (int i = 0; i < b; i++) #define for1(i, b) for (int i = 1; i <= b; i++) #define reps(i, a, b) for (int i = a; i < b.length(); i++) typedef long long ll; #define MOD 1000000007 using namespace std; int main() { int n, m; cin >> n >> m; cout << (n * (n - 1) + m * (m...
[["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 25], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25]]
1
78
<?php $inp = fgets(STDIN); $d = array_map(function($value){return (int)$value;},explode(" ",$inp)); echo($d[0]*floor(($d[0]-1)/2)+($d[1]*floor(($d[1]-1)/2)));?>
<?php $inp = fgets(STDIN); $d = array_map(function($value){return (int)$value;},explode(" ",$inp)); echo($d[0]*(($d[0]-1)/2)+($d[1]*(($d[1]-1)/2)));?>
[["-", 0, 23, 0, 16, 31, 16, 12, 613, 63, 141], ["-", 0, 16, 12, 23, 0, 16, 12, 613, 63, 141]]
6
88
N,M = map(int,input().split) x = int( N*(N-1)/2 + M*(M-1)/2 ) print(x)
N,M = map(int,input().split()) x = int( N*(N-1)/2 + M*(M-1)/2 ) print(x)
[["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
42
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cout << n * (n + 1) / 2 + m * (m + 1) / 2 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl; return 0; }
[["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
50
#include <bits/stdc++.h> 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) / 2 << endl; }
#include <bits/stdc++.h> 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; }
[["-", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["-", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
61
A,B=input() A=int(A) B=int(B) num=0 num+=A*(A-1)//2 num+=B*(B-1)//2 print(num)
A,B=input().split(' ') A=int(A) B=int(B) num=0 num+=A*(A-1)//2 num+=B*(B-1)//2 print(num)
[["+", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 662, 12, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 662, 12, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
48
#include <bits/stdc++.h> using namespace std; int main() { long long n, m; cin >> n >> m; cout << (n * (n - 1)) / 2 << (m * (m - 1)) / 2; }
#include <bits/stdc++.h> using namespace std; int main() { long long n, m; cin >> n >> m; cout << (n * (n - 1)) / 2 + (m * (m - 1)) / 2; }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 72]]
1
50
N, M = map(int, input().split()) print(N*(N-1)+M*(M-1))
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], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
34
n,m = 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, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 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
36
N,M= map(int,input().split()) print(N*(N-1)/2+M*(M-1))
N,M= map(int,input().split()) print(N*(N-1)//2+M*(M-1)//2)
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 676], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 676], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 12, 612]]
5
36
n,m = map(int,input()) print(int(n*(n-1)/2)+int(m*(m-1)/2))
n,m = map(int,input().split()) print(int(n*(n-1)/2)+int(m*(m-1)/2))
[["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
40
#include <bits/stdc++.h> using namespace std; int main() { int n, m, ans; cin >> n >> m; ans = n * (n - 1) + m * (m - 1); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m, ans; cin >> n >> m; ans = (n * (n - 1) + m * (m - 1)) / 2; cout << ans << endl; }
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
49
a = list(map(int, input().split())) b = a[0] * a[0]-1 / 2 + a[1] * a[1] -1 / 2 print(b)
a = list(map(int, input().split())) b = a[0] * (a[0] - 1) // 2 + a[1] * (a[1] - 1) // 2 print(b)
[["+", 12, 657, 31, 657, 31, 657, 12, 23, 0, 24], ["-", 12, 657, 31, 657, 31, 657, 12, 657, 17, 85], ["+", 12, 657, 31, 657, 31, 657, 12, 23, 0, 25], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 676], ["+", 12, 657, 12, 657, 31, 657, 12, 23, 0, 24], ["-", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85], ["+", 12, 657, 12, 657, 31...
5
50
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) / 2 + m * (m - 2) / 2 << endl; }
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl; }
[["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 13]]
1
47
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int sum = N * (N - 1) + M * (M - 1); cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; int sum = N * (N - 1) / 2 + M * (M - 1) / 2; cout << sum << endl; }
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 13]]
1
48
#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, M = map(int, readlines().split()) x = M * (M - 1) // 2 x += N * (N - 1) // 2 print(x)
#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, M = map(int, readline().split()) x = M * (M - 1) // 2 x += N * (N - 1) // 2 print(x)
[["-", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22], ["+", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22]]
5
72
#include <algorithm> #include <iostream> using namespace std; int main() { int N; int M; cin >> N >> M; cout << (N * N - 1 + M * M - 1) / 2 << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int N; int M; cin >> N >> M; cout << (N * (N - 1) + M * (M - 1)) / 2 << endl; return 0; }
[["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 25], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25]]
1
49
n,m=map(int,input().splt()) ans=((n*(n-1))/2)+(m*(m-1))/2 print(int(ans))
n,m=map(int,input().split()) ans=((n*(n-1))/2)+(m*(m-1))/2 print(int(ans))
[["-", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22]]
5
50
n,m=map(int,input().split()) if n==0: print(int(n*(n-1)/2)) elif m==0: print(iint(m*(m-1)/2)) else: print(int(n*(n-1)/2+m*(m-1)/2))
n,m=map(int,input().split()) if n==0: print(int(m*(m-1)/2)) elif m==0: print(int(n*(n-1)/2)) else: print(int(n*(n-1)/2+m*(m-1)/2))
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["-", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22]]
5
83
#include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int n, m; int ans; cin >> n >> m; ans = m * (n - 1) / 2 + m * (m - 1) / 2; cout << ans; return 0; }
#include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int n, m; int ans; cin >> n >> m; ans = n * (n - 1) / 2 + m * (m - 1) / 2; cout << ans; return 0; }
[["-", 0, 11, 12, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 31, 22]]
1
61
a,b = map(int,input().split()) print((a * (a + 1) / 2) + (b * (b + 1) / 2))
a,b = map(int,input().split()) print(int((a * (a - 1) / 2) + (b * (b - 1) / 2)))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["-", 0, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["+", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
42
#include <iostream> using namespace std; int kaijou(int a) { return a * kaijou(a - 1); } int main() { int N, M; cin >> N >> M; N = kaijou(N) / 2; M = kaijou(M) / 2; cout << N + M << endl; }
#include <iostream> using namespace std; int kaijou(int a) { return a * (a - 1); } int main() { int N, M; cin >> N >> M; N = kaijou(N) / 2; M = kaijou(M) / 2; cout << N + M << endl; }
[["-", 8, 9, 0, 37, 0, 16, 12, 2, 63, 22]]
1
67
#include <bits/stdc++.h> using namespace std; int main() { int n, m, ans; cin >> n >> m; ans = n * (n - 1) / 2 + m * (m - 1); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m, ans; cin >> n >> m; ans = n * (n - 1) / 2 + m * (m - 1) / 2; cout << ans << endl; }
[["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 13]]
1
51
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int NM = N + M; System.out.println((NM * (NM - 1)) / 2 - (N * M) / 2); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int NM = N + M; System.out.println((NM * (NM - 1)) / 2 - (N * M)); } }
[["-", 0, 492, 3, 4, 0, 16, 12, 16, 17, 85], ["-", 0, 492, 3, 4, 0, 16, 12, 16, 12, 499]]
3
87
#include <bits/stdc++.h> using namespace std; typedef long long ll; void init() { cin.tie(0); cin.sync_with_stdio(0); } const int N = 1e5 + 9, M = 1e5 + 9, OO = 0x3f3f3f3f; const ll llOO = 0x3f3f3f3f3f3f3f3f; int main() { init(); int n, m; cin >> n >> m; cout << max(0, (n - 1) * n) + max(0, (m - 1) * ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; void init() { cin.tie(0); cin.sync_with_stdio(0); } const int N = 1e5 + 9, M = 1e5 + 9, OO = 0x3f3f3f3f; const ll llOO = 0x3f3f3f3f3f3f3f3f; int main() { init(); int n, m; cin >> n >> m; cout << max(0, (n - 1) * n / 2) + max(0, (m - 1...
[["+", 12, 16, 31, 2, 3, 4, 0, 16, 17, 85], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 17, 85], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
104
function Main(input) { var tmp = input.split(" "); var N = parseInt(tmp[0], 10); var M = parseInt(tmp[1], 10); //組み合わせの考え方 //偶数+偶数=偶数(1) //奇数+偶数=奇数(2) //奇数+奇数=偶数(3) //であるため //(1)=N*(N-1),(3)=M*(M-1)の和が // N+Mのボールから任意の2のボールを取るときの偶数となる場合の数となる。 console.log(N * (N - 1) + M * (M - 1) / 2); } //*この行以降...
function Main(input) { var tmp = input.split(" "); var N = parseInt(tmp[0], 10); var M = parseInt(tmp[1], 10); //組み合わせの考え方 //偶数+偶数=偶数(1) //奇数+偶数=奇数(2) //奇数+奇数=偶数(3) //であるため //(1)=N*(N-1),(3)=M*(M-1)の和が // N+Mのボールから任意の2のボールを取るときの偶数となる場合の数となる。 console.log((N * (N - 1) + M * (M - 1)) / 2); } //*この行...
[["+", 0, 2, 3, 3, 0, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25]]
2
97
#include <bits/stdc++.h> using namespace std; int main() { int M, N; cin >> M >> N; cout << (M * (M + 1) + N * (N + 1)) / 2 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int M, N; cin >> M >> N; cout << (M * (M - 1) + N * (N - 1)) / 2 << endl; return 0; }
[["-", 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
50
m,n=(int(x) for x in input().split()); even = m*(m-1)/2; odd = n*(n-2)/2; result = even + odd; print(result);
m,n=(int(x) for x in input().split()); even = m*(m-1)/2; odd = n*(n-1)/2; result = int(even + odd); print(result);
[["-", 12, 657, 31, 657, 12, 23, 0, 657, 12, 612], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 12, 612], ["+", 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, 25]]
5
56
/*//////////////////////////////////////*/ /*/ NULLCT$ (`・ω・´) <<"Be accept!!" /*/ /*//////////////////////////////////////*/ #include <algorithm> #include <cstdint> #include <cstdlib> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <type_traits> #include <vector> ...
/*//////////////////////////////////////*/ /*/ NULLCT$ (`・ω・´) <<"Be accept!!" /*/ /*//////////////////////////////////////*/ #include <algorithm> #include <cstdint> #include <cstdlib> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <type_traits> #include <vector> ...
[["-", 12, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["-", 12, 16, 31, 16, 31, 16, 31, 23, 0, 25], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["-", 31, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["-", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
262
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))
[["-", 12, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 17, 33]]
5
41
i = list(map(int, input().split())) N = i[0] M = i[1] guusuu = (N * N-1) // 2 kisuu = (M * M-1) // 2 print(guusuu + kisuu)
i = list(map(int, input().split())) N = i[0] M = i[1] guusuu = (N * (N-1)) // 2 kisuu = (M * (M-1)) // 2 print(guusuu + kisuu)
[["+", 12, 657, 31, 23, 0, 657, 12, 23, 0, 24], ["+", 12, 657, 31, 23, 0, 657, 12, 23, 0, 25]]
5
57
#include <iostream> using namespace std; int main() { int x, y; cin >> x, y; cout << ((x - 1) * x) / 2 + ((y - 1) * y) / 2; return 0; }
#include <iostream> using namespace std; int main() { int x, y; cin >> x >> y; cout << ((x - 1) * x) / 2 + ((y - 1) * y) / 2; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 34, 0, 21], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]]
1
52
#include <bits/stdc++.h> using namespace std; #define pp pair<int, int> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ll long long #define ld long double #define all(a) (a).begin(), (a).end() #define mk make_pair ll mod = 998244353; int inf = 1000001000; ll INF = 1e18 + 5; ll MOD = 1000000007; int main(...
#include <bits/stdc++.h> using namespace std; #define pp pair<int, int> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ll long long #define ld long double #define all(a) (a).begin(), (a).end() #define mk make_pair ll mod = 998244353; int inf = 1000001000; ll INF = 1e18 + 5; ll MOD = 1000000007; int main(...
[["+", 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
91
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll n, m; cin >> n >> m; cout << n * n - n + m * m - m; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll n, m; cin >> n >> m; cout << (n * n - n + m * m - m) / 2; }
[["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]]
1
64
N,M = map(int,input().split) a = int((N * (N-1) + M * (M-1)) / 2) print(a)
N, M = map(int,input().split()) a = int((N * (N-1) + M * (M-1)) / 2) print(a)
[["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
42
#include <iostream> #include <string.h> using namespace std; int main() { int N; int M; cin >> N >> M; cout << (N * N - 1) / 2 + (M * M - 1) / 2 << endl; return 0; }
#include <iostream> #include <string.h> using namespace std; int main() { int N; int M; cin >> N >> M; cout << N * (N - 1) / 2 + M * (M - 1) / 2 << endl; return 0; }
[["-", 31, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 16, 31, 16, 12, 23, 0, 24], ["-", 31, 16, 12, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 12, 16, 31, 16, 12, 23, 0, 24]]
1
53
#include <iostream> using namespace std; int main() { int m, n, a, b; cin >> m >> n; a = m * (m + 1) / 2; b = n * (n + 1) / 2; cout << a + b << endl; }
#include <iostream> using namespace std; int main() { int m, n, a, b; cin >> m >> n; a = m * (m - 1) / 2; b = n * (n - 1) / 2; cout << a + b << endl; }
[["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
59
n,m=map(int,input.split()) ans=n*(n-1)/2#nC2の順列を利用(n個の球から2個の玉を選択) ans+=m*(m-1)/2 print(int(ans))
n,m=map(int,input().split()) ans=n*(n-1)/2 ans+=m*(m-1)/2 print(int(ans))
[["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25]]
5
44
const s_list = require('fs').readFileSync('/dev/stdin', 'utf8'); const n_list = s_list.map(s => parseInt(s, 10)); const n = n_list[0]; const m = n_list[1]; const ans_n = n > 1 ? n * (n - 1) / 2 : 0 const ans_m = m > 1 ? m * (m - 1) / 2 : 0 const ans = ans_n + ans_m console.log(ans)
const s_list = require('fs').readFileSync('/dev/stdin', 'utf8').split(' '); const n_list = s_list.map(s => parseInt(s, 10)); const n = n_list[0]; const m = n_list[1]; const ans_n = n > 1 ? n * (n - 1) / 2 : 0 const ans_m = m > 1 ? m * (m - 1) / 2 : 0 const ans = ans_n + ans_m console.log(ans)
[["+", 0, 570, 0, 200, 51, 2, 63, 558, 0, 131], ["+", 0, 570, 0, 200, 51, 2, 63, 558, 559, 560], ["+", 0, 570, 0, 200, 51, 2, 3, 3, 0, 24], ["+", 0, 200, 51, 2, 3, 3, 0, 557, 0, 104], ["+", 0, 200, 51, 2, 3, 3, 0, 557, 0, 491], ["+", 0, 570, 0, 200, 51, 2, 3, 3, 0, 25]]
2
102
import sys def choose2(x): return x * (n - 1) // 2 n, m = map(int, sys.stdin.readline().split()) def main(): res = choose2(n) + choose2(m) print(res) if __name__ == '__main__': main()
import sys def choose2(x): return x * (x - 1) // 2 n, m = map(int, sys.stdin.readline().split()) def main(): res = choose2(n) + choose2(m) print(res) if __name__ == '__main__': main()
[["-", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22]]
5
68
/* SANDEEP YADAv*/ #include <bits/stdc++.h> using namespace std; #define lld long long int #define pb push_back #define mkp make_pair #define fi first #define se second #define mod 1000000007 #define fastio \ ios_base::sync_with_stdio(0); ...
/* SANDEEP YADAv*/ #include <bits/stdc++.h> using namespace std; #define lld long long int #define pb push_back #define mkp make_pair #define fi first #define se second #define mod 1000000007 #define fastio \ ios_base::sync_with_stdio(0); ...
[["-", 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, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
253
#include <bits/stdc++.h> using namespace std; #define f(a, b) for (auto i = a; i < b; i++) typedef long long int ll; void solve() { return; } int main() { ll n, m; cin >> n >> m; // solve(); cout << n * (n + 1) / 2 + m * (m + 1) / 2 << "\n"; }
#include <bits/stdc++.h> using namespace std; #define f(a, b) for (auto i = a; i < b; i++) typedef long long int ll; void solve() { return; } int main() { ll n, m; cin >> n >> m; // solve(); cout << n * (n - 1) / 2 + m * (m - 1) / 2 << "\n"; }
[["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
72
N,M = gets.split.map &:to_i p N*(N-1) + M*(M-1)
N,M = gets.split.map &:to_i p N*(N-1)/2 + M*(M-1)/2
[["+", 0, 652, 3, 4, 0, 738, 31, 738, 17, 85], ["+", 0, 652, 3, 4, 0, 738, 31, 738, 12, 612], ["+", 0, 652, 3, 4, 0, 738, 12, 738, 17, 85], ["+", 0, 652, 3, 4, 0, 738, 12, 738, 12, 612]]
4
27
#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, A; cin >> N >> M; cout << N * (N - 1) / 2 + M * (M - 1) / 2; }
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 34, 0, 21], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]]
1
45
#include <bits/stdc++.h> /* run this program using the console pauser or add your own getch, * system("pause") or input loop */ using namespace std; int main(int argc, char **argv) { int n, m; cin >> n >> m; cout << (n * (n - 1)) + (m * (m - 1)); return 0; }
#include <bits/stdc++.h> /* run this program using the console pauser or add your own getch, * system("pause") or input loop */ using namespace std; int main(int argc, char **argv) { int n, m; cin >> n >> m; cout << ((n * (n - 1)) + (m * (m - 1))) / 2; return 0; }
[["+", 12, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 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
56
N,M = map(int,input()) ans = (N-1)*N/2 ans =ans + (M-1)*M/2 print(ans)
N,M = map(int,input().split()) ans = (N-1)*N//2 ans =ans + (M-1)*M//2 print(ans)
[["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["-", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85]...
5
40
n, m = gets.strip.split(' ').map(&:to_i) puts (n * n(n-1) / 2) + (m * m(m-1) / 2)
n, m = gets.strip.split(' ').map(&:to_i) puts (n * (n-1) / 2) + (m * (m-1) / 2)
[["-", 31, 739, 0, 738, 31, 738, 12, 652, 735, 22], ["-", 12, 739, 0, 738, 31, 738, 12, 652, 735, 22]]
4
46
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()
[["-", 3, 4, 0, 23, 0, 657, 31, 657, 17, 85], ["+", 3, 4, 0, 23, 0, 657, 31, 657, 17, 676], ["-", 31, 23, 0, 657, 12, 23, 0, 657, 17, 72], ["+", 31, 23, 0, 657, 12, 23, 0, 657, 17, 33], ["-", 3, 4, 0, 23, 0, 657, 12, 657, 17, 85], ["+", 3, 4, 0, 23, 0, 657, 12, 657, 17, 676]]
5
50
#include <iostream> using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; int ans = n * (n - 1) + m * (m - 1); cout << ans; return 0; }
#include <iostream> using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; int ans = n * (n - 1) + m * (m - 1); cout << ans / 2; return 0; }
[["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]]
1
54
#abc159 a n,m=map(int,input().split()) ans=n*(n-1)/2+(m-1)/2 print(ans)
#abc159 a n,m=map(int,input().split()) ans=n*(n-1)/2+m*(m-1)/2 print(int(ans))
[["+", 0, 662, 12, 657, 12, 657, 31, 657, 31, 22], ["+", 0, 662, 12, 657, 12, 657, 31, 657, 17, 48], ["+", 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
40
#include <iostream> using namespace std; int main(void) { int n, m; cin >> n >> m; cout << (n * (n + 1) / 2) + (m * (m + 1) / 2) << endl; return 0; }
#include <iostream> using namespace std; int main(void) { int n, m; cin >> n >> m; cout << (n * (n - 1) / 2) + (m * (m - 1) / 2) << endl; return 0; }
[["-", 0, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
55
N, M = map(int,input().split()) return(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))
[["-", 36, 36, 36, 36, 0, 656, 0, 37, 0, 38], ["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22]]
5
41
n,m = map(int, input().split()) print(int(((n+m)*(n+m-1)-n*m)/2))
n,m = map(int, input().split()) print(int(((n+m)*(n+m-1)/2-n*m)))
[["+", 3, 4, 0, 23, 0, 657, 31, 657, 17, 85], ["+", 3, 4, 0, 23, 0, 657, 31, 657, 12, 612], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 85], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
43
a = gets.split(" ").map(&:to_i) p (a[0]*a[0]-1)/2 + (a[1]*a[1])/2
a = gets.split(" ").map(&:to_i) p (a[0]*(a[0]-1))/2 + (a[1]*(a[1]-1))/2
[["+", 31, 738, 31, 739, 0, 738, 12, 739, 0, 24], ["+", 3, 4, 0, 738, 31, 738, 31, 739, 0, 25], ["+", 12, 738, 31, 739, 0, 738, 12, 739, 0, 24], ["+", 31, 739, 0, 738, 12, 739, 0, 738, 17, 33], ["+", 31, 739, 0, 738, 12, 739, 0, 738, 12, 612], ["+", 12, 738, 31, 739, 0, 738, 12, 739, 0, 25]]
4
46
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; // 'r' " int main() { int n, m; cin >> n >> m; int a = n * (n - 1) + m * (m - 1); cout << a << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; // 'r' " int main() { int n, m; cin >> n >> m; int a = n * (n - 1) / 2 + m * (m - 1) / 2; cout << a << endl; }
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 13]]
1
59
#include <bits/stdc++.h> #define int long long #define ld long double #define endl '\n' #define vi vector<int> #define vvi vector<vi> #define pii pair<int, int> #define vpii vector<pii> #define gr vector<vpii> #define fi first #define se second #define sz(x) (int)((x).size()) #define all(x) (x).begin(), (x).end() #defi...
#include <bits/stdc++.h> #define int long long #define ld long double #define endl '\n' #define vi vector<int> #define vvi vector<vi> #define pii pair<int, int> #define vpii vector<pii> #define gr vector<vpii> #define fi first #define se second #define sz(x) (int)((x).size()) #define all(x) (x).begin(), (x).end() #defi...
[["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
127
#include <bits/stdc++.h> using namespace std; int main() { int n, m, ans; cin >> n >> m; ans = n * (n - 1) + m * (m - 1); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m, ans; cin >> n >> m; ans = n * (n - 1) / 2 + m * (m - 1) / 2; cout << ans << endl; }
[["+", 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
49
N, M = map(int,input().split()) X = N*(N+1)/2 + M*(M+1)/2 print(X)
N, M = map(int,input().split()) X = int(N*(N-1)/2 + M*(M-1)/2) print(X)
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 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, 1, 0, 662, 12, 652, 3, 4,...
5
41
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #include <f...
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> #include <f...
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22]]
1
350
a,b=map(int,input().split()) print(a*(a-1)//2+b(b-1)//2)
a,b=map(int,input().split()) print(a*(a-1)//2+b*(b-1)//2)
[["+", 3, 4, 0, 657, 12, 657, 31, 657, 17, 48]]
5
37
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)
[["+", 3, 4, 0, 657, 31, 657, 31, 657, 17, 48], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 676], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 17, 48], ["-", 0, 652, 3, 4, 0, 657, 12, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 676]]
5
36
a = list(map(int, input().split())) print(int(a[0]*(a[0]-1)+a[1]*(a[1]-1)))
a = list(map(int, input().split())) print(int((a[0]*(a[0]-1)+a[1]*(a[1]-1))/2))
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 657, 12, 23, 0, 25], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 85], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
50
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ll long long using namespace std; int mai...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define ll long long using namespace std; int mai...
[["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]]
1
91
#include <iostream> using namespace std; int main(void) { int N, M; cin >> N >> M; cout << (N * N - 1) / 2 + (M * M - 1) / 2 << endl; return 0; }
#include <iostream> using namespace std; int main(void) { int N, M; cin >> N >> M; cout << (N * (N - 1)) / 2 + (M * (M - 1)) / 2 << endl; return 0; }
[["+", 31, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 31, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25]]
1
51
#include <bits/stdc++.h> using namespace std; #define ll long long #define M 1000000007 #define ff first #define ss second #define mp make_pair #define pb push_back #define io \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define M 1000000007 #define ff first #define ss second #define mp make_pair #define pb push_back #define io \ ios_base::sync_with_stdio(false); ...
[["-", 0, 16, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 0, 1, 0, 16, 12, 16, 31, 16, 17, 85], ["+", 0, 1, 0, 16, 12, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 12, 16, 12, 16, 12, 13]]
1
129
#include <algorithm> #include <iostream> #include <math.h> #include <numeric> #include <stdlib.h> #include <string> #include <vector> typedef long long int ll; using namespace std; int main() { int N, M; cin >> N >> M; cout << (N + M) * (N + M - 1) / 2 - N * M / 2 << endl; return 0; }
#include <algorithm> #include <iostream> #include <math.h> #include <numeric> #include <stdlib.h> #include <string> #include <vector> typedef long long int ll; 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, 12, 16, 17, 85], ["-", 0, 16, 31, 16, 12, 16, 12, 16, 12, 13]]
1
70
#include <bits/stdc++.h> using namespace std; int C(int A, int B) { int buf = 1; for (int i = 0; i < B; i++) { buf *= (A - i); buf /= (i + 1); } return buf; } int main() { int N, M; // N even M odd int all = 0, ans = 0; cin >> N >> M; // zenbu N+M C k (k==0 ~ k==N+M) for (int k = 0; k <= (N +...
#include <bits/stdc++.h> using namespace std; int C(int A, int B) { int buf = 1; for (int i = 0; i < B; i++) { buf *= (A - i); buf /= (i + 1); } return buf; } int main() { int N, M; // N even M odd int all = 0, ans = 0; cin >> N >> M; // zenbu N+M C k (k==0 ~ k==N+M) for (int k = 0; k <= (N +...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48]]
1
250
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; cout << n * (n - 1) / 2 + m * (m - 2) / 2; return 0; }
#include <iostream> using namespace std; int main() { long long n, m; cin >> n >> m; cout << n * (n - 1) / 2 + m * (m - 1) / 2; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 13]]
1
48