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
// <candy.cpp> - Sat Mar 25 16:58:17 2017 // This file is created by XuYike's black technology automatically. // Copyright (C) 2015 ChangJun High School, Inc. // I don't know what this program is. #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using nam...
// <candy.cpp> - Sat Mar 25 16:58:17 2017 // This file is created by XuYike's black technology automatically. // Copyright (C) 2015 ChangJun High School, Inc. // I don't know what this program is. #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using nam...
[["+", 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, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 72],...
1
334
#include <algorithm> #include <cstdio> using namespace std; #define rep(x, a, b) for (int x = a; x <= b; x++) int n, a[100100]; int main() { scanf("%d", &n); rep(i, 1, n) scanf("%d", a + i); sort(a + 1, a + n + 1); reverse(a + 1, a + n + 1); a[0] = a[1]; int x = 0; while (x + 1 < n && x + 1 < a[x + 2]) ...
#include <algorithm> #include <cstdio> using namespace std; #define rep(x, a, b) for (int x = a; x <= b; x++) int n, a[100100]; int main() { scanf("%d", &n); rep(i, 1, n) scanf("%d", a + i); sort(a + 1, a + n + 1); reverse(a + 1, a + n + 1); a[0] = a[1]; int x = 0; while (x + 1 < n && x + 1 < a[x + 2]) ...
[["+", 0, 52, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 60], ["-", 0, 52, 15, 339, 51, 16, 12, 69, 28, 22], ["-", 15, 339, 51, 16, 12, 69, 341, 342, ...
1
189
#include <bits/stdc++.h> #define N 100006 using namespace std; int n, p, tmp, a[N]; inline int read() { int x = 0, c = getchar(); while (c < 48) c = getchar(); while (c > 47) x = x * 10 + c - 48, c = getchar(); return x; } void print(int x) { if (x > 9) print(x / 10); putchar(x % 10 + 48); } boo...
#include <bits/stdc++.h> #define N 100006 using namespace std; int n, p, tmp, a[N]; inline int read() { int x = 0, c = getchar(); while (c < 48) c = getchar(); while (c > 47) x = x * 10 + c - 48, c = getchar(); return x; } void print(int x) { if (x > 9) print(x / 10); putchar(x % 10 + 48); } boo...
[["+", 8, 9, 0, 7, 8, 1, 0, 34, 0, 21], ["+", 8, 1, 0, 34, 12, 27, 28, 69, 28, 22], ["+", 0, 34, 12, 27, 28, 69, 341, 342, 0, 70], ["+", 0, 34, 12, 27, 28, 69, 341, 342, 0, 22], ["+", 0, 34, 12, 27, 28, 69, 341, 342, 0, 73], ["+", 0, 7, 8, 1, 0, 34, 12, 27, 17, 29], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 7,...
1
294
// vvvvvvvvvvvvvvvvv Library code start #define NDEBUG NDEBUG #include <algorithm> #include <cassert> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <random> #include <set> #include <sstream> #include <string> #include <tuple> #include <unordered_map> #include <...
// vvvvvvvvvvvvvvvvv Library code start #define NDEBUG NDEBUG #include <algorithm> #include <cassert> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <random> #include <set> #include <sstream> #include <string> #include <tuple> #include <unordered_map> #include <...
[["+", 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, 2, 63, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 1...
1
500
#define NDEBUG NDEBUG #include <algorithm> #include <cassert> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <random> #include <set> #include <sstream> #include <string> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> #define...
#define NDEBUG NDEBUG #include <algorithm> #include <cassert> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <random> #include <set> #include <sstream> #include <string> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> #define...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 49, 50, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 49, 50, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 49, 50, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 49, 50, 51, 16, 31, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["...
1
501
n,*a=`dd`.split.map &:to_i a.reverse! i=(0...n).find{|x|a[x]>=x+1}||n j=(i...n).find{|x|a[x]>=i}||n puts (a[i-1]-i)%2+(j-i)%2>0 ? :First : :Second
n,*a=`dd`.split.map &:to_i;a.sort_by! &:-@;i=(0...n).find{|x|a[x]<x+1}||n;j=(i...n).find{|x|a[x]<i}||n;puts (a[i-1]-i)%2+(j-i)%2>0?:First: :Second
[["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 35], ["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 0, 493, 0, 652, 3, 4, 0, 752, 0, 67], ["+", 0, 493, 0, 652, 3, 4, 0, 752, 0, 753], ["-", 31, 652, 196, 196, 8, 734, 0, 738, 17, 20], ["+", 31, 652, 196, 196, 8, 734, 0, 73...
4
90
n,*a=`dd`.split.map &:to_i;a.reverse!;i=(0...n).find{|x|a[x]<x+1}||n;j=(i...n).find{|x|a[x]<i}||n;puts (a[i-1]-i)%2+(j-i)%2>0?:First: :Second
n,*a=`dd`.split.map &:to_i a=a.sort.reverse i=(0...n).find{|x|a[x]<x+1}||n j=(i...n).find{|x|a[x]<i}||n puts (a[i-1]-i)%2+(j-i)%2>0?:First: :Second
[["-", 36, 36, 36, 36, 36, 36, 0, 493, 0, 35], ["+", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["+", 0, 493, 0, 662, 12, 652, 486, 652, 486, 22], ["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662...
4
94
#include <algorithm> #include <stdio.h> #include <vector> using namespace std; int b[110000]; int main() { int a; scanf("%d", &a); for (int i = 0; i < a; i++) { scanf("%d", b + i); b[i] = -b[i]; } std::sort(b, b + a); for (int i = 0; i < a; i++) b[i] = -b[i]; for (int i = 0; i < a; i++) { ...
#include <algorithm> #include <stdio.h> #include <vector> using namespace std; int b[110000]; int main() { int a; scanf("%d", &a); for (int i = 0; i < a; i++) { scanf("%d", b + i); b[i] = -b[i]; } std::sort(b, b + a); for (int i = 0; i < a; i++) b[i] = -b[i]; for (int i = 0; i < a; i++) { ...
[["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 98], ["+", 12, 23, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 31, 69, 28, 22], ["+", 31, 23, 0, 16, 31, 69, 341, 342, 0,...
1
227
#include <algorithm> #include <stdio.h> using namespace std; int w[101000], n, a1, b1, a2, b2; int main() { int i; scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%d", &w[i]); w[i] = -w[i]; } sort(w + 1, w + n + 1); for (i = 1; i <= n; i++) w[i] = -w[i]; for (i = 1; i <= n; i++) { if (w...
#include <algorithm> #include <stdio.h> using namespace std; int w[101000], n, a1, b1, a2, b2; int main() { int i; scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%d", &w[i]); w[i] = -w[i]; } sort(w + 1, w + n + 1); for (i = 1; i <= n; i++) w[i] = -w[i]; for (i = 1; i <= n; i++) { if (w...
[["+", 31, 16, 12, 23, 0, 16, 12, 16, 17, 109], ["+", 31, 16, 12, 23, 0, 16, 12, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 23, 0, 16, 17, 98], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 31, 22], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 20], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 12, 22], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17,...
1
262
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include...
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include...
[["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 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], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 31, 22], ["+", 3, 4, 0, 69, 341, ...
1
441
#include <bits/stdc++.h> using namespace std; int N, a[100009]; int main() { // freopen ("input", "r", stdin); // freopen ("output", "w", stdout); scanf("%d", &N); for (int i = 1; i <= N; i++) scanf("%d", &a[i]); sort(a + 1, a + N + 1), reverse(a + 1, a + N + 1); int x = 0; a[0] = a[1]; while (a...
#include <bits/stdc++.h> using namespace std; int N, a[100009]; int main() { // freopen ("input", "r", stdin); // freopen ("output", "w", stdout); scanf("%d", &N); for (int i = 1; i <= N; i++) scanf("%d", &a[i]); sort(a + 1, a + N + 1), reverse(a + 1, a + N + 1); int x = 0; a[0] = a[1]; while (a...
[["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 0, 52, 15, 339, 51, 16, 12, ...
1
194
#include <algorithm> #include <iostream> using namespace std; int x, y, n, a[100010], i, flag; main() { cin >> n; if (n == 1) { cout << "First" << endl; return 0; } for (i = 1; i <= n; i++) cin >> a[i]; /*flag=1; for (i=1;i<=n;i++) if (a[i]!=1) { flag=0; break; } ...
#include <algorithm> #include <iostream> using namespace std; int x, y, n, a[100010], i, flag; main() { cin >> n; /*if (n==1) { cout<<"First"<<endl; return 0; }*/ for (i = 1; i <= n; i++) cin >> a[i]; /*flag=1; for (i=1;i<=n;i++) if (a[i]!=1) { flag=0; b...
[["-", 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
196
#include <algorithm> #include <cassert> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; #define TRACE(x) cerr << #x << " = " << x << endl typedef long long ll; typedef pair<int, int> P; #define X first #define Y second const int MAX = 1 << 17; int p[MAX]; int jelnul[M...
#include <algorithm> #include <cassert> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; #define TRACE(x) cerr << #x << " = " << x << endl typedef long long ll; typedef pair<int, int> P; #define X first #define Y second const int MAX = 1 << 17; int p[MAX]; int jelnul[M...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 31, 22], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 33], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 15, 339, 51, 16, 12, 16, 31, 6...
1
359
#include <algorithm> #include <cassert> #include <cstring> #include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define TRACE(x) cout << #x << " = " << x << endl #define _ << " _ " << typedef long long llint; const int MAX = 100100; int a[MAX]...
#include <algorithm> #include <cassert> #include <cstring> #include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define TRACE(x) cout << #x << " = " << x << endl #define _ << " _ " << typedef long long llint; const int MAX = 100100; int a[MAX]...
[["+", 8, 9, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 1, 0, 11, 12, 118, 28, 69, 28, 22], ["+", 0, 11, 12, 118, 28, 69, 341, 342, 0, 70], ["+", 12, 118, 28, 69, 341, 342, 0, 16, 31, 22], ["+", 12, 118, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 12, 118, 28, 69, 341, 342, 0, 16, 12, 13]...
1
398
#include <bits/stdc++.h> using namespace std; #define INF 1000000000 #define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++) typedef long long LL; vector<LL> v; int main() { int N; cin >> N; REP(i, N) { LL a; cin >> a; v.push_back(a + 1); } sort(v.begin(), v.end(), std::greater<LL>()); /* RE...
#include <bits/stdc++.h> using namespace std; #define INF 1000000000 #define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++) typedef long long LL; vector<LL> v; int main() { int N; cin >> N; REP(i, N) { LL a; cin >> a; v.push_back(a); } sort(v.begin(), v.end(), std::greater<LL>()); // REP(i,N)...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 2...
1
225
#include <bits/stdc++.h> const int maxn = 1e5 + 10; int a[maxn], n; bool cmp(int a, int b) { return a < b; } int main() { std::cin >> n; for (int i = 1; i <= n; i++) { std::cin >> a[i]; } std::sort(a + 1, a + n + 1, cmp); int p = 1; for (int i = 1; i <= n; i++) { p = i; if (a[i] < i) { bre...
#include <bits/stdc++.h> const int maxn = 1e5 + 10; int a[maxn], n; bool cmp(int a, int b) { return a > b; } int main() { std::cin >> n; for (int i = 1; i <= n; i++) { std::cin >> a[i]; } std::sort(a + 1, a + n + 1, cmp); int p = 1; for (int i = 1; i <= n; i++, p = i) { if (a[i] < i) { break; ...
[["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 17, 47], ["-", 0, 30, 0, 14, 8, 9, 0, 7, 0, 25], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 7, 26, 34, 0, 21], ["-", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 25], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45]...
1
227
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> using namespace std; int a[100010]; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n; scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a + 1, a + n + 1); for (int...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> using namespace std; int a[100010]; int main() { int n; scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a + 1, a + n + 1); for (int i = 1; i <= n / 2; i++) swap(a[i], a[n + 1 - i]); int k = 1; whil...
[["-", 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
258
#include <algorithm> #include <functional> #include <stdio.h> #include <vector> using namespace std; #define all(A) (A).begin(), (A).end() #define II(A) \ int(A); \ scanf("%d", &(A)...
#include <algorithm> #include <functional> #include <stdio.h> #include <vector> using namespace std; #define all(A) (A).begin(), (A).end() #define II(A) \ int(A); \ scanf("%d", &(A)...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 46], ["-", 3...
1
318
#include <algorithm> #include <functional> #include <stdio.h> #include <vector> using namespace std; #define all(A) (A).begin(), (A).end() #define II(A) \ int(A); \ scanf("%d", &(A)...
#include <algorithm> #include <functional> #include <stdio.h> #include <vector> using namespace std; #define all(A) (A).begin(), (A).bumsoo() #define II(A) \ int(A); \ scanf("%d", &...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 49, 22], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 49, 22], [...
1
322
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 64, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["+", 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, 13], ["+", 64, 9, 0, 57, 64, 9, 0, 43, 0, 21], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 9,...
1
629
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 11, 1...
1
630
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define forn(i, a, n) for (int i = a; i < n; ++i) #define ford(i, a, n) for (int i = n - 1; i >= a; --i) #define fore(i, a, n) for (int i = a; i <= n; ++i) #define all(a) (a).begin(), (a).end() ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define forn(i, a, n) for (int i = a; i < n; ++i) #define ford(i, a, n) for (int i = n - 1; i >= a; --i) #define fore(i, a, n) for (int i = a; i <= n; ++i) #define all(a) (a).begin(), (a).end() ...
[["-", 75, 76, 0, 9, 0, 1, 0, 11, 17, 107], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 11, 12, 16, 31, 16, 31, 69, 28, 22], ["+", 12, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 12, 16, 31, 16, 31, 69, 341, 342, 0, 22], ["+", 12, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["...
1
525
#include <algorithm> #include <stdio.h> #include <vector> using namespace std; int main() { int num; scanf("%d", &num); vector<int> vec; for (int i = 0; i < num; i++) { int z; scanf("%d", &z); vec.push_back(z); } sort(vec.begin(), vec.end()); vec.push_back(0); reverse(vec.begin(), vec.end())...
#include <algorithm> #include <stdio.h> #include <vector> using namespace std; int main() { int num; scanf("%d", &num); vector<int> vec; for (int i = 0; i < num; i++) { int z; scanf("%d", &z); vec.push_back(z); } sort(vec.begin(), vec.end()); vec.push_back(2000000000); reverse(vec.begin(), v...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]...
1
268
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <set> #include <sstream> #include <vector> using namespace std; using ll = long long; class range { private: struct I { int x; int operator*() { return x; } bool operator!=(I &lhs) {...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <set> #include <sstream> #include <vector> using namespace std; using ll = long long; class range { private: struct I { int x; int operator*() { return x; } bool o...
[["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 0, 35], ["+", 8, 9, 0, 52, 8, 9, 0, 7, 0, 88], ["+", 0, 52, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 7, ...
1
378
#include <bits/stdc++.h> using namespace std; #define PB push_back #define MP make_pair #define LL long long #define int LL #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define RE(i, n) FOR(i, 1, n) #define REP(i, n) FOR(i, 0, (int)(n)-1) #define R(i, n) REP(i, n) #define VI vector<int> #define PII pair<int, ...
#include <bits/stdc++.h> using namespace std; #define PB push_back #define MP make_pair #define LL long long #define int LL #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define RE(i, n) FOR(i, 1, n) #define REP(i, n) FOR(i, 0, (int)(n)-1) #define R(i, n) REP(i, n) #define VI vector<int> #define PII pair<int, ...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["-", 0, 52, 8, 9, 0, 52, 8, 1, 0, 35], ["-", 0, 52, 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, 21], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25...
1
499
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <valarray> #include <vector> using namespace ...
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <valarray> #include <vector> using namespace ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["-", 8, 9, 0,...
1
276
#include <bits/stdc++.h> #define int long long #define N 5005 using namespace std; const int mod = 1e9 + 7; int n, k, f[N][N], jc[N], invjc[N]; int power(int x, int y) { int ans = 1; for (; y; y >>= 1, x = 1LL * x * x % mod) { if (y & 1) ans = 1LL * ans * x % mod; } return ans; } void init() { jc[0]...
#include <bits/stdc++.h> #define int long long #define N 4000005 using namespace std; const int mod = 1e9 + 7; int n, k, f[2005][2005], jc[N], invjc[N]; int power(int x, int y) { int ans = 1; for (; y; y >>= 1, x = 1LL * x * x % mod) { if (y & 1) ans = 1LL * ans * x % mod; } return ans; } void init() ...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 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], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, ...
1
435
#include <bits/stdc++.h> #define int long long #define N 4000005 #define MOD 1000000007 using namespace std; int n, k, f[2005][2005], inv[N], fac[N], infac[N]; int C(int x, int y) { return x >= y ? fac[x] * infac[y] % MOD * infac[x - y] % MOD : 0; } signed main() { cin >> n >> k; if (k == 1) { cout << 1 << en...
#include <bits/stdc++.h> #define int long long #define N 4000005 #define MOD 1000000007 using namespace std; int n, k, f[2005][2005], inv[N], fac[N], infac[N]; int C(int x, int y) { return x >= y ? fac[x] * infac[y] % MOD * infac[x - y] % MOD : 0; } signed main() { cin >> n >> k; if (k == 1) { cout << 1 << en...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 15, 16, 31, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 98], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 19], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 16,...
1
377
#include <cstdio> const int mod = 1e9 + 7; const int MAXN = 2005, MAXS = MAXN * MAXN; template <typename _T> void read(_T &x) { x = 0; char s = getchar(); int f = 1; while (s > '9' || s < '0') { if (s == '-') f = -1; s = getchar(); } while (s >= '0' && s <= '9') { x = (x << 3) + (x << 1)...
#include <cstdio> const int mod = 1e9 + 7; const int MAXN = 2005, MAXS = MAXN * MAXN; template <typename _T> void read(_T &x) { x = 0; char s = getchar(); int f = 1; while (s > '9' || s < '0') { if (s == '-') f = -1; s = getchar(); } while (s >= '0' && s <= '9') { x = (x << 3) + (x << 1)...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 17, 98], ["-", 0, 7, 8, 7, 15, 16, 12, 16, 31, 22], ["-", 0, 7, 8, 7, 15, 16, 12, 16, 17, 19], ["-", 0, 7, 8, 7, 15, 16, 12, 16, 12, 22], ["-", 3, 4, 0, 69, 28, 69, 341, 342, 0, 22], ["+", 3, 4, 0, 69, 2...
1
713
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) typedef long long LL; const LL mod = 1e9 + 7; // head const int maxn = 2e3 + 5; int n, k; LL f[maxn][maxn], fac[maxn * maxn], inv[maxn * maxn]; LL ksm(LL a, LL b) { LL res...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) typedef long long LL; const LL mod = 1e9 + 7; // head const int maxn = 2e3 + 5; int n, k; LL f[maxn][maxn], fac[maxn * maxn], inv[maxn * maxn]; LL ksm(LL a, LL b) { LL res...
[["+", 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
378
// Be Name Khoda, Besmellah Rahmane Rahim, In The Name Of God; //#include<bits/stdc++.h> #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #...
// Be Name Khoda, Besmellah Rahmane Rahim, In The Name Of God; //#include<bits/stdc++.h> #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #...
[["-", 0, 16, 31, 16, 12, 69, 28, 69, 28, 22], ["-", 31, 16, 12, 69, 28, 69, 341, 342, 0, 70], ["-", 31, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["-", 31, 16, 12, 69, 28, 69, 341, 342, 0, 73], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["-", 0, 16, 31, 16, 12, 69, 341, 3...
1
560
#include <bits/stdc++.h> #define DEBUG using namespace std; typedef long long ll; typedef unsigned long long ull; ll read() { char c = getchar(); bool flag = 0; ll x = 0; while (c < '0' || c > '9') { if (c == '-') flag = 1; c = getchar(); } while (c >= '0' && c <= '9') { x = (x << 3) + (x ...
#include <bits/stdc++.h> #define DEBUG using namespace std; typedef long long ll; typedef unsigned long long ull; ll read() { char c = getchar(); bool flag = 0; ll x = 0; while (c < '0' || c > '9') { if (c == '-') flag = 1; c = getchar(); } while (c >= '0' && c <= '9') { x = (x << 3) + (x ...
[["-", 31, 16, 12, 69, 341, 342, 0, 69, 28, 22], ["-", 12, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 73], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 73], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 12, 16, 12, 16, 31, 16, 31, 16, 17, 1...
1
523
#include <bits/stdc++.h> using namespace std; #define N 2005 const int mod = 1000000007; #define add(x, y) (x + y >= mod ? x + y - mod : x + y) #define dec(x, y) (x < y ? x - y + mod : x - y) int Pow(int x, int k) { int ans = 1, base = x; while (k) { if (k & 1) ans = 1ll * ans * base % mod; base = ...
#include <bits/stdc++.h> using namespace std; #define N 2005 const int mod = 1000000007; #define add(x, y) (x + y >= mod ? x + y - mod : x + y) #define dec(x, y) (x < y ? x - y + mod : x - y) int Pow(int x, int k) { int ans = 1, base = x; while (k) { if (k & 1) ans = 1ll * ans * base % mod; base = ...
[["+", 0, 30, 0, 43, 49, 80, 81, 16, 17, 48], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 12, 22], ["+", 0, 30, 0, 43, 49, 80, 81, 16, 31, 22], ["+", 8, 1, 0, 34, 31, 11, 12, 16, 17, 109], ["+", 8, 1, 0, 34, 31, 11, 12, 16, 12, 22], ["+", 0, 23, 0, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 23, 0, 16, 31, 16, 31, 16, 12, 22]]
1
378
/* Author: zxy_hhhh date: 2020/03/12 */ #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define ll long long inline ll rd() { ll _x = 0; int _ch = getchar(), _f = 1; for (; !is...
/* Author: zxy_hhhh date: 2020/03/12 */ #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define ll long long inline ll rd() { ll _x = 0; int _ch = getchar(), _f = 1; for (; !is...
[["-", 0, 30, 0, 14, 8, 9, 0, 171, 0, 184], ["-", 0, 30, 0, 14, 8, 9, 0, 171, 141, 22], ["-", 8, 9, 0, 171, 0, 1, 0, 2, 63, 22], ["-", 0, 171, 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], ["-", 0, 171, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 0, 171, 0, 1, 0, 2, 3, 4, 0, 2...
1
612
#include <bits/stdc++.h> using namespace std; int read() { int x = 0; char c = getchar(); int flag = 1; while (!isdigit(c)) { if (c == '-') flag = -1; c = getchar(); } while (isdigit(c)) { x = ((x + (x << 2)) << 1) + (c ^ 48); c = getchar(); } return x * flag; } const int mod = 1...
#include <bits/stdc++.h> using namespace std; int read() { int x = 0; char c = getchar(); int flag = 1; while (!isdigit(c)) { if (c == '-') flag = -1; c = getchar(); } while (isdigit(c)) { x = ((x + (x << 2)) << 1) + (c ^ 48); c = getchar(); } return x * flag; } const int mod = 1...
[["+", 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], ["+", 0, 57, 64...
1
536
#include <bits/stdc++.h> using namespace std; #define ll long long const int p = 1e9 + 7, N = 4010, M = 4e6 + 5; int dp[N][N], fac[M], finv[M], inv[M]; int comb(int n, int m) { return n < m ? 0 : fac[n] * 1ll * finv[m] % p * finv[n - m] % p; } int main() { int n = 4e6, k; fac[1] = fac[0] = finv[1] = finv[0] = inv...
#include <bits/stdc++.h> using namespace std; #define ll long long const int p = 1e9 + 7, N = 4010, M = 4e6 + 5; int dp[N][N], fac[M], finv[M], inv[M]; int comb(int n, int m) { return n < m ? 0 : fac[n] * 1ll * finv[m] % p * finv[n - m] % p; } int main() { int n = 4e6, k; fac[1] = fac[0] = finv[1] = finv[0] = inv...
[["+", 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
367
#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 MOD = 1e9 + 7; void add(int &a, int b) { a += b; if (a >= MOD) { a -= M...
#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 MOD = 1e9 + 7; void add(int &a, int b) { a += b; if (a >= MOD) { a -= M...
[["+", 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
551
#include <cstdio> using namespace std; typedef long long LL; const int maxn = 2005, TT = 1000000007; int n, K, fac[maxn * maxn], inv[maxn * maxn], F[maxn][maxn]; inline int read() { int ret = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -f; ch = getchar(); } w...
#include <cstdio> using namespace std; typedef long long LL; const int maxn = 2005, TT = 1000000007; int n, K, fac[maxn * maxn], inv[maxn * maxn], F[maxn][maxn]; inline int read() { int ret = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -f; ch = getchar(); } w...
[["+", 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], ["+", 0, 57, 64...
1
497
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int __SIZE = 1 << 18; char ibuf[__SIZE], *iS, *iT; #define ge \ (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), \ (iS == iT ? EO...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int __SIZE = 1 << 18; char ibuf[__SIZE], *iS, *iT; #define ge \ (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), \ (iS == iT ? EO...
[["+", 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, 37, 0, 38], ["+", 0, 57, 6...
1
612
#include <cstdio> typedef long long ll; inline ll rd() { ll x = 0, p = 1; char a = getchar(); while ((a < 48 || a > 57) && a != '-') a = getchar(); if (a == '-') p = -p, a = getchar(); while (a > 47 && a < 58) x = (x << 1) + (x << 3) + (a & 15), a = getchar(); return x * p; } const int N = 2002;...
#include <cstdio> typedef long long ll; inline ll rd() { ll x = 0, p = 1; char a = getchar(); while ((a < 48 || a > 57) && a != '-') a = getchar(); if (a == '-') p = -p, a = getchar(); while (a > 47 && a < 58) x = (x << 1) + (x << 3) + (a & 15), a = getchar(); return x * p; } const int N = 2002;...
[["+", 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, 37, 0, 38], ["+", 0, 57, 6...
1
509
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; #define rg register void read(int &x) { char ch; bool ok; for (ok = 0, ch = getchar(); !isdigit(ch); ch = getchar()) if (ch == '-') ok = 1; for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; #define rg register void read(int &x) { char ch; bool ok; for (ok = 0, ch = getchar(); !isdigit(ch); ch = getchar()) if (ch == '-') ok = 1; for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())...
[["+", 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, 37, 0, 38], ["+", 0, 57, 6...
1
569
#include <bits/stdc++.h> #define mod 1000000007 #define maxn 2005 #define ll long long using namespace std; ll silnia[maxn * maxn]; ll dp[maxn][maxn]; void licz(int zosia) { silnia[0] = 1; for (int i = 1; i <= zosia; ++i) { ll a = i; silnia[i] = (silnia[i - 1] * a) % mod; } } ll qpow(ll zosia, int n)...
#include <bits/stdc++.h> #define mod 1000000007 #define maxn 2005 #define ll long long using namespace std; ll silnia[maxn * maxn]; ll dp[maxn][maxn]; void licz(int zosia) { silnia[0] = 1; for (int i = 1; i <= zosia; ++i) { ll a = i; silnia[i] = (silnia[i - 1] * a) % mod; } } ll qpow(ll zosia, int n)...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 48], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 2, 3, 4, 0, 16, 12, 16, 17, 48], ["+", 0, 2, 3, 4, 0, 16, 12, 16, 12, 22], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 7, 10, 43, 49, 50, 51, 2, 63, 22], ["+", 10, 43, 49, 50, 51,...
1
391
#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, 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], ["+", 0, 57, 64...
1
772
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int ad(int x, int y) { x += y; return x >= mod ? x - mod : x; } int sb(int x, int y) { x -= y; return x < 0 ? x + mod : x; } int mu(int x, int y) { return 1ll * x * y % mod; } int ksm(int a, int b) { int ans = 1; for (; b; b >>= 1, a = ...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int ad(int x, int y) { x += y; return x >= mod ? x - mod : x; } int sb(int x, int y) { x -= y; return x < 0 ? x + mod : x; } int mu(int x, int y) { return 1ll * x * y % mod; } int ksm(int a, int b) { int ans = 1; for (; b; b >>= 1, a = ...
[["+", 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], ["+", 0, 57, 64...
1
462
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef double db; #define go(u) for (int i = head[u], v = e[i].to; i; i = e[i].lst, v = e[i].to) #define rep(i, a, b) for (int i = a; i <= b; ++i) #define pb push_back #define re(x) memset(x, 0, sizeof x) inline int gi() { int x = 0, f = 1; char c...
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef double db; #define go(u) for (int i = head[u], v = e[i].to; i; i = e[i].lst, v = e[i].to) #define rep(i, a, b) for (int i = a; i <= b; ++i) #define pb push_back #define re(x) memset(x, 0, sizeof x) inline int gi() { int x = 0, f = 1; char c...
[["+", 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, 37, 0, 38], ["+", 0, 57, 6...
1
560
#include <bits/stdc++.h> using namespace std; using uint = unsigned int; using ull = unsigned long long; template <uint MOD> struct modnum { using num = modnum; uint v; modnum(uint _v = 0) : v(_v) {} num &operator+=(const num &r) { if ((v += r.v) >= MOD) v -= MOD; return *this; } num &operat...
#include <bits/stdc++.h> using namespace std; using uint = unsigned int; using ull = unsigned long long; template <uint MOD> struct modnum { using num = modnum; uint v; modnum(uint _v = 0) : v(_v) {} num &operator+=(const num &r) { if ((v += r.v) >= MOD) v -= MOD; return *this; } num &operat...
[["+", 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], ["+", 0, 57, 64...
1
637
#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 2050 #define MAXM MAXN *MAXN #define mod 1000000007 #define inf (1 << 30) #define eps (1e-6) #define alpha 0.75 #define rep(i, x, y) f...
#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 2050 #define MAXM MAXN *MAXN #define mod 1000000007 #define inf (1 << 30) #define eps (1e-6) #define alpha 0.75 #define rep(i, x, y) f...
[["+", 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, 22], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 13], ["+", 0, 14, 8...
1
667
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int n, x, y, z; int dp[41][131100]; int main() { scanf("%d", &n); scanf("%d%d%d", &x, &y, &z); dp[0][0] = 1; int mx_mask = (1 << (x + y + z)) - 1; int bad_mask = (1 << (z - 1)) | (1 << (y + z - 1)) | (1 << (x + y + z - 1)); for (int ...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int n, x, y, z; int dp[41][131100]; int main() { scanf("%d", &n); scanf("%d%d%d", &x, &y, &z); dp[0][0] = 1; int mx_mask = (1 << (x + y + z)) - 1; int bad_mask = (1 << (z - 1)) | (1 << (y + z - 1)) | (1 << (x + y + z - 1)); for (int ...
[["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["-", 51, 16, 31, 23, 0, 16, 31, 16, 31, 13], ["-", 51, 16, 31, 23, 0, 16, 31, 16, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["-", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
1
364
#include <algorithm> #include <bitset> #include <cassert> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <...
[["-", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["-", 49, 50, 51, 16, 12, 23, 0, 16, 12, 22], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 12, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 0, 35], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7,...
1
604
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 45, MOD = 1e9 + 7; long long dp[1 << 18][N]; int32_t main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n, x, y, z; cin >> n >> x >> y >> z; long long ans = 1; y += x; z += y; dp[1][0] = 1; for (int i = 1; i ...
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 45, MOD = 1e9 + 7; long long dp[1 << 18][N]; int32_t main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n, x, y, z; cin >> n >> x >> y >> z; long long ans = 1; y += x; z += y; dp[1][0] = 1; for (int i = 1; i ...
[["-", 15, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 31, 22], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 12, 13], ["-", 15, 16, 12, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 7, 0, 25], ["+", 0, 7, ...
1
335
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace s...
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace s...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 7, 10, 43, 49...
1
4,077
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define ll long long using namespace std; const int mod = 1e9 + 7; int dp[50][1 << (5 + 7 + 5)]; int fow, S, ans; int x, y, z; int n; int main() { scanf("%d", &n); scanf("%d%d%d", &x, &y, &z); ans = 1; for (int i = 1; i <= n; i++) ...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define ll long long using namespace std; const int mod = 1e9 + 7; int dp[50][1 << 17]; int fow, S, ans; int x, y, z; int n; int main() { scanf("%d", &n); scanf("%d%d%d", &x, &y, &z); ans = 1; for (int i = 1; i <= n; i++) ans = 1l...
[["-", 0, 43, 49, 80, 81, 16, 12, 23, 0, 24], ["-", 81, 16, 12, 23, 0, 16, 31, 16, 31, 13], ["-", 81, 16, 12, 23, 0, 16, 31, 16, 17, 72], ["-", 81, 16, 12, 23, 0, 16, 31, 16, 12, 13], ["-", 49, 80, 81, 16, 12, 23, 0, 16, 17, 72], ["-", 49, 80, 81, 16, 12, 23, 0, 16, 12, 13], ["-", 0, 43, 49, 80, 81, 16, 12, 23, 0, 25],...
1
326
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 41, MAXM = (1 << 17) + 50, mod = (int)1e9 + 7; int n, x, y, z; int len; int dp[N][MAXM]; bool is_haiku(int mask) { return (((mask >> (x + y + z - 1)) & (mask >> (y + z - 1)) & (mask >> (z - 1))) & 1) == 1; } int ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 41, MAXM = (1 << 17) + 50, mod = (int)1e9 + 7; int n, x, y, z; int len; int dp[N][MAXM]; bool is_haiku(int mask) { return (((mask >> (x + y + z - 1)) & (mask >> (y + z - 1)) & (mask >> (z - 1))) & 1) == 1; } int ...
[["-", 0, 37, 0, 16, 31, 23, 0, 16, 17, 67], ["-", 0, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 0, 37, 0, 16, 31, 23, 0, 16, 17, 139], ["-", 12, 23, 0, 16, 31, 23, 0, 16, 12, 22], ["-", 0, 16, 12, 23, 0, 16, 31, 23, 0, 25], ["+", 0, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 12, 23, 0, 16, 31, 22], ["-", 0,...
1
378
#include <cstdio> const long long p = 1e9 + 7; long long pow(long long n, long long c = 2) { long long a[64]; a[0] = c; for (int i = 1; i < 63; i++) a[i] = (a[i - 1] * a[i - 1]) % p; long long ans = 1; for (int i = 0; i < 63; i++) if ((n & (1ll << i)) != 0) ans = (ans * a[i]) % p; return ans;...
#include <cstdio> const long long p = 1e9 + 7; long long pow(long long n, long long c = 2) { long long a[64]; a[0] = c; for (int i = 1; i < 63; i++) a[i] = (a[i - 1] * a[i - 1]) % p; long long ans = 1; for (int i = 0; i < 63; i++) if ((n & (1ll << i)) != 0) ans = (ans * a[i]) % p; return ans;...
[["-", 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
430
#include <bits/stdc++.h> using namespace std; const int mo = 1e9 + 7; int po[23], f[40][131075]; long long ans; int n, x, y, z, sum, S; int main() { scanf("%d%d%d%d", &n, &x, &y, &z); sum = (1 << x - 1) | (1 << x + y - 1) | (1 << x + y + z - 1); S = (1 << x + y + z) - 1; ans = 1; for (int i = 1; i <= n; i++) ...
#include <bits/stdc++.h> using namespace std; const int mo = 1e9 + 7; int f[45][132075]; long long ans; int n, x, y, z, sum, S; int main() { scanf("%d%d%d%d", &n, &x, &y, &z); sum = (1 << x - 1) | (1 << x + y - 1) | (1 << x + y + z - 1); S = (1 << x + y + z) - 1; ans = 1; for (int i = 1; i <= n; i++) ans ...
[["-", 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, 13], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 0, 73], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["-", 0, 30, 0, 43, 49, 80, 49, 80, 81, 13], ["+", 0, 30, 0, 43, 49, 80, 49, 80, 81, 13], ["+", 3...
1
300
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(c) (c).begin(), (c).end() #define pb push_back #define dbg(...) \ do { \ cerr << __LINE__ <<...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(c) (c).begin(), (c).end() #define pb push_back #define dbg(...) \ do { \ cerr << __LINE__ <<...
[["+", 0, 30, 0, 14, 8, 9, 0, 163, 0, 164], ["+", 0, 30, 0, 14, 8, 9, 0, 163, 15, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 163, 0, 165], ["-", 39, 344, 3, 347, 0, 77, 39, 344, 141, 78], ["+", 39, 344, 3, 347, 0, 77, 39, 344, 141, 78], ["+", 3, 347, 0, 77, 39, 344, 3, 347, 0, 21], ["+", 0, 77, 39, 344, 3, 347, 0, 77, 39, 40], ...
1
1,170
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, x, n) for (int i = x; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define all(X) (X).begin(), (X).end() #define X first #define Y second #define pb push_back #define eb emplace_back using namespace std; type...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, x, n) for (int i = x; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define all(X) (X).begin(), (X).end() #define X first #define Y second #define pb push_back #define eb emplace_back using namespace std; type...
[["-", 8, 9, 0, 1, 0, 2, 63, 343, 345, 348], ["-", 8, 9, 0, 1, 0, 2, 63, 343, 0, 349], ["-", 8, 9, 0, 1, 0, 2, 63, 343, 141, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 147], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 43, 49, 50, 49, 80, ...
1
1,018
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rrep(i, n) for (int i = (int)(n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = (int)(s); i < (int)(t); ++i) #define each(a, b) for (auto &(a) : ...
#include <iostream> #include <vector> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rrep(i, n) for (int i = (int)(n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = (int)(s); i < (int)(t); ++i) #define each(a, b) for ...
[["-", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
516
#pragma GCC optimize(3) #include <cstdio> const int N = 2010; const int mod = 1e9 + 7; int n, k, fac[N * N], inv[N * N], f[N][N]; inline int C(int x, int y) { return 1ll * fac[x] * inv[y] % mod * inv[x - y] % mod; } int main() { scanf("%d%d", &n, &k); fac[0] = fac[1] = 1; for (int i = 2; i <= n * k; ++i) fa...
#pragma GCC optimize(3) #include <cstdio> const int N = 2010; const int mod = 1e9 + 7; int n, k, fac[N * N], inv[N * N], f[N][N]; inline int C(int x, int y) { return 1ll * fac[x] * inv[y] % mod * inv[x - y] % mod; } int main() { scanf("%d%d", &n, &k); if (k == 1) { puts("1"); return 0; } fac[0] = fac[...
[["+", 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], ["+", 0, 57, 64...
1
383
#include <bits/stdc++.h> #define IL __inline__ __attribute__((always_inline)) #define For(i, a, b) for (int i = a, i##end = b; i <= i##end; ++i) #define FOR(i, a, b) for (int i = a, i##end = b; i < i##end; ++i) #define Rep(i, a, b) for (int i = a, i##end = b; i >= i##end; --i) #define REP(i, a, b) for (int i = (a)-1,...
#include <bits/stdc++.h> #define IL __inline__ __attribute__((always_inline)) #define For(i, a, b) for (int i = a, i##end = b; i <= i##end; ++i) #define FOR(i, a, b) for (int i = a, i##end = b; i < i##end; ++i) #define Rep(i, a, b) for (int i = a, i##end = b; i >= i##end; --i) #define REP(i, a, b) for (int i = (a)-1,...
[["-", 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, 16, 31, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 48], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+"...
1
826
#include <cstdio> #define ll long long #define rep(i, j, k) for (i = j; i <= k; i++) #define down(i, j, k) for (i = j; i >= k; i--) using namespace std; const int N = 2e3 + 5, B = 4e6 + 5, mod = 1e9 + 7; int n, k, i, j, ans, f[N][N], fac[B], inv[B]; int fgm(int a, int n) { int ret = 1, bsc = a; for (; n > 0; n >>= ...
#include <cstdio> #define ll long long #define rep(i, j, k) for (i = j; i <= k; i++) #define down(i, j, k) for (i = j; i >= k; i--) using namespace std; const int N = 2e3 + 5, B = 4e6 + 5, mod = 1e9 + 7; int n, k, i, j, ans, f[N][N], fac[B], inv[B]; int fgm(int a, int n) { int ret = 1, bsc = a; for (; n > 0; n >>= ...
[["+", 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], ["+", 0, 57, 64...
1
473
#include <bits/stdc++.h> #define IL inline #define RG register #define LL long long #define Upd(a) (a) >= mod ? (a -= mod) : 1 using namespace std; template <class T> IL char gc() { static char buf[1 << 6], *p1 = buf, *p2 = buf; return (p1 == p2) && (p2 = (p1 = buf) + fread(buf, 1, 1 << 6, stdin), ...
#include <bits/stdc++.h> #define IL inline #define RG register #define LL long long #define Upd(a) (a) >= mod ? (a -= mod) : 1 using namespace std; template <class T> IL char gc() { static char buf[1 << 6], *p1 = buf, *p2 = buf; return (p1 == p2) && (p2 = (p1 = buf) + fread(buf, 1, 1 << 6, stdin), ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["-", 31, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["-", 31, 16, 31, 16, 31, 16, 31, 16, 17, 48], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 31, 11, 12, 16, 31, 16, 31, 16, 31, 13], ["-", 31, 11, ...
1
701
#include <bits/stdc++.h> using namespace std; inline int read() { int ans = 0, w = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') w = -1; ch = getchar(); } while (isdigit(ch)) ans = (ans << 3) + (ans << 1) + (ch ^ 48), ch = getchar(); return ans * w; } const int N = 2005, Ma...
#include <bits/stdc++.h> using namespace std; inline int read() { int ans = 0, w = 1; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') w = -1; ch = getchar(); } while (isdigit(ch)) ans = (ans << 3) + (ans << 1) + (ch ^ 48), ch = getchar(); return ans * w; } const int N = 2005, Ma...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 48], ["-", 0, 7, 15, 16, 12, 16, 12, 23, 0, 24], ["-", 15, 16, 12, 16, 12, 23, 0, 16, 31, 22], ["-", 15, 16, 12, 16, 12, 23, 0, 16, 17, 72], ["-", 15, 16, 12, 16, 12, 23, 0, 16, 12, 13], ["-", 0, 7, 15, 16, 12, 16, 12, 23, 0, 25], ["+", 8...
1
482
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #define rep(i, x, y) for (int i = x; i <= y; ++i) #define repd(i, x, y) for (int i = x; i >= y; --i) using namespace std; const int N = 2005, mod = 1000000007; typedef long long LL; int n, k, c[N], ans; LL flv[N * N], inv[N * N], f[N][N]; voi...
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #define rep(i, x, y) for (int i = x; i <= y; ++i) #define repd(i, x, y) for (int i = x; i >= y; --i) using namespace std; const int N = 2005, mod = 1000000007; typedef long long LL; int n, k, c[N], ans; LL flv[N * N], inv[N * N], f[N][N]; voi...
[["+", 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], ["+", 0, 57, 64...
1
686
#include <bits/stdc++.h> #define rg register using namespace std; const int mod = 1e9 + 7; #define _ 2001 int n, k, f[_][_], sum[_ * _], inv[_ * _]; int qp(int x, int y) { int ans = 1; while (y) { if (y & 1) ans = 1ll * ans * x % mod; x = 1ll * x * x % mod, y >>= 1; } return ans; } int C(int m, in...
#include <bits/stdc++.h> #define rg register using namespace std; const int mod = 1e9 + 7; #define _ 2001 int n, k, f[_][_], sum[_ * _], inv[_ * _]; int qp(int x, int y) { int ans = 1; while (y) { if (y & 1) ans = 1ll * ans * x % mod; x = 1ll * x * x % mod, y >>= 1; } return ans; } int C(int m, in...
[["+", 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], ["+", 0, 57, 64...
1
414
#include <bits/stdc++.h> #define N 2020 #define mod 1000000007 #define ll long long using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch > '9' || ch < '0') ch == '-' && (f = 0) || (ch = getchar()); while (ch <= '9' && ch >= '0') x = (x << 3) + (x << 1) + ch - '0', ch...
#include <bits/stdc++.h> #define N 2020 #define mod 1000000007 #define ll long long using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch > '9' || ch < '0') ch == '-' && (f = 0) || (ch = getchar()); while (ch <= '9' && ch >= '0') x = (x << 3) + (x << 1) + ch - '0', ch...
[["+", 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], ["+", 8, 9, 0, ...
1
485
#include <bits/stdc++.h> using namespace std; const int N = 2e3 + 10; const int mod = 1e9 + 7; int gi() { int x = 0, o = 1; char ch = getchar(); while ((ch < '0' || ch > '9') && ch != '-') ch = getchar(); if (ch == '-') o = -1, ch = getchar(); while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ...
#include <bits/stdc++.h> using namespace std; const int N = 2e3 + 10; const int mod = 1e9 + 7; int gi() { int x = 0, o = 1; char ch = getchar(); while ((ch < '0' || ch > '9') && ch != '-') ch = getchar(); if (ch == '-') o = -1, ch = getchar(); while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ...
[["+", 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, 37, 0, 38], ["+", 0, 57, 6...
1
492
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef long double ld; typedef unsigned long long ...
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef long double ld; typedef unsigned long long ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 31, 69, 28, 2, 3, 4, 0, 16, 31, 13], ["+", 31, 69, 28, 2, 3, 4, 0, 16, 31, 13], ["-", 31, 69, 28, 2, 3, 4, 0, 16, 12, 13], ["+", 31, 69, 28, 2, 3, 4, 0, 16, 12, 13]]
1
542
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define Rep(i, a, b) for (register int i = (a); i <= int(b); ++i) #define Dep(i, a, b) for (register int i = (a); i >= int(b); --i) #define rep(i, a, b) for (register int i = (a); i < int(b); ++i) #define mem(x, v) memset(x,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define Rep(i, a, b) for (register int i = (a); i <= int(b); ++i) #define Dep(i, a, b) for (register int i = (a); i >= int(b); --i) #define rep(i, a, b) for (register int i = (a); i < int(b); ++i) #define mem(x, v) memset(x,...
[["+", 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], ["+", 0, 57, 64...
1
637
#include <bits/stdc++.h> #define N 2050 #define mod 1000000007 using namespace std; typedef long long LL; const int tp = 4000000; int n, k; LL F[N][N], jc[N * N], inv[N * N], invjc[N * N]; inline int rd() { int r; scanf("%d", &r); return r; } inline LL C(int x, int y) { if (x < y) return 0; return 1LL *...
#include <bits/stdc++.h> #define N 2050 #define mod 1000000007 using namespace std; typedef long long LL; const int tp = 4000000; int n, k; LL F[N][N], jc[N * N], inv[N * N], invjc[N * N]; inline int rd() { int r; scanf("%d", &r); return r; } inline LL C(int x, int y) { if (x < y) return 0; return 1LL *...
[["+", 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], ["+", 0, 57, 64...
1
511
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 2005, MOD = 1e9 + 7; int n, k, fac[MAXN * MAXN], inv[MAXN * MAXN], dp[MAXN][MAXN]; ll quick_pow(ll a, ll b) { ll ret = 1; for (; b; b >>= 1, a = a * a % MOD) if (b & 1) ret = ret * a % MOD; return ret; } ll C(int a, i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 2005, MOD = 1e9 + 7; int n, k, fac[MAXN * MAXN], inv[MAXN * MAXN], dp[MAXN][MAXN]; ll quick_pow(ll a, ll b) { ll ret = 1; for (; b; b >>= 1, a = a * a % MOD) if (b & 1) ret = ret * a % MOD; return ret; } ll C(int a, i...
[["+", 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, 37, 0, 38], ["+", 0, 57, 6...
1
416
#include <bits/stdc++.h> using namespace std; constexpr int N = 2000 + 10; constexpr int MOD = 1e9 + 7; long long dp[N][N], fact[N * N], n, k; long long mypow(long long a, long long b) { return b ? (mypow(a * a % MOD, b >> 1) * (b & 1 ? a : 1)) % MOD : 1; } long long ch(long long a, long long b) { return (fact...
#include <bits/stdc++.h> using namespace std; constexpr int N = 2000 + 10; constexpr int MOD = 1e9 + 7; long long dp[N][N], fact[N * N], n, k; long long mypow(long long a, long long b) { return b ? (mypow(a * a % MOD, b >> 1) * (b & 1 ? a : 1)) % MOD : 1; } long long ch(long long a, long long b) { return (fact...
[["+", 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
397
#include <bits/stdc++.h> #define ll long long using namespace std; const ll MAX_N = 3000 + 10, MOD = 1e9 + 7; ll n, k, dp[MAX_N][MAX_N], fac[MAX_N * MAX_N], en[MAX_N * MAX_N], r, pwmakh, makh = 1; ll pw(int x, int y) { if (!y) return 1ll; ll t = pw(x, y / 2); t = 1ll * t * t % MOD; if (y & 1) t = 1l...
#include <bits/stdc++.h> #define ll long long using namespace std; const ll MAX_N = 3000 + 10, MOD = 1e9 + 7; ll n, k, dp[MAX_N][MAX_N], fac[MAX_N * MAX_N], en[MAX_N * MAX_N], r, pwmakh, makh = 1; ll pw(int x, int y) { if (!y) return 1ll; ll t = pw(x, y / 2); t = 1ll * t * t % MOD; if (y & 1) t = 1l...
[["-", 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, 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, ...
1
533
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; (i) < int(n); ++(i)) #define REP3(i, m, n) for (int i = (m); (i) < int(n); ++(i)) using ll = long long; using namespace std; template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); } template <typename X, typename Y, typename Z, typ...
#include <cassert> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; (i) < int(n); ++(i)) #define REP3(i, m, n) for (int i = (m); (i) < int(n); ++(i)) using ll = long long; using namespace std; template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); } template <typenam...
[["-", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["+", 0, 9, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 9, 0, 9, 0, 57, 64, 9, 0, 46]]
1
685
#include <cstdio> using namespace std; const int N = 2005; const int M = N * N; const int mo = 1e9 + 7; int n, k, m; long long p[M], q[M], f[N][N]; long long ksm(long long x, int y) { long long t = 1; for (; y; y >>= 1) { if (y & 1) t = t * x % mo; x = x * x % mo; } return t; } long long c(int x, ...
#include <cstdio> using namespace std; const int N = 2005; const int M = N * N; const int mo = 1e9 + 7; int n, k, m; long long p[M], q[M], f[N][N]; long long ksm(long long x, int y) { long long t = 1; for (; y; y >>= 1) { if (y & 1) t = t * x % mo; x = x * x % mo; } return t; } long long c(int x, ...
[["-", 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, 18], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["-", 0, 14, 8, 9, 0, 57, 64, 37, 0, 38], ["-", 0, 14, 8...
1
422
#include <bits/stdc++.h> #define LL long long #define MOD 1000000007 using namespace std; int N, K; LL fac[5000010], inv[5000010], ifac[5000010], d[2010][2010]; int main() { cin >> N >> K; fac[0] = inv[0] = ifac[0] = fac[1] = inv[1] = ifac[1] = 1; for (int i = 2; i <= 5000000; i++) { fac[i] = (fac[i - 1] * i)...
#include <bits/stdc++.h> #define LL long long #define MOD 1000000007 using namespace std; int N, K; LL fac[5000010], inv[5000010], ifac[5000010], d[2010][2010]; int main() { cin >> N >> K; if (K == 1) { cout << 1 << endl; return 0; } fac[0] = inv[0] = ifac[0] = fac[1] = inv[1] = ifac[1] = 1; for (int ...
[["+", 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
383
#include <bits/stdc++.h> #define fo(i, a, b) for (i = a; i <= b; i++) #define fd(i, a, b) for (i = a; i >= b; i--) #define min(a, b) (a < b ? a : b) #define max(a, b) (a > b ? a : b) typedef long long ll; using namespace std; const int maxn = 2e3 + 5, mo = 1e9 + 7; int i, j, n, k, f[maxn][maxn], ji[maxn * maxn], ni[max...
#include <bits/stdc++.h> #define fo(i, a, b) for (i = a; i <= b; i++) #define fd(i, a, b) for (i = a; i >= b; i--) #define min(a, b) (a < b ? a : b) #define max(a, b) (a > b ? a : b) typedef long long ll; using namespace std; const int maxn = 2e3 + 5, mo = 1e9 + 7; int i, j, n, k, f[maxn][maxn], ji[maxn * maxn], ni[max...
[["+", 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], ["+", 0, 57, 64...
1
453
#include <stdio.h> long long Mod = 1000000007, Inv[4010000], F[4010000], InvF[4010000], D[2010][2010]; long long Comb(int a, int b) { return F[a] * InvF[b] % Mod * InvF[a - b] % Mod; } int n, K; int main() { int i, j; scanf("%d%d", &n, &K); Inv[1] = F[0] = InvF[0] = 1; for (i = 2; i <= n * K; i++) {...
#include <stdio.h> long long Mod = 1000000007, Inv[4010000], F[4010000], InvF[4010000], D[2010][2010]; long long Comb(int a, int b) { return F[a] * InvF[b] % Mod * InvF[a - b] % Mod; } int n, K; int main() { int i, j; scanf("%d%d", &n, &K); if (K == 1) { printf("1\n"); return 0; } Inv[1] =...
[["+", 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], ["+", 0, 57, 64...
1
364
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i <= b; ++i) #define CLR(i, a) memset(i, a, sizeof(i)) #define REPD(i, a, b) for (int i = a; i >= b; --i) const int N = 2e3 + 5, MOD = 1e9 + 7; int n, k, f[N][N], inv[N * N], fac[N * N]; inline void inc(int &a, int b) { a = (a + b) ...
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i <= b; ++i) #define CLR(i, a) memset(i, a, sizeof(i)) #define REPD(i, a, b) for (int i = a; i >= b; --i) const int N = 2e3 + 5, MOD = 1e9 + 7; int n, k, f[N][N], inv[N * N], fac[N * N]; inline void inc(int &a, int b) { a = (a + b) ...
[["+", 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, 57, 64, 1, 0, 34, 31, 2, 63, 22], ["+", 64, 1, ...
1
443
#include <algorithm> #include <cstdio> #define Rep(i, n) for (int i = 1; i <= n; i++) #define Rep0(i, n) for (int i = 0; i <= n; i++) #define RepG(i, x) for (int i = head[x]; i; i = edge[i].next) #define v edge[i].to using namespace std; typedef long long LL; const int N = 2010; const int mod = 1e9 + 7; LL f[N][N]...
#include <algorithm> #include <cstdio> #define Rep(i, n) for (int i = 1; i <= n; i++) #define Rep0(i, n) for (int i = 0; i <= n; i++) #define RepG(i, x) for (int i = head[x]; i; i = edge[i].next) #define v edge[i].to using namespace std; typedef long long LL; const int N = 2010; const int mod = 1e9 + 7; LL f[N][N]...
[["+", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 78], ["-", 31, 16, 31, 16, 31, 16, 12, 2, 63, 22], ["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["-", 31, 16, 12, 2, 3, 4, 0, 69, 28, 22], ["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 12,...
1
367
#include <bits/stdc++.h> using namespace std; #define M 2010 #define LL long long #define MOD 1000000007 #define rep(i, x, y) for (int i = (x); i <= (y); i++) inline int read() { char ch = getchar(); int x = 0, f = 1; while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while ...
#include <bits/stdc++.h> using namespace std; #define M 2010 #define LL long long #define MOD 1000000007 #define rep(i, x, y) for (int i = (x); i <= (y); i++) inline int read() { char ch = getchar(); int x = 0, f = 1; while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while ...
[["+", 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, 37, 0, 38], ["+", 0, 57, 6...
1
452
#include <bits/stdc++.h> using namespace std; const int maxn = 2e3 + 2; const int maxx = maxn * maxn; const int q = 1e9 + 7; inline int Plus(int x, int y) { return (x += y) >= q ? x - q : x; } inline void Pe(int &x, int y) { x = Plus(x, y); } inline int Multi(int x, int y) { return 1ll * x * y % q; } inline void Me(int...
#include <bits/stdc++.h> using namespace std; const int maxn = 2e3 + 2; const int maxx = maxn * maxn; const int q = 1e9 + 7; inline int Plus(int x, int y) { return (x += y) >= q ? x - q : x; } inline void Pe(int &x, int y) { x = Plus(x, y); } inline int Multi(int x, int y) { return 1ll * x * y % q; } inline void Me(int...
[["-", 0, 30, 0, 14, 8, 9, 0, 171, 0, 184], ["-", 0, 30, 0, 14, 8, 9, 0, 171, 141, 22], ["-", 8, 9, 0, 171, 0, 1, 0, 2, 63, 22], ["-", 0, 171, 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], ["-", 0, 171, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 0, 171, 0, 1, 0, 2, 3, 4, 0, 2...
1
488
#include <cstdio> using namespace std; const int N = 2010, Mod = 1e9 + 7; int n, k, fact[N * N], inv[N * N], f[2 * N][N]; void Init() { scanf("%d%d", &n, &k); } void Prepare() { fact[0] = 1; for (int i = 1; i <= n * k; ++i) fact[i] = 1ll * fact[i - 1] * i % Mod; inv[0] = inv[1] = 1; for (int i = 2; i <...
#include <cstdio> using namespace std; const int N = 2010, Mod = 1e9 + 7; int n, k, fact[N * N], inv[N * N], f[2 * N][N]; void Init() { scanf("%d%d", &n, &k); } void Prepare() { fact[0] = 1; for (int i = 1; i <= n * k; ++i) fact[i] = 1ll * fact[i - 1] * i % Mod; inv[0] = inv[1] = 1; for (int i = 2; i <...
[["+", 8, 9, 0, 7, 8, 7, 15, 16, 17, 98], ["+", 0, 7, 8, 7, 15, 16, 12, 16, 31, 22], ["+", 0, 7, 8, 7, 15, 16, 12, 16, 17, 19], ["+", 0, 7, 8, 7, 15, 16, 12, 16, 12, 22], ["+", 3, 4, 0, 16, 31, 16, 12, 69, 28, 22], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 73]]
1
486
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <set> #include <vector> #define rep(i, a, b) for (int i = a; i <= b; i++) #define dep(i, a, b) for (int i = a; i >= b; i--) #define Rep(i, a) for (int i = 0; i < a; i++) using namespace std; typedef ...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <set> #include <vector> #define rep(i, a, b) for (int i = a; i <= b; i++) #define dep(i, a, b) for (int i = a; i >= b; i--) #define Rep(i, a) for (int i = 0; i < a; i++) using namespace std; typedef ...
[["-", 28, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["+", 31, 69, 28, 2, 3, 4, 0, 16, 31, 22], ["-", 28, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["-", 31, 69, 28, 2, 3, 4, 0, 16, 17, 33], ["-", 31, 69, 28, 2, 3, 4, 0, 16, 12, 13], ["+", 31, 69, 28, 2, 3, 4, 0, 16, 12, 22], ["-", 31, 69, 341, 342, 0, 16, 31, 16, 31, 22], ["+", 31, 69,...
1
494
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define per(i, a, b) for (int i = (a); i >= (b); i--) #define forE(i, x) for (int i = head[x]; i != -1; i = ne[i]) using namespace std; typedef long long i64; typedef unsigned long long u64; typedef unsigned u32; typedef pair<int, int> pin; ...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define per(i, a, b) for (int i = (a); i >= (b); i--) #define forE(i, x) for (int i = head[x]; i != -1; i = ne[i]) using namespace std; typedef long long i64; typedef unsigned long long u64; typedef unsigned u32; typedef pair<int, int> pin; ...
[["+", 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], ["+", 0, 57, 64...
1
623
#include <bits/stdc++.h> #define ll long long const int N = 2000 + 10; const int mod = 1e9 + 7; using namespace std; ll f[N][N], fac[N * N], rfac[N * N]; int n, m; namespace solver { ll fpm(ll x, ll y) { ll s = 1; while (y) { if (y & 1) s = s * x % mod; y >>= 1; x = x * x % mod; } return s; } ...
#include <bits/stdc++.h> #define ll long long const int N = 2000 + 10; const int mod = 1e9 + 7; using namespace std; ll f[N][N], fac[N * N], rfac[N * N]; int n, m; namespace solver { ll fpm(ll x, ll y) { ll s = 1; while (y) { if (y & 1) s = s * x % mod; y >>= 1; x = x * x % mod; } return s; } ...
[["+", 8, 201, 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], ["+", 0, 57, 6...
1
455
#include <algorithm> #include <iostream> #include <memory.h> #include <stdio.h> #include <vector> using namespace std; typedef long long LL; const int maxn = 2005; const int maxm = 4000005; const int N = 4e6; const int mod = 1e9 + 7; int fac[maxm], inc[maxm]; int n, K, ans, dp[maxn][maxn]; LL fpm(LL p, LL k) { LL r...
#include <algorithm> #include <iostream> #include <memory.h> #include <stdio.h> #include <vector> using namespace std; typedef long long LL; const int maxn = 2005; const int maxm = 4000005; const int N = 4e6; const int mod = 1e9 + 7; int fac[maxm], inc[maxm]; int n, K, ans, dp[maxn][maxn]; LL fpm(LL p, LL k) { LL r...
[["-", 0, 7, 8, 7, 10, 43, 49, 50, 51, 22], ["+", 0, 7, 8, 7, 10, 43, 49, 50, 51, 22], ["+", 0, 2, 3, 4, 0, 41, 15, 16, 31, 22], ["+", 0, 2, 3, 4, 0, 41, 15, 16, 17, 47], ["+", 0, 2, 3, 4, 0, 41, 15, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 41, 0, 101], ["+", 0, 1, 0, 2, 3, 4, 0, 41, 0, 102], ["+", 0, 1, 0, 2, 3, 4, 0, ...
1
419
#include <algorithm> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; typedef long long ll; const int Mod = 1e9 + 7; int fac[4110000], ifac[4110000], f[2100][2100], n, k; int pow(int x, int l) { if (l == 0) return 1; int t = pow(x, l / 2); t = (ll)t * t % Mo...
#include <algorithm> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; typedef long long ll; const int Mod = 1e9 + 7; int fac[4110000], ifac[4110000], f[2100][2100], n, k; int pow(int x, int l) { if (l == 0) return 1; int t = pow(x, l / 2); t = (ll)t * t % Mo...
[["+", 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], ["+", 0, 57, 64...
1
463
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #define file(s) freopen(s ".in", "r", stdin), freopen(s ".out", "w", stdout); using namespace std; const int MAXN = 2005; const int MOD = 1e9 + 7; int n, K; int jc[MAXN * MAXN] = {1}, inv[MAXN * MAXN]; int f[MAXN][MAXN]; int quick_pow(int a, in...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #define file(s) freopen(s ".in", "r", stdin), freopen(s ".out", "w", stdout); using namespace std; const int MAXN = 2005; const int MOD = 1e9 + 7; int n, K; int jc[MAXN * MAXN] = {1}, inv[MAXN * MAXN]; int f[MAXN][MAXN]; int quick_pow(int a, in...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 31, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 11, 31, 69, 341, 342, 0, 16, 31, 22], ["+", 31, ...
1
452
#include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = 2010, MOD = 1e9 + 7; int f[MAXN * MAXN], dp[MAXN][MAXN], fm1[MAXN * MAXN]; inline int add(int x, int y) { return (x + y) % MOD; } inline int mul(int x, int y) { return (x * y) % MOD; } int p(int x, int y) { // cerr << x << end...
#include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = 2010, MOD = 1e9 + 7; int f[MAXN * MAXN], dp[MAXN][MAXN], fm1[MAXN * MAXN]; inline int add(int x, int y) { return (x + y) % MOD; } inline int mul(int x, int y) { return (x * y) % MOD; } int p(int x, int y) { // cerr << x << end...
[["+", 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
442
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <str...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <str...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 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, 16, 31, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-...
1
581
#include <bits/stdc++.h> using namespace std; const int INF = 1000000000, mod = 1e9 + 7; const double eps = 1e-7; int f[2001][2001], c[5000000], inv[5000000]; int main() { // freopen("input.txt","r",stdin); int t; int n, m, q; // cin>>t; // while(t--) // while(scanf("%d",&n)!=EOF) { cin >> n >> m; ...
#include <bits/stdc++.h> using namespace std; const int INF = 1000000000, mod = 1e9 + 7; const double eps = 1e-7; int f[2001][2001], c[5000000], inv[5000000]; int main() { // freopen("input.txt","r",stdin); int t; int n, m, q; // cin>>t; // while(t--) // while(scanf("%d",&n)!=EOF) { cin >> n >> m; ...
[["+", 0, 14, 8, 9, 0, 9, 0, 57, 0, 121], ["+", 8, 9, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 9, 0, 57, 15, 339, 0, 25], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 64, 9, 0, 1, ...
1
409
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 22; bool buf; int n, k, len; int bn[maxn]; vector<int> d; bool bad[maxn]; int main() { buf = scanf("%d%d", &n, &k); for (int i = 1; i <= k; i++) { int x; buf = scanf("%d", &x); bad[x] = true; } while (n > 0) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 22; bool buf; int n, k, len; int bn[maxn]; vector<int> d; bool bad[maxn]; int main() { buf = scanf("%d%d", &n, &k); for (int i = 1; i <= k; i++) { int x; buf = scanf("%d", &x); bad[x] = true; } while (n > 0) ...
[["+", 8, 9, 0, 57, 64, 9, 0, 52, 0, 89], ["+", 0, 57, 64, 9, 0, 52, 15, 339, 0, 24], ["+", 64, 9, 0, 52, 15, 339, 51, 69, 28, 22], ["+", 0, 52, 15, 339, 51, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 69, 341, 342, 0, 69, 28, 22], ["+", 51, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["+", 51, 69, 341, 342, 0, 69, 341, 342, 0...
1
292
#include <iostream> using namespace std; int main() { int n, k, N, mod, i, temp, res; int num[10]; for (i = 0; i < n; i++) num[i] = 0; cin >> n >> k; for (i = 0; i < k; i++) { cin >> temp; num[temp] = 1; } while (1) { N = n; while (N) { mod = N % 10; if (num[mod] == 1) { ...
#include <iostream> using namespace std; int main() { int n, k, N, mod, i, temp, res; int num[10]; for (i = 0; i < n; i++) num[i] = 0; cin >> n >> k; for (i = 0; i < k; i++) { cin >> temp; num[temp] = 1; } while (1) { N = n; while (N) { if (num[N % 10] == 1) { n = n + 1; ...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 69, ...
1
164
// clang-format off #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #ifndef ritick #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,a...
// clang-format off #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #ifndef ritick #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,a...
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["+", 0, 11, 12, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 42, 0, 2, 63, 22], ["+", 0, 9,...
1
1,045
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; //----------------------- Print Function ----------------------// inline void print() { cout << endl; } template <typename First, typename... Rest> void print(const First &first, const Rest &...rest) { cout << first << ' '; print(rest...); } ...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; //----------------------- Print Function ----------------------// inline void print() { cout << endl; } template <typename First, typename... Rest> void print(const First &first, const Rest &...rest) { cout << first << ' '; print(rest...); } ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2...
1
327
#include <bits/stdc++.h> using namespace std; bool keta(int n, set<int> d) { while (n > 0) { if (d.count(n % 10)) return false; else n /= 10; } return true; } int main() { int n, k; cin >> n >> k; set<int> d; for (int i = 0; i < k; i++) { int a; cin >> a; d.insert(a); } ...
#include <bits/stdc++.h> using namespace std; bool keta(int n, set<int> d) { while (n) { if (d.count(n % 10)) return false; else n /= 10; } return true; } int main() { int n, k; cin >> n >> k; set<int> d; for (int i = 0; i < k; i++) { int a; cin >> a; d.insert(a); } for...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["-", 0, 7, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 7, 8, 9, 0, ...
1
142
n, k = map(int, input().split()) d = list(map(int, input().split())) def is_ok(num): s = str(num) for ng in d: if ng in s: return False return True while True: if is_ok(n): print(n) exit() n += 1
n, k = map(int, input().split()) d = input().split() def is_ok(num): s = str(num) for ng in d: if ng in s: return False return True while True: if is_ok(n): print(n) exit() n += 1
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 662, 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, 22], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["-", 12, 652...
5
78
import java.io.*; import java.util.*; class Solution { boolean found = false; int[] numbers = new int[10]; int a = -1; void recurse(int index, int number) { if (index < 0) { found = true; a = number; return; } String numberString = String.valueOf(number); int currentStr...
import java.io.*; import java.util.*; class Solution { boolean found = false; int[] numbers = new int[10]; int a = Integer.MAX_VALUE; void recurse(int index, int number) { if (index < 0) { a = Math.min(a, number); return; } String numberString = String.valueOf(number); int cu...
[["-", 8, 498, 0, 124, 49, 200, 51, 91, 17, 33], ["-", 8, 498, 0, 124, 49, 200, 51, 91, 439, 499], ["+", 8, 498, 0, 124, 49, 200, 51, 509, 500, 22], ["+", 8, 498, 0, 124, 49, 200, 51, 509, 0, 131], ["+", 8, 498, 0, 124, 49, 200, 51, 509, 119, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 196, 0, 1, ...
3
381
#include <bits/stdc++.h> using namespace std; #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdlib> #include <iostream> #include <math.h> #include <numeric> #include <sstream> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i...
#include <bits/stdc++.h> using namespace std; #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdlib> #include <iostream> #include <math.h> #include <numeric> #include <sstream> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i...
[["-", 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], ["-", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 152], ["+...
1
302