buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = (int)2e5 + 5, mod = (int)1e9 + 7, offset = (int)2e3 + 5; int n, a[N], b[N], dp[offset << 1][offset << 1], fact[offset << 1], invFact[offset << 1]; int add(int _a, int _b) { _a += _b; if (_a >= mod) _a -= mod; return _a; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = (int)2e5 + 5, mod = (int)1e9 + 7, offset = (int)2e3 + 5; int n, a[N], b[N], dp[offset << 1][offset << 1], fact[offset << 2], invFact[offset << 2]; int add(int _a, int _b) { _a += _b; if (_a >= mod) _a -= mod; return _a; ...
[["-", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["-", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["-", 341, 342, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 341, 342, 0, 16, 31, 23, 0, 16, 12, 13], ["-", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13], [...
1
644
#include <cstdio> #include <iostream> #define f(i, j) f[i + 2000][j + 2000] #define mod 1000000007 using namespace std; int f[4003][4003], C[8003][4003], a[200005], b[200005]; int read() { int cnt = 0; char ch = getchar(); while (ch < '0' || '9' < ch) ch = getchar(); while ('0' <= ch && ch <= '9') { cnt...
#include <cstdio> #include <iostream> #define f(i, j) f[i + 2000][j + 2000] #define mod 1000000007 using namespace std; int f[4003][4003], C[8003][4003], a[200005], b[200005]; int read() { int cnt = 0; char ch = getchar(); while (ch < '0' || '9' < ch) ch = getchar(); while ('0' <= ch && ch <= '9') { cnt...
[["-", 0, 7, 8, 7, 8, 1, 0, 16, 17, 109], ["+", 0, 7, 8, 7, 8, 1, 0, 11, 17, 132], ["+", 0, 7, 8, 1, 0, 11, 31, 23, 0, 24], ["+", 0, 7, 8, 1, 0, 11, 31, 23, 0, 25], ["+", 8, 9, 0, 7, 8, 1, 0, 11, 17, 132], ["+", 8, 9, 0, 7, 8, 1, 0, 11, 12, 22], ["-", 8, 9, 0, 7, 8, 1, 0, 11, 17, 110], ["+", 8, 1, 0, 11, 31, 23, 0, 42,...
1
423
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxm = 4005, maxv = maxm / 2, maxn = 200005, mod = 1000000007; int n, ans; int a[maxn], b[maxn]; int f[maxm][maxm], C[maxm][maxm]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]); for (int i = ...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxm = 4005, maxv = maxm / 2, maxn = 200005, mod = 1000000007; int n, ans; int a[maxn], b[maxn]; int f[maxm][maxm], C[maxm][maxm]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]); for (int i = ...
[["+", 8, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 8, 1, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 24], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 49, ...
1
368
#include <bits/stdc++.h> using namespace std; #define F first #define S second typedef long long ll; const ll N = 4022; ll n, dp[N][N], f[N], nf[N], mod = 1e9 + 7; pair<ll, ll> p[200022]; ll poww(ll a, ll b) { if (b == 0) return 1; ll k = poww(a, b / 2); k = (k * k) % mod; if (b & 1) k = (k * a) % mod; ...
#include <bits/stdc++.h> using namespace std; #define F first #define S second typedef long long ll; const ll N = 200022; ll n, dp[4022][4022], f[N], nf[N], mod = 1e9 + 7; pair<ll, ll> p[N]; ll poww(ll a, ll b) { if (b == 0) return 1; ll k = poww(a, b / 2); k = (k * k) % mod; if (b & 1) k = (k * a) % mo...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 43, 49, 80, 49, 80, 81, 22], ["+", 0, 30, 0, 43, 49, 80, 49, 80, 81, 13], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+"...
1
545
// be name khoda \\ // #define stream_enable // #define bloat_enable #define long_enable // #define multitest_enable #define debug_enable #ifdef bloat_enable #include <bits/stdc++.h> #else #include <algorithm> #include <cmath> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <limi...
// be name khoda \\ // #define stream_enable // #define bloat_enable #define long_enable // #define multitest_enable #define debug_enable #ifdef bloat_enable #include <bits/stdc++.h> #else #include <algorithm> #include <cmath> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <limi...
[["+", 36, 36, 0, 30, 0, 43, 0, 153, 0, 154], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 49, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 17, 48], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", ...
1
1,365
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const int MAX_N = 2000; const ll MOD = 1000000007; ll cnt[MAX_N + 1][MAX_N + 1]; ll frac[MAX_N * 2 + 1], inv[MAX_N * 2 + 1]; ll power(ll a, int n) { ll ans = 1; while (n > 0) { if (n % 2 == 1) ans = (ans * a) % MOD; a = a * a %...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const int MAX_N = 2000; const ll MOD = 1000000007; ll cnt[MAX_N + 1][MAX_N + 1]; ll frac[MAX_N * 4 + 1], inv[MAX_N * 4 + 1]; ll power(ll a, ll n) { ll ans = 1; while (n > 0) { if (n % 2 == 1) ans = ans * a % MOD; a = a * a % MO...
[["-", 0, 43, 49, 80, 81, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 80, 81, 16, 31, 16, 12, 13], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 64, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["-", 64, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 13], ["+", ...
1
707
#include <bits/stdc++.h> #define il inline #define ri register int #define pb push_back #define mp make_pair #define fir first #define sec second #define mid ((l + r) >> 1) #define MAXN 200050 #define MAXM 4050 #define mod 1000000007 #define inf (1 << 30) #define eps (1e-6) #define alpha 0.75 #define rep(i, x, y) for (...
#include <bits/stdc++.h> #define il inline #define ri register int #define pb push_back #define mp make_pair #define fir first #define sec second #define mid ((l + r) >> 1) #define MAXN 200050 #define MAXM 4050 #define mod 1000000007 #define inf (1 << 30) #define eps (1e-6) #define alpha 0.75 #define rep(i, x, y) for (...
[["+", 0, 30, 0, 43, 49, 80, 81, 16, 17, 48], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["-", 0, 11, 31, 69, 28, 2, 3, 4, 0, 13], ["+", 0, 11, 31, 69, 28, 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], ["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 12, 2...
1
792
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define rep(i, l, r) for (int i = (l); i <= (r); ++i) #define per(i, r, l) for (int i = (r); i >= (l); --i) using namespace ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define rep(i, l, r) for (int i = (l); i <= (r); ++i) #define per(i, r, l) for (int i = (r); i >= (l); --i) using namespace ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 31, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 34, 12, 34, 31, 11, 12, 16, 17, 109], ["+", 0, 34, 12, 34, 31, 11, 12, 16, 12, 22], ["+", 31, 23, 0, 16, 12, 16, 31, 23, 0, 24],...
1
516
#include <bits/stdc++.h> using namespace std; typedef long long LL; int _max(int x, int y) { return x > y ? x : y; } int _min(int x, int y) { return x < y ? x : y; } const int mod = 998244353; const int N = 200001; const int M = 2001; int read() { int s = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9...
#include <bits/stdc++.h> using namespace std; typedef long long LL; int _max(int x, int y) { return x > y ? x : y; } int _min(int x, int y) { return x < y ? x : y; } const int mod = 1e9 + 7; const int N = 200001; const int M = 2001; int read() { int s = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9')...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0...
1
775
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <map> #include <queue> #include <set> #include <vector> #define LL long long #define mp(x, y) make_pair(x, y) #define pll pair<long long, long long> #define pii pair<int, int> using ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <map> #include <queue> #include <set> #include <vector> #define LL long long #define mp(x, y) make_pair(x, y) #define pll pair<long long, long long> #define pii pair<int, int> using ...
[["+", 36, 36, 0, 30, 0, 43, 49, 50, 49, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 0, 30, 0, 43, 0, 153, 0, 154], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["+", ...
1
926
#include <cstdio> int n, a[200003], b[200003]; long long fac[4003], ifac[4003], f[4003][4003], ans; inline long long qpow(register long long x, register int b) { register long long ans = 1; while (b) { if (b & 1) { ans *= x; ans %= 1000000007; } x *= x; x %= 1000000007; b >>= 1; } ...
#include <cstdio> int n, a[200003], b[200003]; long long fac[8003], ifac[8003], f[4003][4003], ans; inline long long qpow(register long long x, register int b) { register long long ans = 1; while (b) { if (b & 1) { ans *= x; ans %= 1000000007; } x *= x; x %= 1000000007; b >>= 1; } ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14...
1
484
import java.util.Scanner; public class Main { private static final int MOD = 1000000007; public static void main(String[] args) { long[] fac = new long[8001]; long[] inv = new long[8001]; long[] fiv = new long[8001]; fac[0] = fac[1] = fiv[0] = fiv[1] = inv[1] = 1; for (int i = 2; i <= 8000; i+...
import java.util.Scanner; public class Main { private static final int MOD = 1000000007; public static void main(String[] args) { long[] fac = new long[8001]; long[] inv = new long[8001]; long[] fiv = new long[8001]; fac[0] = fac[1] = fiv[0] = fiv[1] = inv[1] = 1; for (int i = 2; i <= 8000; i+...
[["+", 0, 7, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 11, 17, 132], ["+", 0, 7, 8, 196, 0, 1, 0, 11, 12, 22], ["+", 8, 196, 0, 7, 8, 196, 0, 1, 0, 35], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 12, 22], ["-", 0, 492, 3, 4, 0, 16, 31, 16, 12, 499], ["+", 3, 4, 0, ...
3
485
// 2019.2.22 by ljz #include <bits/stdc++.h> using namespace std; #define res register int #define LL long long #define inf 0x3f3f3f3f #define eps 1e-10 inline int read() { res s = 0; bool w = 0; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') w = 1; ch = getchar(); } while ...
// 2019.2.22 by ljz #include <bits/stdc++.h> using namespace std; #define res register int #define LL long long #define inf 0x3f3f3f3f #define eps 1e-10 inline int read() { res s = 0; bool w = 0; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') w = 1; ch = getchar(); } while ...
[["+", 8, 201, 0, 43, 49, 80, 81, 16, 17, 151], ["+", 8, 201, 0, 43, 49, 80, 81, 16, 12, 13], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 12, 13]]
1
850
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> typedef long long ll; using namespace std; #define Mod 1000000007 ll modinv(ll a) { ll m = Mod; ll b = m, u = 1, v = 0; while (b) { ll t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> typedef long long ll; using namespace std; #define Mod 1000000007 ll modinv(ll a) { ll m = Mod; ll b = m, u = 1, v = 0; while (b) { ll t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 11, 31, 69, 28, 69, 28, 22], ["-", 0, 11, 31, 69, 28, 69, 341, 342, 0, 70], ["-", 0, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 0, 11, 31, 69, 28, 69, 341, 342, 0, 73], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["-...
1
495
#include <algorithm> #include <assert.h> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> using namespace std; typedef long long ll; const int MAXN =...
#include <algorithm> #include <assert.h> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> using namespace std; typedef long long ll; const int MAXN =...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 0, 43, 49, 80, 49, 80, 81, 16, 17, 151], ["+", 0, 43, 49, 80, 49, 80, 81, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 2, 63, 22], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 7, ...
1
475
#if 1 #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #inc...
#if 1 #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #inc...
[["+", 28, 69, 341, 342, 0, 2, 63, 343, 345, 348], ["+", 28, 69, 341, 342, 0, 2, 63, 343, 0, 349], ["+", 28, 69, 341, 342, 0, 2, 63, 343, 141, 22], ["+", 28, 69, 341, 342, 0, 2, 3, 4, 0, 24], ["+", 28, 69, 341, 342, 0, 2, 3, 4, 0, 21], ["+", 28, 69, 341, 342, 0, 2, 3, 4, 0, 13], ["+", 28, 69, 341, 342, 0, 2, 3, 4, 0, 2...
1
2,233
#include <bits/stdc++.h> using namespace std; #define LL long long #define P pair<int, int> const LL inf = 0x3f3f3f3f; const LL mod = 1e9 + 7; const LL N = 9e3 + 10; template <typename tp> inline void read(tp &x) { x = 0; char c = getchar(); int f = 0; for (; c > '9' || c < '0'; f |= (c == '-'), c = getchar()) ...
#include <bits/stdc++.h> using namespace std; #define LL long long #define P pair<int, int> const LL inf = 0x3f3f3f3f; const LL mod = 1e9 + 7; const LL N = 4e3 + 10; template <typename tp> inline void read(tp &x) { x = 0; char c = getchar(); int f = 0; for (; c > '9' || c < '0'; f |= (c == '-'), c = getchar()) ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 17, 48], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 48], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
603
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #define inf 20021225 #define ll long long #define mdn 1000000007 using namespace std; int f[4100][4100], inv2; int fac[4100], inv[4100]; int n, a[200010], b[200010]; int ksm(int bs, int mi) { int ans = 1; while (mi) { if (mi & 1) ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #define inf 20021225 #define ll long long #define mdn 1000000007 using namespace std; int f[4100][4100], inv2; int fac[8100], inv[8100]; int n, a[200010], b[200010]; int ksm(int bs, int mi) { int ans = 1; while (mi) { if (mi & 1) ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 12, 2...
1
553
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a), i##_end_ = (b); i <= i##_end_; ++i) #define drep(i, a, b) for (int i = (a), i##_end_ = (b); i >= i##_end_; --i) #define clar(a, b) memset((a), (b), sizeof(a)) #define debug(...) fprintf(stderr, __VA_ARGS__) typedef long long LL; typede...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a), i##_end_ = (b); i <= i##_end_; ++i) #define drep(i, a, b) for (int i = (a), i##_end_ = (b); i >= i##_end_; --i) #define clar(a, b) memset((a), (b), sizeof(a)) #define debug(...) fprintf(stderr, __VA_ARGS__) typedef long long LL; typede...
[["-", 0, 30, 0, 43, 49, 80, 81, 16, 31, 22], ["-", 0, 30, 0, 43, 49, 80, 81, 16, 17, 48], ["-", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["-", 28, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["-", 28, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["-", 28, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 31, ...
1
749
#include <cstdio> typedef long long LL; const int MX = 2e3 + 5, N = 2e5 + 5, MOD = 1e9 + 7; int a[N], b[N], n; LL f[(MX << 1) + 5][(MX << 1) + 5]; LL jc[(MX << 1) + 5], inv[(MX << 1) + 5], invjc[(MX << 1) + 5]; LL ans; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { ...
#include <cstdio> typedef long long LL; const int MX = 2e3 + 5, N = 2e5 + 5, MOD = 1e9 + 7; int a[N], b[N], n; LL f[(MX << 1) + 5][(MX << 1) + 5]; LL jc[(MX << 2) + 5], inv[(MX << 2) + 5], invjc[(MX << 2) + 5]; LL ans; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { ...
[["-", 49, 80, 81, 16, 31, 23, 0, 16, 12, 13], ["+", 49, 80, 81, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 11, 31, 69, 28, 22], ["+", 0, 11, 12, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 11, 12, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 11, 12, 11, 31, 69, 341, 342, 0, 73], ["+", 8, 9, 0, 1, 0, 11, 12, 11, 17, 32], ...
1
644
#include <cstdio> #include <cstring> #include <iostream> typedef long long lint; const int N = 2005; const int mod = 1e9 + 7; int n, ans, fac[N << 1], inv[N << 1], dp[N << 1][N << 1]; struct pnt { int x, y; } pt[N]; template <class T> inline void twk(T &x) { if (x >= mod) x -= mod; } inline int nxi() { int ...
#include <cstdio> #include <cstring> #include <iostream> typedef long long lint; const int N = 2005; const int mod = 1e9 + 7; int n, ans, fac[N << 2], inv[N << 2], dp[N << 1][N << 1]; struct pnt { int x, y; } pt[(int)2e5 + 2]; template <class T> inline void twk(T &x) { if (x >= mod) x -= mod; } inline int nxi...
[["-", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["+", 0, 43, 49, 80, 81, 16, 31, 74, 0, 24], ["+", 49, 80, 81, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 80, 81, 16, 31, 74, 0, 25], ["+", 0, 43, 49, 80, 81, 16, 31, 74, 51, 13], [...
1
634
#include <bits/stdc++.h> #define il inline #define vd void #define mod 1000000007 typedef long long ll; il int gi() { int x = 0, f = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); } while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x *...
#include <bits/stdc++.h> #define il inline #define vd void #define mod 1000000007 typedef long long ll; il int gi() { int x = 0, f = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); } while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x *...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 7, 8, 7, 8, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 7, 8, 1, 0, 11, 17, 32], ["+", 8, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 31, 16,...
1
510
public class Main { private static void solve() { int n = ni(); int max = 2000; int m = max * 2 + 1; int[][] cnt = new int[m][m]; int mod = 1000000000 + 7; int[][] fif = enumFIF(4010, mod); long z = 0; for (int i = 0; i < n; i++) { int a = ni(); int b = ni(); cnt[ma...
public class Main { private static void solve() { int n = ni(); int max = 2000; int m = max * 2 + 1; int[][] cnt = new int[m][m]; int mod = 1000000000 + 7; int[][] fif = enumFIF(8010, mod); long z = 0; for (int i = 0; i < n; i++) { int a = ni(); int b = ni(); cnt[ma...
[["-", 0, 503, 49, 200, 51, 492, 3, 4, 0, 499], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 499], ["-", 8, 196, 0, 503, 39, 224, 468, 506, 0, 96], ["+", 8, 196, 0, 503, 39, 224, 468, 506, 0, 507], ["-", 0, 503, 49, 200, 51, 227, 39, 506, 0, 96], ["+", 0, 503, 49, 200, 51, 227, 39, 506, 0, 507], ["+", 0, 11, 12, 16, 31, 16...
3
1,511
#include <cstdio> using namespace std; const long long mod = 1000000007; const int N = 200005; const int M = 2005; const int S = 2005; const int T = 4010; int n, i, j; int a[N], b[N]; int h[T][T], ans; int frac[T], inv[T]; long long getinv(long long b, int e = mod - 2) { if (e == 0) return 1ll; long long ret = ...
#include <cstdio> using namespace std; const long long mod = 1000000007; const int N = 200005; const int M = 2005; const int S = 2005; const int T = 4010; const int G = 8010; int n, i, j; int a[N], b[N]; int h[T][T], ans; int frac[G], inv[G]; long long getinv(long long b, int e = mod - 2) { if (e == 0) return 1ll...
[["+", 36, 36, 0, 30, 0, 43, 0, 153, 0, 154], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 49, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["+", ...
1
490
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 10, mod = 1e9 + 7; inline int read() { int x = 0, f = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); return x *...
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 10, mod = 1e9 + 7; inline int read() { int x = 0, f = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); return x *...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 38], ["+", 0, 57, 6...
1
633
#include <bits/stdc++.h> #define For(i, j, k) for (int i = j; i <= k; ++i) #define Forr(i, j, k) for (int i = j; i >= k; --i) using namespace std; inline int read() { int x = 0, p = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') p = -1; for (; isdigit(c); c = getchar()) ...
#include <bits/stdc++.h> #define For(i, j, k) for (int i = j; i <= k; ++i) #define Forr(i, j, k) for (int i = j; i >= k; --i) using namespace std; inline int read() { int x = 0, p = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') p = -1; for (; isdigit(c); c = getchar()) ...
[["+", 0, 30, 0, 43, 49, 80, 81, 16, 17, 151], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["-", 0, 30, 0, 43, 49, 80, 49, 80, 0, 70], ["-", 0, 30, 0, 43, 49, 80, 49, 80, 81, 22], ["-", 0, 30, 0, 43, 49, 80, 49, 80, 0, 73], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 0, 70], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["-", ...
1
656
/* */ #include <algorithm> #include <cctype> #include <cstdio> #define gc() getchar() #define mod 1000000007 #define Mod(x) x >= mod && (x -= mod) typedef long long LL; const int N = 4005, M = 1e5 + 5, D = 2001; int A[M], B[M], f[N][N], fac[M], ifac[M]; inline int read() { int now = 0; register char c = gc(); ...
/* */ #include <algorithm> #include <cctype> #include <cstdio> #define gc() getchar() #define mod 1000000007 #define Mod(x) x >= mod && (x -= mod) typedef long long LL; const int N = 2e5 + 5, M = 4005, D = 2001; int A[N], B[N], f[M][M], fac[N], ifac[N]; inline int read() { int now = 0; register char c = gc(); ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 0, 30, 0, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+"...
1
587
#include <bits/stdc++.h> #define maxn 200005 #define N 2005 #define LL long long using namespace std; const LL mo = 1e9 + 7; LL f[N << 1][N << 1]; int n; LL a[maxn], b[maxn]; LL inv[maxn]; LL fac[maxn]; LL ans; LL ksm(LL a, LL k) { if (!k) return 1ll; return (k & 1) ? ksm(a * a % mo, k >> 1) * a % mo : ksm(a ...
#include <bits/stdc++.h> #define maxn 200005 #define N 2005 #define LL long long using namespace std; const LL mo = 1e9 + 7; LL f[N << 1][N << 1]; int n; LL a[maxn], b[maxn]; LL inv[maxn]; LL fac[maxn]; LL ans; LL ksm(LL a, LL k) { if (!k) return 1ll; return (k & 1) ? ksm(a * a % mo, k >> 1) * a % mo : ksm(a ...
[["+", 0, 1, 0, 11, 31, 69, 28, 69, 28, 22], ["+", 0, 11, 31, 69, 28, 69, 341, 342, 0, 70], ["+", 0, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 11, 31, 69, 28, 69, 341, 342, 0, 73], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 73],...
1
515
// // main.cpp // agc001E BBQ Hard // // Created by ้ป„้“็…œ on 2018/10/3. // Copyright ยฉ 2018ๅนด ้ป„้“็…œ. All rights reserved. // #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define LL long long #define p 1000000007 using namespace std; int n, x, y, mp[5004][5005], tag[500...
// // main.cpp // agc001E BBQ Hard // // Created by ้ป„้“็…œ on 2018/10/3. // Copyright ยฉ 2018ๅนด ้ป„้“็…œ. All rights reserved. // #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define LL long long #define p 1000000007 using namespace std; int n, x, y, mp[5004][5005], tag[500...
[["+", 31, 16, 31, 69, 28, 69, 341, 342, 0, 73], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 22], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 69, 28, 69, 28, 22], ["+", 31, 16, 12, 69, 28, 69, 341, 342...
1
422
#include <bits/stdc++.h> #define ED(x) ((int)x.size() - 1) #define _for(i, a, b) for (int i = (a); i <= (b); ++i) #define _rep(i, a, b) for (int i = (a); i >= (b); --i) #define changxv \ ios::sync_with_stdio(0); ...
#include <bits/stdc++.h> #define ED(x) ((int)x.size() - 1) #define _for(i, a, b) for (int i = (a); i <= (b); ++i) #define _rep(i, a, b) for (int i = (a); i >= (b); --i) #define changxv \ ios::sync_with_stdio(0); ...
[["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["+", 0, 1, 0, 11, 31, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 31, 2, 3, 4, 0, 11, 12, 16, 17, 109], ["+", 31, 2, 3, 4, 0, 11, 12, 16, 12, 22], ["+", 0, 1, 0, 11, 31, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 9, 0, 1, 0, ...
1
644
#include <bits/stdc++.h> using namespace std; const int N = 200005; const int offset = 2005; const int mod = 1000000007; void add(int &x, int y) { x += y; if (x >= mod) x -= mod; } int mul(int x, int y) { return (long long)x * y % mod; } int pw(int x, int y) { int ret = 1; while (y) { if (y & 1) ...
#include <bits/stdc++.h> using namespace std; const int N = 200005; const int offset = 2005; const int mod = 1000000007; void add(int &x, int y) { x += y; if (x >= mod) x -= mod; } int mul(int x, int y) { return (long long)x * y % mod; } int pw(int x, int y) { int ret = 1; while (y) { if (y & 1) ...
[["-", 0, 30, 0, 43, 49, 80, 81, 16, 31, 22], ["-", 0, 30, 0, 43, 49, 80, 81, 16, 17, 72], ["-", 0, 30, 0, 43, 49, 80, 81, 16, 12, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22], ["+", 0, 1...
1
618
// By Don4ick //#define _GLIBCXX_DEBUG #include <bits/stdc++.h> typedef long long ll; typedef long double ld; typedef unsigned int ui; #define forn(i, n) for (int i = 1; i <= n; i++) #define pb push_back #define all(x) x.begin(), x.end() #define y1 qewr1234 const double PI = acos(-1.0); const int DIR = 4; const int...
// By Don4ick //#define _GLIBCXX_DEBUG #include <bits/stdc++.h> typedef long long ll; typedef long double ld; typedef unsigned int ui; #define forn(i, n) for (int i = 1; i <= n; i++) #define pb push_back #define all(x) x.begin(), x.end() #define y1 qewr1234 const double PI = acos(-1.0); const int DIR = 4; const int...
[["+", 49, 80, 81, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 43, 49, 80, 81, 16, 31, 16, 17, 72], ["+", 0, 43, 49, 80, 81, 16, 31, 16, 12, 22], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 17, 72], ["+", 12, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 12, 16, 31, 16, 31, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 16, 31, 16, 31, 16, 12,...
1
688
#include <bits/stdc++.h> #define f first #define s second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; const int N = (int)2123, mod = (int)1e9 + 7; int n; int ans, dp[N + N][N + N], cnt[N + N][N + N], f[4 * ...
#include <bits/stdc++.h> #define f first #define s second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; const int N = (int)2123, mod = (int)1e9 + 7; int n; int ans, dp[N + N][N + N], cnt[N + N][N + N], f[10 *...
[["-", 0, 30, 0, 43, 49, 80, 81, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 31, 13], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 0, 30, 0, 1...
1
522
#include <iostream> #include <stdio.h> #include <string.h> #define P 1000000007 #define A(x, y) f[((x) + 2100) * 4200 + (y)] using namespace std; int f[22000000]; int fac[13000], ifac[13000], n; long long ans, inv2; struct node { int x, y; } a[220000]; long long power(long long x, int k) { long long ans = 1; whil...
#include <iostream> #include <stdio.h> #include <string.h> #define P 1000000007 #define A(x, y) f[((x) + 2100) * 4200 + (y)] using namespace std; int f[22000000]; int fac[13000], ifac[13000], n; long long ans, inv2; struct node { int x, y; } a[220000]; long long power(long long x, int k) { long long ans = 1; whil...
[["+", 8, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 7, 8, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 7, 8, 1, 0, 11, 12, 16, 12, 22]]
1
547
#include <bits/stdc++.h> #define L long long #define MOD 1000000007 #define M 2005 using namespace std; L pow_mod(L x, L k) { L ans = 1; while (k) { if (k & 1) ans = ans * x % MOD; x = x * x % MOD; k >>= 1; } return ans; } L f[M * 2][M * 2] = {0}; L a[M * M] = {0}, b[M * M] = {0}, n; L fac[M...
#include <bits/stdc++.h> #define L long long #define MOD 1000000007 #define M 2005 using namespace std; L pow_mod(L x, L k) { L ans = 1; while (k) { if (k & 1) ans = ans * x % MOD; x = x * x % MOD; k >>= 1; } return ans; } int f[M * 2][M * 2] = {0}; L a[M * M] = {0}, b[M * M] = {0}, n; L fac...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 31, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+...
1
481
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <vector> using namespace std; #define LL long long inline int read() { int x = 0, f = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') f = -1; for (; isdigit(c); c = getchar...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <vector> using namespace std; #define LL long long inline int read() { int x = 0, f = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') f = -1; for (; isdigit(c); c = getchar...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["+", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
624
#include <bits/stdc++.h> #define Mod 1000000007 #define N 500005 #define invv (Mod + 1) / 2 using namespace std; int n, fac[N], inv[N], a[N], b[N], dp[4005][4005]; inline int ksm(int x, int y) { int ans1 = 1; while (y) { if (y & 1) ans1 = 1ll * ans1 * x % Mod; y >>= 1; x = 1ll * x * x % Mod; } ...
#include <bits/stdc++.h> #define Mod 1000000007 #define N 500005 #define int long long #define invv (Mod + 1) / 2 using namespace std; int n, fac[N], inv[N], a[N], b[N], dp[4005][4005]; inline int ksm(int x, int y) { int ans1 = 1; while (y) { if (y & 1) ans1 = 1ll * ans1 * x % Mod; y >>= 1; x = 1l...
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 0, 30, 0, 14, 39, 86, 0, 156], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 8, 1, 0, 2, 3...
1
519
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define int ll const int maxn = 2e5 + 20; const int maxm = 2e3 + 20; const int mod = 1e9 + 7; int dp[2 * maxm][2 * maxm], a[maxn], b[maxn], fac[maxn], caf[maxn]; void mkay(int &a) { while (a >= mod) a -= mod; } int bpw(in...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define int ll const int maxn = 2e5 + 20; const int maxm = 2e3 + 20; const int mod = 1e9 + 7; int dp[2 * maxm][2 * maxm], a[maxn], b[maxn], fac[maxn], caf[maxn]; void mkay(int &a) { a %= mod; if (a < 0) a += mod; } int ...
[["-", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["-", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, ...
1
529
#include <cstdio> #include <cstdlib> #include <iostream> #define int long long using namespace std; typedef long long ll; const ll mod = 1e9 + 7; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch > '9' || ch < '0') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' &&...
#include <cstdio> #include <cstdlib> #include <iostream> #define int long long using namespace std; typedef long long ll; const ll mod = 1e9 + 7; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch > '9' || ch < '0') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' &&...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 12, 2...
1
644
#include <bits/stdc++.h> using namespace std; using LL = long long; using Point = pair<int, int>; const int MX = 4005, mod = 1000000007; #define st first #define nd second int N, ans, fac[MX], inv[MX]; int Pool[MX][MX], *f[MX], **dp; Point P[200005]; inline int read() { int x = 0, c = getchar(); while (!isdigit(...
#include <bits/stdc++.h> using namespace std; using LL = long long; using Point = pair<int, int>; const int MX = 4005, mod = 1000000007; #define st first #define nd second int N, ans, fac[MX << 1], inv[MX << 1]; int Pool[MX][MX], *f[MX], **dp; Point P[200005]; inline int read() { int x = 0, c = getchar(); while ...
[["+", 0, 30, 0, 43, 49, 80, 81, 16, 17, 151], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 12, ...
1
673
#include <bits/stdc++.h> using namespace std; long long n, m, i, j, dp[4005][4005], a[200005], b[200005], c[4005][4005], mod = 1e9 + 7, ans; int main() { cin >> n; for (i = 1; i <= n; i++) { cin >> a[i] >> b[i]; dp[2000 - a[i]][2000 - b[i]]++; } c[0][0] = 1; for (i = 0; i <= 4000; i++) { for (...
#include <bits/stdc++.h> using namespace std; long long n, m, i, j, dp[4005][4005], a[200005], b[200005], c[4005][4005], mod = 1e9 + 7, ans; int main() { cin >> n; for (i = 1; i <= n; i++) { cin >> a[i] >> b[i]; dp[2001 - a[i]][2001 - b[i]]++; } c[0][0] = 1; for (i = 0; i <= 4003; i++) { for (...
[["-", 28, 69, 28, 69, 341, 342, 0, 16, 31, 13], ["+", 28, 69, 28, 69, 341, 342, 0, 16, 31, 13], ["-", 0, 27, 28, 69, 341, 342, 0, 16, 31, 13], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 31, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+"...
1
348
/* Written by Filip Hlasek 2016 */ #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define FORD(i, a, b) for (int i = (...
/* Written by Filip Hlasek 2016 */ #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define FORD(i, a, b) for (int i = (...
[["+", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 0, 52, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 52, 8, 9, 0, 57, 64, 93, 0, 94], ["+", 0, 52, 8, 9, 0, 57, 64, 93, 0, 35], ["+", 8, 9, 0, 52, 8, 9, 0, 57, 0, 121], ["+", 0, 52, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]]
1
249
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> #define REP(i, a, b) for (int i = (a); i <= (b); i+...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> #define REP(i, a, b) for (int i = (a); i <= (b); i+...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 8, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 22], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 57, 64, 1, 0, 2,...
1
301
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack...
[["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 78], ["+", 36, 36, 0, 30, 0, 14, 49, 53, 49, 22], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 24], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 49, 22], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 21], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 25], ["+", 3...
1
349
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; const ld EPS = 1e-11; const ld PI = acos(-1.0); const int INF = (int)1e9 + 5; const ll LINF = (ll)1e18 + 5; template <class T> ll abs(const T &x) { return x < 0 ? -x : x; } template <class T>...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; const ld EPS = 1e-11; const ld PI = acos(-1.0); const int INF = (int)1e9 + 5; const ll LINF = (ll)1e18 + 5; template <class T> ll abs(const T &x) { return x < 0 ? -x : x; } template <class T>...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 38], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 13], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 35], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 16, 3...
1
398
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; #define mp make_pair #define pb push_back #define x first #define y second typedef long long ll; typedef vector<int> ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; #define mp make_pair #define pb push_back #define x first #define y second typedef long long ll; typedef vector<int> ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 85], ["+...
1
163
import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import j...
import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import j...
[["-", 0, 235, 8, 498, 0, 195, 39, 506, 0, 507], ["+", 0, 235, 8, 498, 0, 195, 39, 506, 0, 96], ["-", 0, 195, 54, 495, 0, 496, 39, 506, 0, 507], ["+", 0, 195, 54, 495, 0, 496, 39, 506, 0, 96], ["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["+", 64, 196, 0, 37, 0, 16, 31,...
3
424
#include <bits/stdc++.h> using namespace std; #define FOR(i, n) for (int i = 0; i < (n); i++) #define sz(c) ((int)c.size()) #define ten(n) ((int)1e##n) using ll = long long; template <typename...> static inline int getchar_unlocked(void) { return getchar(); } template <typename...> static inline void putchar_unlock...
#include <bits/stdc++.h> using namespace std; #define FOR(i, n) for (int i = 0; i < (n); i++) #define sz(c) ((int)c.size()) #define ten(n) ((int)1e##n) using ll = long long; template <typename...> static inline int getchar_unlocked(void) { return getchar(); } template <typename...> static inline void putchar_unlock...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 14, 8, 9, 0, 43, 49, 50,...
1
1,520
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <iterator> #include <map> #include <memory.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <time.h> #include <utility...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <iterator> #include <map> #include <memory.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <time.h> #include <utility...
[["+", 49, 50, 51, 16, 31, 16, 31, 23, 0, 24], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 12, 22], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 49, 50, 51, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 48...
1
239
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> P; #define EACH(i, a) for (auto &i : a) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--) #define REP(i, n) for (l...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> P; #define EACH(i, a) for (auto &i : a) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--) #define REP(i, n) for (l...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 39, 78], ["+", 0, 57, 64, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 57, 64, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 31, 22], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 50...
1
384
#include <bits/stdc++.h> using namespace std; #define int long long #define PI pair<int, int> const int maxm = 1e6 + 5; struct Node { int a, b; } e[maxm]; vector<int> g[maxm]; int n, k; int temp; int limit; void dfs(int x, int fa, int dep) { if (dep > limit) return; temp++; for (int v : g[x]) { if (v ==...
#include <bits/stdc++.h> using namespace std; #define int long long #define PI pair<int, int> const int maxm = 1e6 + 5; struct Node { int a, b; } e[maxm]; vector<int> g[maxm]; int n, k; int temp; int limit; void dfs(int x, int fa, int dep) { if (dep > limit) return; temp++; for (int v : g[x]) { if (v ==...
[["+", 8, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 83, 0, 45], ["+", 8, 9, 0, 1, 0, 11, 12, 83, 0, 22], ["+", 8, 9, 0, 1, 0,...
1
356
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <math.h> #include <numeric> #include <stdio.h> #include <bitset> #include <deque> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack>...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <math.h> #include <numeric> #include <stdio.h> #include <bitset> #include <deque> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack>...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14...
1
410
#include <bits/stdc++.h> using namespace std; #define ll long long #define se second #define fi first #define mp make_pair #define pb push_back #define all(_v) _v.begin(), _v.end() const int mod = (int)1e9 + 7; const int INF = (int)1e9; const ll LINF = (ll)1e18; const int N = (int)1e5 + 100; const int MAXA = (int)3e6; ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define se second #define fi first #define mp make_pair #define pb push_back #define all(_v) _v.begin(), _v.end() const int mod = (int)1e9 + 7; const int INF = (int)1e9; const ll LINF = (ll)1e18; const int N = (int)1e5 + 100; const int MAXA = (int)3e6; ...
[["-", 15, 339, 51, 16, 31, 16, 31, 16, 31, 13], ["-", 15, 339, 51, 16, 31, 16, 31, 16, 17, 48], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 23, 0, 16, 31, 22], ["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 47...
1
628
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <unordered_map> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <unordered_map> #includ...
[["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22], ["-", 0, 7, 8, 9, 0, 57, 64, 1, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 1...
1
1,117
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <utility> #include <vector> using namespace std; template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &x : v) { is >> x; } return is; } template <typename T> ostream &operator<<(ostr...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <utility> #include <vector> using namespace std; template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &x : v) { is >> x; } return is; } template <typename T> ostream &operator<<(ostr...
[["+", 0, 37, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 31, 13], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 2, 3, 4, 0, 16, 12, 16, 31, 22], ["+", 0, 2, 3, 4, 0, 16, 12, 16, 17, 85], ["+", 0, 2, 3, 4, 0, 16, 12, 16, 12, 13...
1
599
#include <cstdio> #include <cstring> #include <iostream> using namespace std; const int N = 1e5; int n, K, fst[N], nxt[N], to[N], dep[N], ans, cnt, mm; void ade(int u, int v) { to[++mm] = v, nxt[mm] = fst[u], fst[u] = mm; } void dfs(int u, int fa, int lim) { dep[u] = dep[fa] + 1; ++cnt; if (lim == dep[u]) ret...
#include <cstdio> #include <cstring> #include <iostream> using namespace std; const int N = 1e5; int n, K, fst[N], nxt[N], to[N], dep[N], ans, cnt, mm; void ade(int u, int v) { to[++mm] = v, nxt[mm] = fst[u], fst[u] = mm; } void dfs(int u, int fa, int lim) { dep[u] = dep[fa] + 1; ++cnt; if (lim == dep[u]) ret...
[["+", 0, 34, 12, 34, 31, 11, 31, 69, 28, 22], ["+", 12, 34, 31, 11, 31, 69, 341, 342, 0, 70], ["+", 31, 11, 31, 69, 341, 342, 0, 69, 28, 22], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 22], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 73], ["+", 12, 34, 31, 11, 31, 69, ...
1
373
/* * @Description: * @Version: 1.0 * @Autor: goatzyq * @Date: 2020-08-20 12:07:17 * @LastEditors: goatzyq * @LastEditTime: 2020-08-20 14:59:23 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using db = double; using vi = vector<int>; #define rep(i, a, n) for (in...
/* * @Description: * @Version: 1.0 * @Autor: goatzyq * @Date: 2020-08-20 12:07:17 * @LastEditors: goatzyq * @LastEditTime: 2020-08-20 15:13:07 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using db = double; using vi = vector<int>; #define rep(i, a, n) for (in...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 11, 12, 2, 3, 4,...
1
1,218
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["-", 8, 9, 0, 57, 64, 9, 0, 116, 0, 35], ["-", 0, 338, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4...
1
591
#include <bits/stdc++.h> #define int long long #define gcd __gcd #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define mod2 998244353 #define maxe *max_element #define mine *min_element #define inf 1e18 #define deci(x, y) fixed << setprecision(y) << x #define w(...
#include <bits/stdc++.h> #define int long long #define gcd __gcd #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define mod2 998244353 #define maxe *max_element #define mine *min_element #define inf 1e18 #define deci(x, y) fixed << setprecision(y) << x #define w(...
[["+", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["+", 8, 9, 0, 43, 39, 344, 3, 347, 0, 18], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 8, 9, 0, 43, 39, 344, 3, 347, 0, 47], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 24], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 22], ["+", 8, 9, 0...
1
585
#include <bits/stdc++.h> #define inf 0x3f3f3f3f3f3f3f3f using namespace std; int n, k; const int SIZE = 2050; int w[SIZE]; int shk, fzy; std::vector<int> v[SIZE]; int d[SIZE]; int e[SIZE][2]; int vis[SIZE]; void init() { for (int i = 1; i <= n; i++) { d[i] = 0; vis[i] = 0; } } void dfs(int pos, int deep) {...
#include <bits/stdc++.h> #define inf 0x3f3f3f3f3f3f3f3f using namespace std; int n, k; const int SIZE = 2050; int w[SIZE]; int shk, fzy; std::vector<int> v[SIZE]; int d[SIZE]; int e[SIZE][2]; int vis[SIZE]; void init() { for (int i = 1; i <= n; i++) { vis[i] = 0; } } void init2() { init(); for (int i = 1; i...
[["-", 8, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["+", 8, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 36, 36, 0, 30, 0, 14, 8, 9, 0, 46], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 0, 30, 0, 14, 49, 53, 49, 22], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 24], ["+", 0, 30, 0, 14, ...
1
490
#include <cstdio> #include <vector> using namespace std; const int MAXN = 2005; int N, K; vector<int> adj[MAXN]; int dep[MAXN], fa[MAXN], cnt; void dfs(int u, int f, int lim) { for (int i = 0; i < (int)adj[u].size(); i++) { int v = adj[u][i]; if (v != f) { dep[v] = dep[u] + 1; if (dep[v] > lim) ...
#include <cstdio> #include <vector> using namespace std; const int MAXN = 2005; int N, K; vector<int> adj[MAXN]; int dep[MAXN], fa[MAXN], cnt; void dfs(int u, int f, int lim) { for (int i = 0; i < (int)adj[u].size(); i++) { int v = adj[u][i]; if (v != f) { dep[v] = dep[u] + 1; if (dep[v] > lim) ...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 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
427
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef pair<int, int> pii; const int inf = 0x3f3f3f3f, oo = inf; #define pi 3.14159265358979323846 #define IL inline #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define Rep(i, a, b) for ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef pair<int, int> pii; const int inf = 0x3f3f3f3f, oo = inf; #define pi 3.14159265358979323846 #define IL inline #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define Rep(i, a, b) for ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 11, 31, 69, 28, 69, 28, 2, 63, 22], ["+", 31, 69, 28, 69, 28, 2, 3, 4, 0, 24], ["+", 31, 69, 28, 69, 28, 2, 3, 4, 0, 22], ["+", 31, 69, 28, 69, 28, 2, 3, 4, 0, 21], ["+", 31, 69, 28,...
1
1,228
#include <bits/stdc++.h> using namespace std; const int N = 2005; typedef long long LL; int n, k, fa[N], cnt, first[N], ans = 1e9, res, r; bool vis[N]; struct Edge { int to, next; } e[N << 1]; void add(int u, int v) { e[++cnt] = (Edge){v, first[u]}; first[u] = cnt; } void Dfs(int u, int f, int d) { fa[u] = ...
#include <bits/stdc++.h> using namespace std; const int N = 2005; typedef long long LL; int n, k, cnt, first[N], ans = 1e9, res, r; bool vis[N]; struct Edge { int to, next; } e[N << 1]; void add(int u, int v) { e[++cnt] = (Edge){v, first[u]}; first[u] = cnt; } void Dfs(int u, int f, int d) { if (d <= r) ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 49, 22], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 0, 70], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 0, 73], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["-", 8, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["-", 0, 1...
1
469
// BadWaper gg #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define inf 1e9 #define eps 1e-6 #define mp make_pair #define N 2020 using namespace std; typedef long long ll...
// BadWaper gg #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define inf 1e9 #define eps 1e-6 #define mp make_pair #define N 2020 using namespace std; typedef long long ll...
[["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 49, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 22], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13], ["+", 12, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 8, 1, 0, 11, 12, 2, 3, 4, 0, 25], ["+", 0, 14,...
1
852
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define ll long long #define REP(a, b, c) for (int a = b; a <= c; a++) #define re register #define file(a) ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define ll long long #define REP(a, b, c) for (int a = b; a <= c; a++) #define re register #define file(a) ...
[["-", 12, 34, 31, 11, 31, 69, 341, 342, 0, 22], ["-", 12, 34, 31, 11, 31, 69, 341, 342, 0, 73], ["-", 8, 1, 0, 34, 12, 34, 31, 11, 17, 32], ["-", 12, 34, 31, 11, 12, 11, 31, 69, 28, 22], ["-", 31, 11, 12, 11, 31, 69, 341, 342, 0, 70], ["+", 8, 1, 0, 34, 12, 34, 12, 34, 0, 21], ["+", 12, 34, 12, 34, 31, 11, 31, 69, 28,...
1
542
// includes #include <bits/stdc++.h> using namespace std; // macros #define pb emplace_back #define mk make_pair #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define irep(itr, st) for (auto itr = (st).begin(); itr != (st)...
// includes #include <bits/stdc++.h> using namespace std; // macros #define pb emplace_back #define mk make_pair #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define irep(itr, st) for (auto itr = (st).begin(); itr != (st)...
[["-", 8, 9, 0, 57, 64, 9, 0, 43, 39, 78], ["-", 0, 57, 64, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 57, 64, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 57, 64, 9, 0, 43, 49, 50, 51, 22], ["-", 8, 9, 0, 57, 64, 9, 0, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 9, 0, 1, 0, 35], ["-", 0, 14, 8, 9, 0, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 9, 0, 43, ...
1
2,292
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) #define reg register typedef long long ll; template <typename T> inline T read() { reg T x = 0; reg short f = 1; reg char c = getchar(); for (; !isdigit(c); f = c == '-...
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) #define reg register typedef long long ll; template <typename T> inline T read() { reg T x = 0; reg short f = 1; reg char c = getchar(); for (; !isdigit(c); f = c == '-...
[["-", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 17, 152], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 12, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 176], ["+", 0, 57, 64, 9, 0, 1...
1
603
#include <cstdio> const int MX = 2001; int ans, k, m, n, u, v; int g[MX][MX]; void dfs(int now, int pre, int dep) { m++; if (dep == 0) return; for (int i = 1; i <= g[now][0]; ++i) if (i != pre) dfs(i, now, dep - 1); } int main() { scanf("%d%d", &n, &k); for (int i = 1; i < n; ++i) { scanf("%...
#include <cstdio> const int MX = 2001; int ans, k, m, n, u, v; int g[MX][MX]; void dfs(int now, int pre, int dep) { m++; if (dep == 0) return; for (int i = 1; i <= g[now][0]; ++i) if (g[now][i] != pre) dfs(g[now][i], now, dep - 1); } int main() { scanf("%d%d", &n, &k); for (int i = 1; i < n; ++i...
[["+", 15, 339, 51, 16, 31, 69, 28, 69, 28, 22], ["+", 51, 16, 31, 69, 28, 69, 341, 342, 0, 70], ["+", 51, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 69, 28, 69, 341, 342, 0, 73], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 2, 3, 4, 0, 69, 28, ...
1
335
#include <bits/stdc++.h> using namespace std; const int maxn = 2020; using arr = array<int, maxn>; int n, k, sz[maxn]; vector<int> g[maxn]; arr dfs(int v, int p) { sz[v] = 1; arr dp; fill(begin(dp), end(dp), 1); for (auto i : g[v]) if (i != p) { arr t = dfs(i, v); for (int i = k; i; i--) ...
#include <bits/stdc++.h> using namespace std; const int maxn = 2020; using arr = array<int, maxn>; int n, k, res = 1 << 30, sz[maxn]; vector<int> g[maxn]; arr dfs(int v, int p) { sz[v] = 1; arr dp; fill(begin(dp), end(dp), 1); for (auto i : g[v]) if (i != p) { arr t = dfs(i, v); for (int i = k;...
[["+", 36, 36, 0, 30, 0, 43, 49, 50, 49, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 17, 151], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 0, 11, 12, 2, 3, 4, 0, 83, 0, 45], ["+", 12,...
1
351
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; template <typename T> void uin(T &a, T b) { if (b < a) a = b; } template <typename T> void...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; template <typename T> void uin(T &a, T b) { if (b < a) a = b; } template <typename T> void...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 64, 9, 0,...
1
659
#include <bits/stdc++.h> #define fr first #define sc second #define pb push_back #define maxheap priority_queue<int> #define minheap priority_queue<int, vector<int>, greater<int>> #define ll long long const int INF = 1e8; const int MAXN = 3e5 + 200; const long double eps = 1e-9; const long double pi = acos(-1.0); using...
#include <bits/stdc++.h> #define fr first #define sc second #define pb push_back #define maxheap priority_queue<int> #define minheap priority_queue<int, vector<int>, greater<int>> #define ll long long const int INF = 1e8; const int MAXN = 3e5 + 200; const long double eps = 1e-9; const long double pi = acos(-1.0); using...
[["-", 0, 30, 0, 43, 49, 80, 49, 80, 81, 13], ["+", 0, 30, 0, 43, 49, 80, 49, 80, 81, 13], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 338, 8, 9, 0, 1, 0, 11, 31, 22], ["+...
1
515
#include <iostream> //#include <bits/stdc++.h> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <queue> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define pb(x) push_back(x) #define F first #define S second using namespace std; const int N = 2000; vector<int...
#include <iostream> //#include <bits/stdc++.h> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <queue> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define pb(x) push_back(x) #define F first #define S second using namespace std; const int N = 2000; vector<int...
[["-", 0, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 0, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22], ["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 22], ["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 21], ["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["-", 31, 16, 12, 2, 3,...
1
353
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #define inf 0x7f7f7f7f using namespace std; typedef long long ll; #define maxn 5000010 void read(int &x) { int f = 1; x = 0; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #define inf 0x7f7f7f7f using namespace std; typedef long long ll; #define maxn 5000010 void read(int &x) { int f = 1; x = 0; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') ...
[["+", 75, 76, 0, 9, 0, 7, 10, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 7, 10, 11, 17, 32], ["+", 75, 76, 0, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 57, 75, 76, 0, 9, 0, 7, 0, 35], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 31, 22], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["+", 75, 76, 0, 9, ...
1
505
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define fo(i, a, b) for (i = a; i <= b; i++) using namespace std; const int maxn = 2005; int dis[maxn], fi[maxn], ne[maxn * 2], dui[maxn * 2], qc[maxn], duii[maxn * 2]; bool bz[maxn]; int i, j, k, l, m, n, x, y, z, ans, to...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define fo(i, a, b) for (i = a; i <= b; i++) using namespace std; const int maxn = 2005; int dis[maxn], fi[maxn], ne[maxn * 2], dui[maxn * 2], qc[maxn], duii[maxn * 2]; bool bz[maxn]; int i, j, k, l, m, n, x, y, z, ans, to...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 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
560
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <tuple> #include <utility> #include <vector> #define int...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <tuple> #include <utility> #include <vector> #define int...
[["+", 0, 9, 0, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13...
1
597
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <random> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #defin...
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <random> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #defin...
[["+", 51, 69, 341, 342, 0, 69, 28, 69, 28, 22], ["+", 341, 342, 0, 69, 28, 69, 341, 342, 0, 70], ["+", 341, 342, 0, 69, 28, 69, 341, 342, 0, 22], ["+", 341, 342, 0, 69, 28, 69, 341, 342, 0, 73], ["+", 51, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["+", 0, 57, 15, 339, 51, 69, 341, 342, 0, 73], ["+", 0, 2, 3, 4, 0, 69, 28...
1
555
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define all(x) x.begin(), x.end() #define ln '\n' const double PI = acos(-1.0); const long long MOD = 1000000007LL; // const long long MOD = 998244353LL; typedef long long ll; typedef unsigne...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define all(x) x.begin(), x.end() #define ln '\n' const double PI = acos(-1.0); const long long MOD = 1000000007LL; // const long long MOD = 998244353LL; typedef long long ll; typedef unsigne...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["-", 8, 9, 0, 57, 64, ...
1
496
#include <bits/stdc++.h> using namespace std; const int N = 2000 + 7; int n, k, mindel[N][N], dep[N][N], under[N], rdp[N]; vector<int> g[N]; bool vis[N]; void dfs(int a) { vector<int> kids; under[a] = 1; vis[a] = 1; for (auto &b : g[a]) { if (vis[b] == 0) { dfs(b); rdp[a] = max(rdp[a], rdp[b]...
#include <bits/stdc++.h> using namespace std; const int N = 2000 + 7; int n, k, mindel[N][N], dep[N][N], under[N], rdp[N]; vector<int> g[N]; bool vis[N]; void dfs(int a) { vector<int> kids; under[a] = 1; vis[a] = 1; for (auto &b : g[a]) { if (vis[b] == 0) { dfs(b); rdp[a] = max(rdp[a], rdp[b]...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 3, 4, 0, 69, 28, 69, 341, 342, 0, 13], ["+", 31, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 0, ...
1
511
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() #define pb push_back template <class T> void chmax(T &a, T b) { if (a < b) a = b; } template <class T> void chmin(T &a, T b) { if (a > b) a = b; } constexpr int...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() #define pb push_back template <class T> void chmax(T &a, T b) { if (a < b) a = b; } template <class T> void chmin(T &a, T b) { if (a > b) a = b; } constexpr int...
[["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 147], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 146], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 11, 31, 69, 341, 342, 0, 69, 28, 22], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 73], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 0, 9...
1
496
// ่ฆ‹ใ›ใฆใ‚„ใ‚‹ใœใ€ๅฅ‡่ทกใฃใฆใ‚„ใคใ‚’ใ‚ˆใ‰โ€ฆโ€ฆ #include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #inclu...
// ่ฆ‹ใ›ใฆใ‚„ใ‚‹ใœใ€ๅฅ‡่ทกใฃใฆใ‚„ใคใ‚’ใ‚ˆใ‰โ€ฆโ€ฆ #include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #inclu...
[["-", 0, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["-", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["-", 51, 16, 31, 2, 63, 118, 28, 69, 28, 22], ["-", 31, 2, 63, 118, 28, 69, 341, 342, 0, 70], ["-", 31, 2, 63, 118, 28, 69, 341, 342, 0, 22], ["-", 31, 2, 63, 118, 28, 69, 341, 342, 0, 73], ["-", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131...
1
732
#include <bits/stdc++.h> using namespace std; #define ll long long #define N 2010 #define M 2010 int hd[N], nx[M], e[M]; int n, k, ans = -1; int dfs(int x, int fa, int dep) { int num = (dep > (k / 2)); for (int i = hd[x]; i; i = nx[i]) if (e[i] != fa) num += dfs(e[i], x, dep + 1); return num; } int main...
#include <bits/stdc++.h> using namespace std; #define ll long long #define N 2010 #define M 4010 int hd[N], nx[M], e[M]; int n, k, ans = -1; int dfs(int x, int fa, int dep) { int num = dep > k / 2; for (int i = hd[x]; i; i = nx[i]) if (e[i] != fa) num += dfs(e[i], x, dep + 1); return num; } int main() {...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 8, 9, 0, 43, 49, 50, 51, 23, 0, 24], ["-", 49, 50, 51, 23, 0, 16, 12, 23, 0, 24], ["-", 49, 50, 51, 23, 0, 16, 12, 23, 0, 25], ["-", 8, 9, 0, 43, 49, 50, 51, 23, 0, 25], ["-", 64, 9, 0, 7, 8, 7, 8, 57, 0, 121], ["-", 0, 7, ...
1
369
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define F first #define S second #define pb push_back #define all(x) (x).begin(), (x).end() #define SZ(x) (int)x.size() //#define int ll const int N = 2010; vector<int> g[N]; int dp[N][N], pref1[N], pref2[N], new_dp[N], mx_h[N]...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define F first #define S second #define pb push_back #define all(x) (x).begin(), (x).end() #define SZ(x) (int)x.size() //#define int ll const int N = 2010; vector<int> g[N]; int dp[N][N], pref1[N], pref2[N], new_dp[N], mx_h[N]...
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["-", 0, 7, 15, 16, 12, 2, 3, 4, 0, 22], ["-", 0, 7, 15, 16, 12, 2, 3, 4, 0, 21], ["-", 15, 16, 12, 2, 3, 4, 0, 2, 63, 22], ["-", 3, 4, 0, 2, 3, 4, 0, 69, 28, 22], ["-", 0, 2, 3, 4, 0, 69, 341...
1
725
#include <bits/stdc++.h> using namespace std; int main() { int V, K; cin >> V >> K; vector<vector<int>> g(V); for (int i = 0; i < V - 1; i++) { int u, v; cin >> u >> v; u--; v--; g[u].push_back(v); g[v].push_back(u); } int res = V - 1; auto dfs = [&](auto f, int n, int p, int d) ->...
#include <bits/stdc++.h> using namespace std; int main() { int V, K; cin >> V >> K; vector<vector<int>> g(V); for (int i = 0; i < V - 1; i++) { int u, v; cin >> u >> v; u--; v--; g[u].push_back(v); g[v].push_back(u); } int res = V; auto dfs = [&](auto f, int n, int p, int d) -> int...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
275
N,K=map(int,input().split()) L=[[]for i in range(N+1)] l=[] for i in range(N-1): a,b=map(int,input().split()) L[a].append(b) L[b].append(a) l.append([a,b]) ans=N if K%2==0: for i in range(1,N+1): C=[10000 for i in range(N+1)] Q=[[i,0]] cnt=1 for q in range(10000): ...
N,K=map(int,input().split()) L=[[]for i in range(N+1)] l=[] for i in range(N-1): a,b=map(int,input().split()) L[a].append(b) L[b].append(a) l.append([a,b]) ans=N if K%2==0: for i in range(1,N+1): C=[10000 for i in range(N+1)] Q=[[i,0]] cnt=0 for q in range(10000): ...
[["-", 0, 7, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 12, 612], ["-", 0, 57, 64, 196, 0, 7, 12, 652, 63, 22], ["-", 64, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 0, 7, 12, 652, 3, 4, 0, 652, 63, 22], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["-", 64, 1...
5
617
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; ll solve() { ll N, K, a, b; cin >> N >> K; vector<vector<int>> G(N); for (int i = 0; i < N - 1; i++) { cin >> a >> b; a--, b--; G[a].push_back(b); G[b].push_back(a); } // v ใ‹ใ‚‰่ท้›ข k-1, k ไปฅๅ†…ใซใ‚ใ‚‹็‚นใฎๆ•ฐ ...
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; int solve() { int N, K, a, b; cin >> N >> K; vector<vector<int>> G(N); for (int i = 0; i < N - 1; i++) { cin >> a >> b; a--, b--; G[a].push_back(b); G[b].push_back(a); } // v ใ‹ใ‚‰่ท้›ข k-1, k ไปฅๅ†…ใซใ‚ใ‚‹็‚นใฎๆ•ฐ function<pii(int, ...
[["-", 36, 36, 36, 36, 0, 30, 0, 360, 141, 78], ["-", 36, 36, 36, 36, 0, 30, 0, 360, 0, 32], ["-", 0, 30, 0, 360, 39, 77, 39, 86, 0, 96], ["-", 36, 36, 36, 36, 0, 30, 0, 360, 0, 35], ["-", 36, 36, 36, 36, 0, 30, 0, 360, 0, 233], ["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 78], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], [...
1
402
#include <bits/stdc++.h> using namespace std; /* ็›ดๅพ„ใŒใ‚‚ใจใ‚‚ใจKไปฅไธ‹ใชใ‚‰0ใงใ‚ˆใใฆใ€Kใ‚ˆใ‚Šๅคงใใ„ใชใ‚‰ใกใ‚‡ใ†ใฉKใซใ—ใŸใ„ใฏใš ๆ นไป˜ใๆœจใง่€ƒใˆใŸๅ ดๅˆใ€ๅ…จ้ƒจๆทฑใ•ใŒK/2ไปฅไธ‹ใใ‚‰ใ„ใชใ‚‰ใ‚ˆใ•ใใ†๏ผŸ ใงใ‚‚ๅฎŸ้š›ใฏใ€ไธ€ใคใฎ่‘‰ใฎๆทฑใ•ใ ใ‘ๅคงใใใฆๆฎ‹ใ‚Šใฎ่‘‰ใฎๆทฑใ•ใ‚’ๆธ›ใ‚‰ใ™ใ ใฃใŸใ‚Šใ€ใใ‚‚ใใ‚‚ๆ น่‡ชไฝ“ใ‚’ไฝฟใ‚ใชใ„้ธๆŠž่‚ขใ‚‚ใ‚ใ‚‹ ๅ‡บๆฅไธŠใŒใ‚‹ใฎใ‚‚ๆœจใงใ€่ท้›ขใŒKใซใชใ‚‹่‘‰ใฎ็ต„ใฟใŒๅญ˜ๅœจใ™ใ‚‹ ใใ‚Œใ‚‰ใ‚’็ตใ‚“ใงใ€ใใ“ใ‹ใ‚‰ใฎใใ‚Œใฏใใ„ใคใ‚‰ใ‚’่ถŠใ•ใชใ„ใ‚ˆใ†ใซใ™ใ‚‹ใฎใงไธ€ๆ„ใซๆฑบใพใ‚‹ ใคใพใ‚Š๏ผŸ่ท้›ขใŒKใฎ2็‚นใ‚’้ธใถใฎใŒ2e6้€šใ‚Š ใใ“ใ‹ใ‚‰้€ฒใ‚“ใงใ„ใใฎใŒ2e3้€šใ‚Š๏ผŸ ่ท้›ขใŒKใฎ็‚นใฏKใŒ2ใ ใฃใŸใ‚Šใ™ใ‚‹ใจใ†ใซใงๆฒขๅฑฑ ่ท้›ขใŒKใฎ็‚นใงใ‚‚ไธ€ๅ›ž่ฆ‹ใŸใ‚„ใคใฏใชใใ™...
#include <bits/stdc++.h> using namespace std; /* ็›ดๅพ„ใŒใ‚‚ใจใ‚‚ใจKไปฅไธ‹ใชใ‚‰0ใงใ‚ˆใใฆใ€Kใ‚ˆใ‚Šๅคงใใ„ใชใ‚‰ใกใ‚‡ใ†ใฉKใซใ—ใŸใ„ใฏใš ๆ นไป˜ใๆœจใง่€ƒใˆใŸๅ ดๅˆใ€ๅ…จ้ƒจๆทฑใ•ใŒK/2ไปฅไธ‹ใใ‚‰ใ„ใชใ‚‰ใ‚ˆใ•ใใ†๏ผŸ ใงใ‚‚ๅฎŸ้š›ใฏใ€ไธ€ใคใฎ่‘‰ใฎๆทฑใ•ใ ใ‘ๅคงใใใฆๆฎ‹ใ‚Šใฎ่‘‰ใฎๆทฑใ•ใ‚’ๆธ›ใ‚‰ใ™ใ ใฃใŸใ‚Šใ€ใใ‚‚ใใ‚‚ๆ น่‡ชไฝ“ใ‚’ไฝฟใ‚ใชใ„้ธๆŠž่‚ขใ‚‚ใ‚ใ‚‹ ๅ‡บๆฅไธŠใŒใ‚‹ใฎใ‚‚ๆœจใงใ€่ท้›ขใŒKใซใชใ‚‹่‘‰ใฎ็ต„ใฟใŒๅญ˜ๅœจใ™ใ‚‹ ใใ‚Œใ‚‰ใ‚’็ตใ‚“ใงใ€ใใ“ใ‹ใ‚‰ใฎใใ‚Œใฏใใ„ใคใ‚‰ใ‚’่ถŠใ•ใชใ„ใ‚ˆใ†ใซใ™ใ‚‹ใฎใงไธ€ๆ„ใซๆฑบใพใ‚‹ ใคใพใ‚Š๏ผŸ่ท้›ขใŒKใฎ2็‚นใ‚’้ธใถใฎใŒ2e6้€šใ‚Š ใใ“ใ‹ใ‚‰้€ฒใ‚“ใงใ„ใใฎใŒ2e3้€šใ‚Š๏ผŸ ่ท้›ขใŒKใฎ็‚นใฏKใŒ2ใ ใฃใŸใ‚Šใ™ใ‚‹ใจใ†ใซใงๆฒขๅฑฑ ่ท้›ขใŒKใฎ็‚นใงใ‚‚ไธ€ๅ›ž่ฆ‹ใŸใ‚„ใคใฏใชใใ™...
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 338, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 338, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 338, 8, 9, 0, 1, 0, 35], ["-", 0, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["-", 0, 7, 8, 9, 0, 1, 0, 16...
1
480
/* When you walk through a storm Hold your head up high And don't be afraid of the dark At the end of the storm There's a golden sky And the sweet silver song of the lark Walk on, through the wind Walk on, through the rain Though your dreams be tossed and blown Walk on, walk on With hope in your heart And you'll never ...
/* When you walk through a storm Hold your head up high And don't be afraid of the dark At the end of the storm There's a golden sky And the sweet silver song of the lark Walk on, through the wind Walk on, through the rain Though your dreams be tossed and blown Walk on, walk on With hope in your heart And you'll never ...
[["+", 0, 7, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13...
1
1,203
/// A drunk man will find his way home, but a drunk bird may get lost forever... #include <bits/stdc++.h> using namespace std; #define pb push_back #define f first #define s second #define int long long #define sz(x) (int)x.size() const int mx = 2002; int n, k, t, h[mx]; vector<int> ad[mx]; vector<pair<int, int>> e; bo...
/// A drunk man will find his way home, but a drunk bird may get lost forever... #include <bits/stdc++.h> using namespace std; #define pb push_back #define f first #define s second #define int long long #define sz(x) (int)x.size() const int mx = 2002; int n, k, t, h[mx]; vector<int> ad[mx]; vector<pair<int, int>> e; bo...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 22], ["+", 64, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 7, 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, 2...
1
418
#include <bits/stdc++.h> using namespace std; const int N = 2010; vector<int> G[N]; bool fre[N]; int n, maxDist; int visit(int par, int u, int depth) { int ans = 1; if (depth == maxDist / 2) return ans; for (int v : G[u]) { if (v != par) ans += visit(u, v, depth + 1); } return ans; } int mai...
#include <bits/stdc++.h> using namespace std; const int N = 2010; vector<int> G[N]; int n, maxDist; int visit(int par, int u, int depth) { int ans = 1; if (depth == maxDist / 2) return ans; for (int v : G[u]) { if (v != par) ans += visit(u, v, depth + 1); } return ans; } int main() { // fr...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 49, 22], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 0, 70], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 22], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 0, 73], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["-", 0, 7, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0...
1
265
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication19 { class Program { static void Main(string[] args) { string s; while ((s = (Console.ReadLine())) != null) { var a = s.Split(',').Select(int.Parse).ToArray(); int b, c; b = c =...
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication19 { class Program { static void Main(string[] args) { string s; int b, c; b = c = 0; while ((s = (Console.ReadLine())) != null) { var a = s.Split(',').Select(int.Parse).ToArra...
[["+", 0, 195, 8, 196, 0, 197, 0, 198, 39, 199], ["+", 8, 196, 0, 197, 0, 198, 0, 200, 141, 22], ["+", 0, 195, 8, 196, 0, 197, 0, 198, 0, 21], ["+", 8, 201, 0, 195, 8, 196, 0, 197, 0, 35], ["+", 0, 195, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 8, 196, 0, 1, 0, 11, 12, 11, 31, 22], ...
8
158
using System; using System.Linq; class Program { static void Main(string[] args) { int x = 0, y = 0; //// while (true) { string st = Console.ReadLine(); if (st == null) { break; } int[] a = st.Split(',').Select(int.Parse).ToArray(); // Array.Sort(a); if (a[0] * a[0...
using System; using System.Linq; class Program { static void Main(string[] args) { int x = 0, y = 0; //// while (true) { string st = Console.ReadLine(); if (st == null) { break; } int[] a = st.Split(',').Select(int.Parse).ToArray(); // Array.Sort(a); if (a[0] * a[0...
[["-", 0, 52, 8, 196, 0, 57, 15, 16, 17, 98], ["-", 0, 57, 15, 16, 12, 16, 31, 204, 205, 22], ["-", 15, 16, 12, 16, 31, 204, 206, 207, 0, 70], ["-", 12, 16, 31, 204, 206, 207, 0, 28, 0, 203], ["-", 15, 16, 12, 16, 31, 204, 206, 207, 0, 73], ["-", 8, 196, 0, 57, 15, 16, 12, 16, 17, 47], ["-", 0, 57, 15, 16, 12, 16, 12, ...
8
162
using System; namespace ConsoleApplication1 { class Program { static string yn(string[] str) { int bmax = 0, amax = 0; for (int n = 0; n < 10; n++) { if (amax > bmax) { if (amax < int.Parse(str[n])) amax = int.Parse(str[n]); else if (bmax < int.Parse(str[n])) bmax = ...
using System; namespace OJcsharp { class Program { static string yn(string[] str) { int xmax = 0, ymax = 0; for (int n = 0; n < 10; n++) { if (xmax > ymax) { if (xmax < int.Parse(str[n])) xmax = int.Parse(str[n]); else { if (ymax < int.Parse(str[n])) ymax...
[["-", 36, 36, 36, 36, 0, 208, 0, 209, 141, 22], ["+", 36, 36, 36, 36, 0, 208, 0, 209, 141, 22], ["-", 8, 196, 0, 197, 0, 198, 0, 200, 141, 22], ["+", 8, 196, 0, 197, 0, 198, 0, 200, 141, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 16, 31, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 31, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 16, 12, ...
8
283
using System; using System.Linq; using System.Collections.Generic; namespace AOJ { class Program { static void Main() { for (int count = int.Parse(Console.ReadLine()); count > 0; --count) { bool success = true; int[] top = new[] { 0, 0 }; foreach (int item in Console.ReadLine() ...
using System; using System.Linq; using System.Collections.Generic; namespace AOJ { class Program { static void Main() { for (int count = int.Parse(Console.ReadLine()); count > 0; --count) { bool success = true; int[] top = new[] { 0, 0 }; foreach (int item in Console.ReadLine() ...
[["-", 0, 210, 8, 196, 0, 57, 15, 16, 17, 106], ["-", 0, 57, 15, 16, 12, 16, 31, 204, 205, 22], ["-", 15, 16, 12, 16, 31, 204, 206, 207, 0, 70], ["-", 12, 16, 31, 204, 206, 207, 0, 28, 0, 203], ["-", 15, 16, 12, 16, 31, 204, 206, 207, 0, 73], ["-", 8, 196, 0, 57, 15, 16, 12, 16, 17, 18], ["-", 8, 196, 0, 57, 15, 16, 12...
8
168
using System; class train { public static void Main() { var s = (Console.ReadLine()).Split(','); var L = Array.ConvertAll(s, int.Parse); int v1 = L[10], v2 = L[11], k1 = 0, k2 = 0, answer = 0; double Length; for (int i = 0; i <= 9; i++) { k1 += L[i]; } Length = v1 * k1 / (double)(v...
using System; class train { public static void Main() { while (true) { var t = Console.ReadLine(); if (t == null) break; var s = t.Split(','); var L = Array.ConvertAll(s, int.Parse); int v1 = L[10], v2 = L[11], k1 = 0, k2 = 0, answer = 0; double Length; for (int...
[["+", 8, 201, 0, 195, 8, 196, 0, 52, 0, 89], ["+", 8, 201, 0, 195, 8, 196, 0, 52, 0, 24], ["+", 0, 195, 8, 196, 0, 52, 15, 211, 0, 146], ["+", 8, 201, 0, 195, 8, 196, 0, 52, 0, 25], ["+", 0, 195, 8, 196, 0, 52, 8, 196, 0, 45], ["-", 8, 196, 0, 197, 0, 198, 0, 200, 141, 22], ["+", 8, 196, 0, 197, 0, 198, 0, 200, 141, 2...
8
178
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _0055 { class Program { static void Main(string[] args) { while (true) { double ans = 0; string gh = Console.ReadLine(); if (gh == null) { break; } double a = double.Parse(gh); ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _0055 { class Program { static void Main(string[] args) { while (true) { string gh = Console.ReadLine(); if (gh == null) { break; } double a = double.Parse(gh); double ans = a; ...
[["-", 0, 52, 8, 196, 0, 197, 0, 198, 39, 199], ["-", 8, 196, 0, 197, 0, 198, 0, 200, 141, 22], ["-", 0, 197, 0, 198, 0, 200, 0, 212, 0, 32], ["-", 0, 197, 0, 198, 0, 200, 0, 212, 0, 203], ["-", 8, 196, 0, 52, 8, 196, 0, 197, 0, 35], ["+", 8, 196, 0, 52, 8, 196, 0, 197, 0, 35], ["+", 0, 52, 8, 196, 0, 197, 0, 198, 39, ...
8
132
using System.Collections.Generic; using System.Linq; using System; public class hello { public static void Main() { var plist = GeneratePrime(50000); while (true) { var n = int.Parse(Console.ReadLine().Trim()); if (n == 0) break; if (n % 2 == 1) { Console.WriteLine(0); ...
using System.Collections.Generic; using System.Linq; using System; public class hello { public static void Main() { var plist = GeneratePrime(50000); while (true) { var n = int.Parse(Console.ReadLine().Trim()); if (n == 0) break; var count = 0; for (int i = 0; plist[i] <= n / ...
[["-", 8, 196, 0, 52, 8, 196, 0, 57, 0, 121], ["-", 8, 196, 0, 52, 8, 196, 0, 57, 0, 24], ["-", 8, 196, 0, 57, 15, 16, 31, 16, 31, 22], ["-", 8, 196, 0, 57, 15, 16, 31, 16, 17, 109], ["-", 8, 196, 0, 57, 15, 16, 31, 16, 12, 203], ["-", 0, 52, 8, 196, 0, 57, 15, 16, 17, 60], ["-", 0, 52, 8, 196, 0, 57, 15, 16, 12, 203],...
8
256
using System; using System.Linq; using System.Collections.Generic; namespace Miscelleneous { class Program { public static int cin() { return int.Parse(Console.ReadLine()); } public static int[] cins() { string s = Console.ReadLine(); if (string.IsNullOrEmpty(s)) return new int[] {}; string[] ss ...
using System; using System.Linq; using System.Collections.Generic; namespace Miscelleneous { class Program { public static int cin() { return int.Parse(Console.ReadLine()); } public static int[] cins() { string s = Console.ReadLine(); if (string.IsNullOrEmpty(s)) return new int[] {}; string[] ss ...
[["+", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["+", 0, 52, 8, 196, 0, 1, 0, 11, 12, 203], ["+", 8, 196, 0, 52, 8, 196, 0, 1, 0, 35], ["-", 0, 52, 8, 196, 0, 7, 8, 196, 0, 46], ["-", 0, 52, 8, 196, 0, 1, 0, 11, 31, 22], ["-", 8, 196, 0, 1, 0, 11, 0, 202, 0, 32], ["-", 0, 1, 0, 11...
8
314
using System; class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); double[,] hen = new double[n, 3]; for (int i = 0; i < n; i++) { string[] s = Console.ReadLine().Split(' '); hen[i, 0] = int.Parse(s[0]); hen[i, 1] = int.Parse(s[1]); hen[i, 2] = i...
using System; class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); double[,] hen = new double[n, 3]; for (int i = 0; i < n; i++) { string[] s = Console.ReadLine().Split(' '); hen[i, 0] = int.Parse(s[0]); hen[i, 1] = int.Parse(s[1]); hen[i, 2] = i...
[["+", 15, 16, 31, 16, 31, 16, 12, 23, 0, 24], ["-", 0, 7, 8, 196, 0, 57, 64, 196, 0, 45], ["-", 64, 196, 0, 1, 0, 213, 63, 214, 205, 22], ["-", 64, 196, 0, 1, 0, 213, 63, 214, 0, 131], ["-", 64, 196, 0, 1, 0, 213, 63, 214, 141, 22], ["-", 64, 196, 0, 1, 0, 213, 3, 4, 0, 24], ["-", 0, 213, 3, 4, 0, 28, 0, 5, 0, 62], ["...
8
326
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace aoj { class Program { static void Main(string[] args) { while (true) { string a = ""; string b = ""; string c = ""; int d = 0; string k = Console.ReadLine(); if (k == null) ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace aoj { class Program { static void Main(string[] args) { while (true) { string a = ""; string b = ""; string c = ""; int d = 0; string k = Console.ReadLine(); if (k == null) ...
[["-", 0, 198, 0, 200, 0, 212, 0, 16, 17, 140], ["-", 0, 198, 0, 200, 0, 212, 0, 16, 12, 203], ["+", 0, 198, 0, 200, 0, 212, 0, 16, 17, 48], ["+", 0, 212, 0, 16, 12, 213, 63, 214, 205, 199], ["+", 0, 212, 0, 16, 12, 213, 63, 214, 0, 131], ["+", 0, 212, 0, 16, 12, 213, 63, 214, 141, 22], ["+", 0, 212, 0, 16, 12, 213, 3,...
8
354
using System; using System.Collections.Generic; using System.Linq; using System.Text; class Program { void Calc() { var sc = new Scanner(); var a = sc.NextInt(); for (int i = 0; i < a; i++) { int b = sc.NextInt(); int c = sc.NextInt(); int d = sc.NextInt(); int[] kasatomo = new i...
using System; using System.Collections.Generic; using System.Linq; using System.Text; class Program { void Calc() { var sc = new Scanner(); var a = sc.NextInt(); for (int i = 0; i < a; i++) { int b = sc.NextInt(); int c = sc.NextInt(); int d = sc.NextInt(); int[] kasatomo = new i...
[["-", 0, 57, 15, 16, 31, 16, 31, 16, 31, 22], ["+", 15, 16, 31, 16, 31, 16, 31, 204, 205, 22], ["+", 31, 16, 31, 16, 31, 204, 206, 207, 0, 70], ["+", 31, 16, 31, 204, 206, 207, 0, 28, 0, 203], ["+", 31, 16, 31, 16, 31, 204, 206, 207, 0, 73], ["-", 0, 57, 15, 16, 31, 16, 31, 16, 12, 22], ["+", 15, 16, 31, 16, 31, 16, 1...
8
318