buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; typedef unsigned long...
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; typedef unsigned long...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["-", 0, 7, 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, 7, ...
1
869
// #pragma GCC optimize("no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") // #pragma vector temporal // #pragma simd // #pragma GCC diagnostic ignored "-W" #include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> ...
// #pragma GCC optimize("no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") // #pragma vector temporal // #pragma simd // #pragma GCC diagnostic ignored "-W" #include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> ...
[["+", 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], ["+", 8, 9, 0, 57, 64, 37, 0, 69, 28, 22], ["+", 0, 57, 64, 37, 0, 69, 341, 342, 0, 70], ["+", 0, 57, 64, 37, 0, 69, 341, 342, 0, 22], ["+", 0, 57, 64, 37, 0, 69, 341, 342, 0, 73], ["+", 0,...
1
674
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <vector> using namespace std; typedef long long ll; typed...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <vector> using namespace std; typedef long long ll; typed...
[["-", 0, 11, 31, 69, 341, 342, 0, 69, 28, 22], ["-", 31, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["-", 31, 69, 341, 342, 0, 69, 341, 342, 0, 22], ["-", 31, 69, 341, 342, 0, 69, 341, 342, 0, 73], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ...
1
570
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; const int maxn = 2020; vector<int> g[maxn]; bool used[maxn]; int n; void dfs(int v, int d, int...
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; const int maxn = 2020; vector<int> g[maxn]; bool used[maxn]; int n; void dfs(int v, int d, int...
[["-", 64, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["-", 0, 7, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 7, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 7, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 64, 9, 0, 7, 8, 9, 0, 43, 0, 35], ["+", 8, 9, 0, 338, 8, 9, 0, 43, 39, 40], ["+", 0, 338, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 338, 8, 9, 0, 43, ...
1
437
N, K = gets.split.map(&:to_i) edges = Array.new(N){Hash.new} (N-1).times do a, b = gets.split.map(&:to_i) edges[a-1][b-1] = true edges[b-1][a-1] = true end def cnt(start, d, edges, forbid=nil) dist = Array.new(N) used = Array.new(N) queue = [start] used[start] = true dist[start] = 0 ...
N, K = gets.split.map(&:to_i) edges = Array.new(N){Hash.new} (N-1).times do a, b = gets.split.map(&:to_i) edges[a-1][b-1] = true edges[b-1][a-1] = true end def cnt(start, d, edges, forbid=nil) return 1 if d == 0 dist = Array.new(N) used = Array.new(N) queue = [start] used[start] = true ...
[["+", 0, 735, 8, 736, 0, 751, 8, 38, 0, 38], ["+", 8, 736, 0, 751, 8, 38, 0, 4, 0, 612], ["+", 0, 493, 0, 735, 8, 736, 0, 751, 0, 121], ["+", 0, 735, 8, 736, 0, 751, 15, 738, 31, 22], ["+", 0, 735, 8, 736, 0, 751, 15, 738, 17, 60], ["+", 0, 735, 8, 736, 0, 751, 15, 738, 12, 612], ["+", 8, 736, 0, 652, 196, 737, 8, 736...
4
299
#include <bits/stdc++.h> using namespace std; const int MAXN = 2005; struct node { int to, next; } edge[MAXN * 2]; int head[MAXN], top = 0; inline void push(int i, int j) { edge[++top] = (node){j, head[i]}, head[i] = top; } int n, K; int dp[MAXN][MAXN], maxdep[MAXN]; int c[MAXN]; void dfs(int nd, int f) { max...
#include <bits/stdc++.h> using namespace std; const int MAXN = 2005; struct node { int to, next; } edge[MAXN * 2]; int head[MAXN], top = 0; inline void push(int i, int j) { edge[++top] = (node){j, head[i]}, head[i] = top; } int n, K; int dp[MAXN][MAXN], maxdep[MAXN]; int c[MAXN]; void dfs(int nd, int f) { max...
[["+", 0, 14, 8, 9, 0, 7, 8, 7, 0, 88], ["+", 0, 14, 8, 9, 0, 7, 8, 7, 0, 24], ["+", 8, 9, 0, 7, 8, 7, 10, 43, 39, 40], ["+", 0, 7, 8, 7, 10, 43, 49, 50, 49, 22], ["+", 0, 7, 8, 7, 10, 43, 49, 50, 0, 32], ["+", 0, 7, 8, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 8, 7, 10, 43, 0, 35], ["+", 8, 9, 0, 7, 8, 7, 15, 16, ...
1
507
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1000000000; const ll LINF = (ll)4000000000000000000; const ll MOD = (ll)1000000007; const double PI = acos(1.0); const int limit = 100010; #define REP(i, m, n) for (int i = (...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1000000000; const ll LINF = (ll)4000000000000000000; const ll MOD = (ll)1000000007; const double PI = acos(1.0); const int limit = 100010; #define REP(i, m, n) for (int i = (...
[["+", 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, 338, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 338, 8, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 338, 8, 9, 0, 57, 64, 116, 0, 35], ["+", 8, 9, 0, 338, 8, 9, 0, 57, 0, 121], ["+", 0, ...
1
698
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; #define F first #define S second const int N = 2266; vector<int> g[N]; vector<pii> e; int vis[N], tt; int dfs(int u, int d) { if (!d) return 1; int ans = 1; for (int v : g[u]) if (vis[v] != tt) { vis[v] = tt; ans += dfs(...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; #define F first #define S second const int N = 2266; vector<int> g[N]; vector<pii> e; int vis[N], tt; int dfs(int u, int d) { if (!d) return 1; int ans = 1; for (int v : g[u]) if (vis[v] != tt) { vis[v] = tt; ans += dfs(...
[["+", 8, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
307
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <math.h> using namespace std; const int MAXN = 1e5 + 10; int N, M; int A[MAXN]; int cnt; int main() { register int i, j = 0, k = 0; scanf("%d%d", &N, &M); for (i = 1; i <= M; ++i) scanf("%d", A + i), A[i] & 1 ? (++cnt, !j ...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <math.h> using namespace std; const int MAXN = 1e5 + 10; int N, M; int A[MAXN]; int cnt; int main() { register int i, j = 0, k = 0; scanf("%d%d", &N, &M); for (i = 1; i <= M; ++i) scanf("%d", A + i), A[i] & 1 ? (++cnt, !j ...
[["-", 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], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["-", 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...
1
351
#include <bits/stdc++.h> using namespace std; const int maxn = 110; int n, m, a[maxn], cnt, a1, a2; bool cmp(int x, int y) { if (x % 2 == 1 && y % 2 == 0) return true; return false; } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &a[i]); if (a[i] % 2 == 1) ...
#include <bits/stdc++.h> using namespace std; const int maxn = 110; int n, m, a[maxn], cnt, a1, a2; bool cmp(int x, int y) { if (x % 2 == 1 && y % 2 == 0) return true; return false; } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &a[i]); if (a[i] % 2 == 1) ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
432
#include <algorithm> #include <bitset> #include <cassert> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <set> #include <vector> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; #define MOD 1000000007LL #define INF 1000000000LL #define EPS 1e-1...
#include <algorithm> #include <bitset> #include <cassert> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <set> #include <vector> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; #define MOD 1000000007LL #define INF 1000000000LL #define EPS 1e-1...
[["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, ...
1
746
#include <bits/stdc++.h> using namespace std; int n, m, js, js1, js2; int a[110]; vector<int> ans; int main() { scanf("%d %d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &a[i]); if (a[i] & 1) { if (js1) js2 = a[i]; else js1 = a[i]; js++; } else ans.push_b...
#include <bits/stdc++.h> using namespace std; int n, m, js, js1, js2; int a[110]; vector<int> ans; int main() { scanf("%d %d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &a[i]); if (a[i] & 1) { if (js1) js2 = a[i]; else js1 = a[i]; js++; } else ans.push_b...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 57, 64, 1, 0, 35], ["+", ...
1
386
#include <algorithm> #include <cstdio> using namespace std; const int N = 100010; int n, m, ck, a[N], b[N]; bool cmp(int a, int b) { return (a & 1) > (b & 1); } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", a + i); ck += (a[i] & 1); } if (ck > 2) { puts("Impossible")...
#include <algorithm> #include <cstdio> using namespace std; const int N = 100010; int n, m, ck, a[N], b[N]; bool cmp(int a, int b) { return (a & 1) > (b & 1); } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", a + i); ck += (a[i] & 1); } if (ck > 2) { puts("Impossible")...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
309
#include <bits/stdc++.h> using namespace std; int n, m, a[1000010], b[1000010], s; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; ++i) scanf("%d", a + i), s += a[i] & 1; if (s > 2) return puts("Impossible"), 0; sort(a + 1, a + m + 1, [](int x, int y) -> bool { return (x & 1) > (y & 1...
#include <bits/stdc++.h> using namespace std; int n, m, a[1000010], b[1000010], s; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; ++i) scanf("%d", a + i), s += a[i] & 1; if (s > 2) return puts("Impossible"), 0; sort(a + 1, a + m + 1, [](int x, int y) -> bool { return (x & 1) > (y & 1...
[["+", 0, 14, 8, 9, 0, 57, 64, 57, 0, 121], ["+", 8, 9, 0, 57, 64, 57, 15, 339, 0, 24], ["+", 64, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 64, 57, 15, 339, 51, 16,...
1
290
#include <iostream> #include <stdio.h> #include <string.h> #define N 220000 using namespace std; int fa[N], a[N], b[N], sum[N]; int n, m, bns, tot; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]), bns += a[i] & 1; if (bns > 2) { printf("Impossible\n"); return 0; }...
#include <iostream> #include <stdio.h> #include <string.h> #define N 220000 using namespace std; int fa[N], a[N], b[N], sum[N]; int n, m, bns, tot; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]), bns += a[i] & 1; if (bns > 2) { printf("Impossible\n"); return 0; }...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
400
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; int sum, n; int a[101], odd, evn, pos[101]; int b[101], cnt; void work() { if (n == 1) { b[++cnt] = 1, b[++cnt] = a[1] - 1; return; } if (a[1] & 1) b[++cnt] = a[1] + 1; else b[++cnt] = 1, b[++cn...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; int sum, n; int a[101], odd, evn, pos[101]; int b[101], cnt; void work() { if (n == 1) { if (a[1] == 1) b[++cnt] = 1; else b[++cnt] = 1, b[++cnt] = a[1] - 1; return; } if (a[1] & 1) b[...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
422
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int n, m, a[N]; int tmp = 0, ans[N]; bool cmp(int x, int y) { return (x & 1) > (y & 1); } int main() { cin >> n >> m; for (int i = 1; i <= m; ++i) cin >> a[i]; if (m == 1) { cout << a[1] << endl; puts("2"); cout << a[1] - 1 <...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int n, m, a[N]; int tmp = 0, ans[N]; bool cmp(int x, int y) { return (x & 1) > (y & 1); } int main() { cin >> n >> m; for (int i = 1; i <= m; ++i) cin >> a[i]; if (m == 1) { if (a[1] == 1) { return 0 * printf("1\n1\n1\n"); ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
373
#include <bits/stdc++.h> #define st first #define nd second #define mp make_pair #define pb push_back #define N 1000005 using namespace std; int n, m, a[N]; vector<int> tek, cif, b; int main() { // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); scanf("%d %d", &m, &n); for (int i = 1; i <= ...
#include <bits/stdc++.h> #define st first #define nd second #define mp make_pair #define pb push_back #define N 1000005 using namespace std; int n, m, a[N]; vector<int> tek, cif, b; int main() { // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); scanf("%d %d", &m, &n); for (int i = 1; i <= ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
419
#include <bits/stdc++.h> using namespace std; const int M = 105; int n, m, a[M], b[M]; bool cmp(int a, int b) { return (a & 1) > (b & 1); } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]); if (m == 1) { if (a[1] == 1) printf("%d", a[1]); else printf("%d ...
#include <bits/stdc++.h> using namespace std; const int M = 105; int n, m, a[M], b[M]; bool cmp(int a, int b) { return (a & 1) > (b & 1); } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]); if (m == 1) { if (a[1] == 1) printf("%d \n%d\n%d", a[1], 1, a[1]); else...
[["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 21], ["+", 64, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 0, 57, 64, 1, 0, 2, 3, 4, ...
1
351
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; #define fi first #define se second #define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, n) repl(i, 0, n) #define all(x) (x).begin(), (x).end() #define dbg(x) cout << #x "=...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; #define fi first #define se second #define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, n) repl(i, 0, n) #define all(x) (x).begin(), (x).end() #define dbg(x) cout << #x "=...
[["+", 8, 9, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 2...
1
451
#include <bits/stdc++.h> #define N 500005 using namespace std; int n, m, tot, a[N]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]); for (int i = 1; i <= m; i++) if (a[i] & 1) tot++; if (tot > 2) return puts("Impossible"), 0; if (tot == 2) { bool flag ...
#include <bits/stdc++.h> #define N 500005 using namespace std; int n, m, tot, a[N]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]); for (int i = 1; i <= m; i++) if (a[i] & 1) tot++; if (tot > 2) return puts("Impossible"), 0; if (tot) { bool flag = 0; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, ...
1
377
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 205; int n, m, cnt, a[N], b[N]; bool cmp(int x, int y) { bool s1 = x & 1, s2 = y & 1; return s1 > s2; } int main() { cin >> n >> m, cnt = 0; for (int i = 1; i <= m; ++i) { cin >> a[i]; if (a[i] & 1) ++cnt; } if ...
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 205; int n, m, cnt, a[N], b[N]; bool cmp(int x, int y) { bool s1 = x & 1, s2 = y & 1; return s1 > s2; } int main() { cin >> n >> m, cnt = 0; for (int i = 1; i <= m; ++i) { cin >> a[i]; if (a[i] & 1) ++cnt; } if ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 9, 0, 57, 64, 37, 0, 38], ["+", 0,...
1
376
#include "bits/stdc++.h" using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a; vector<int> b; for (int i = 0; i < m; i++) { int x; cin >> x; if (x % 2 == 0) { a.push_back(x); } else { b.push_back(x); } } if (b.size() > 2) { cout << "Impossible" << e...
#include "bits/stdc++.h" using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a; vector<int> b; for (int i = 0; i < m; i++) { int x; cin >> x; if (x % 2 == 0) { a.push_back(x); } else { b.push_back(x); } } if (b.size() > 2) { cout << "Impossible" << e...
[["+", 0, 57, 64, 9, 0, 57, 75, 76, 0, 95], ["+", 64, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 17, 151], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 57, 75, 76, 0...
1
372
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 10; int n, m, dat[MAXN], o1, o2; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &dat[i]); for (int i = 1; i <= m; i++) if (dat[i] & 1) if (!o1) o1 = i; else if (!o2) o2 = i; ...
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 10; int n, m, dat[MAXN], o1, o2, st; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &dat[i]); for (int i = 1; i <= m; i++) if (dat[i] & 1) if (!o1) o1 = i; else if (!o2) o2 = i;...
[["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 1, 0, 11, 12, 41, 15, 69, 28, 22], ["+", 0, 11, 12, 41, 15, 69, 341, 342, 0, 70], ["+", 0, 11, 12, 41, 15, 69, 341, 342, 0, 13], ["+", 0, 1...
1
248
// :) // "Khodaya, be man "Tagwaye setiz" biamooz ta // dar anbuh masuliat nalaghzam ..." -Shariati #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define F first #define S second #define MP make_pair const int MAX = 1e5 + 9; const ll MOD = 1e9 + 7; vector<int> e, o...
// :) // "Khodaya, be man "Tagwaye setiz" biamooz ta // dar anbuh masuliat nalaghzam ..." -Shariati #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define F first #define S second #define MP make_pair const int MAX = 1e5 + 9; const ll MOD = 1e9 + 7; vector<int> e, o...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 33], ["-", 64, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 72], ["-", 0, 57, 64, 9, 0, 57, 64, 1, 0, 35], ["-", 0, 57, 64, 9, 0, 57, 75, 76, 0, 95], ["-", 0, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["-"...
1
535
#include <bits/stdc++.h> #define sqr(A) ((A) * (A)) #define F first #define S second #define mp make_pair using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; const int MOD = 1e9 + 7; const int INF = INT_MAX; const ll LINF = LLONG_MAX; const int N = 1e2 + 20; int a[N], n, b[N...
#include <bits/stdc++.h> #define sqr(A) ((A) * (A)) #define F first #define S second #define mp make_pair using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; const int MOD = 1e9 + 7; const int INF = INT_MAX; const ll LINF = LLONG_MAX; const int N = 1e2 + 20; int a[N], n, b[N...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
433
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; const int maxn = 100100; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cou...
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; const int maxn = 100100; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cou...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["+", 0, ...
1
439
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a, odd; for (int i = 0; i < m; ++i) { int x; cin >> x; if (x & 1) odd.push_back(x); else a.push_back(x); } if (n & 1 + odd.size() >= 3) { puts("Impossible"); return 0; } ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> a, odd; for (int i = 0; i < m; ++i) { int x; cin >> x; if (x & 1) odd.push_back(x); else a.push_back(x); } if ((n & 1) + odd.size() >= 3) { puts("Impossible"); return 0; ...
[["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57,...
1
363
#include <cstdio> #define rep(i, j, k) for (i = j; i <= k; i++) using namespace std; const int N = 1e5 + 5; int n, m, i, j, odd, l, c[N], a[N], b[N]; int main() { // freopen("sequence.in","r",stdin); // freopen("sequence.out","w",stdout); scanf("%d%d", &n, &m); rep(i, 1, m) { scanf("%d", &a[i]); if (a[i...
#include <cstdio> #define rep(i, j, k) for (i = j; i <= k; i++) using namespace std; const int N = 1e5 + 5; int n, m, i, j, odd, l, c[N], a[N], b[N]; int main() { // freopen("sequence.in","r",stdin); // freopen("sequence.out","w",stdout); scanf("%d%d", &n, &m); rep(i, 1, m) { scanf("%d", &a[i]); if (a[i...
[["+", 75, 76, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, ...
1
453
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; #define MP make_pair ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; #define MP make_pair ...
[["+", 64, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["+", 64...
1
775
#include <bits/stdc++.h> using namespace std; int N, M; vector<int> E, O; int main() { cin >> N >> M; for (int i = 0; i < M; ++i) { int a; cin >> a; (a % 2 == 0 ? E : O).push_back(a); } int e = E.size(), o = O.size(); if (o > 2) cout << "Impossible" << endl; else if (M == 1) { int a = ...
#include <bits/stdc++.h> using namespace std; int N, M; vector<int> E, O; int main() { cin >> N >> M; for (int i = 0; i < M; ++i) { int a; cin >> a; (a % 2 == 0 ? E : O).push_back(a); } int e = E.size(), o = O.size(); if (o > 2) cout << "Impossible" << endl; else if (M == 1) { int a = ...
[["-", 75, 76, 0, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["-", 0, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 0, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 17, 151], ["+", 75, 76, 0, 9, 0, 1,...
1
516
#include <bits/stdc++.h> #include <stdio.h> #define pb push_back #define pf push_front #define pp pop_back #define sz(a) (int)(a.size()) #define mp make_pair #define F first #define S second #define next _next #define prev _prev #define left _left #define right _right #define y1 _y1 #define all(x) x.begin(), x.end() #...
#include <bits/stdc++.h> #include <stdio.h> #define pb push_back #define pf push_front #define pp pop_back #define sz(a) (int)(a.size()) #define mp make_pair #define F first #define S second #define next _next #define prev _prev #define left _left #define right _right #define y1 _y1 #define all(x) x.begin(), x.end() #...
[["-", 0, 57, 64, 9, 0, 1, 0, 34, 0, 21], ["-", 0, 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], ["-", 64, 9, 0, 1, 0, 34, 12, 27, 17, 29], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["-", 0, 1...
1
731
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; const int N = 100005; int n, m, cnt; int a[N], b[N]; int main() { int i; scanf("%d%d", &n, &m); for (i = 1; i <= m; i++) { scanf("%d", &a[i]); if (a[i] & 1) cnt++...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; const int N = 100005; int n, m, cnt, t; int a[N], b[N]; int main() { int i; cnt = 0; scanf("%d%d", &n, &m); for (i = 1; i <= m; i++) { scanf("%d", &a[i]); if (a[i] & ...
[["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 11, 31, 69, 341,...
1
374
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int N = 110; int n, m, a[N], b[N]; int main() { freopen("1.in", "r", stdin); freopen("1.out", "w", stdout); scanf("%d%d", &n, &m); int iodd = 0; for (int i = 1; i <= m; i++) scanf("%d", &a[i]), iodd += (a[i] & 1); ...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int N = 110; int n, m, a[N], b[N]; int main() { scanf("%d%d", &n, &m); int iodd = 0; for (int i = 1; i <= m; i++) scanf("%d", &a[i]), iodd += (a[i] & 1); if (m == 1) { if (a[1] == 1) printf("%d\n1\n%d\n", 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, 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
393
#include <algorithm> #include <cstdio> #define FOR(i, l, r) for (int i = l; i <= r; ++i) using namespace std; int n, m, tot; int a[110]; int main() { scanf("%d%d", &n, &m); FOR(i, 1, m) { scanf("%d", &a[i]); if (a[i] & 1) ++tot; } if (tot > 2) { puts("Impossible"); return 0; } if (m...
#include <algorithm> #include <cstdio> #define FOR(i, l, r) for (int i = l; i <= r; ++i) using namespace std; int n, m, tot; int a[110]; int main() { scanf("%d%d", &n, &m); FOR(i, 1, m) { scanf("%d", &a[i]); if (a[i] & 1) ++tot; } if (tot > 2) { puts("Impossible"); return 0; } if (m...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["+", 64, 1...
1
311
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; int n, m, a[200005], b[200005], sum; bool vis[200005]; bool cmp(int a, int b) { if ((a & 1) != (b & 1)) return (a & 1) > (b & 1); return a > b; } int main() { scanf("%d%d", &n, &m); int tot = 0; for (int i =...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; int n, m, a[200005], b[200005], sum; bool vis[200005]; bool cmp(int a, int b) { if ((a & 1) != (b & 1)) return (a & 1) > (b & 1); return a > b; } int main() { scanf("%d%d", &n, &m); int tot = 0; for (int i =...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 57...
1
374
#include <bits/stdc++.h> #define endl '\n' using namespace std; template <class T, class T2> inline void chkmax(T &x, const T2 &y) { if (x < y) x = y; } template <class T, class T2> inline void chkmin(T &x, const T2 &y) { if (x > y) x = y; } const int MAXN = (1 << 20); int n, m; int a[MAXN]; void read() ...
#include <bits/stdc++.h> #define endl '\n' using namespace std; template <class T, class T2> inline void chkmax(T &x, const T2 &y) { if (x < y) x = y; } template <class T, class T2> inline void chkmin(T &x, const T2 &y) { if (x > y) x = y; } const int MAXN = (1 << 20); int n, m; int a[MAXN]; void read() ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 1...
1
484
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<( ...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) \ sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<( ...
[["+", 0, 30, 0, 42, 0, 14, 8, 9, 0, 45], ["+", 0, 42, 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, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73],...
1
592
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> P; typedef pair<int, P> P1; #define fr first #define...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> P; typedef pair<int, P> P1; #define fr first #define...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["-", 0, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["-", 0, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["-", 0, 9, 0, 1, 0, 2, 6...
1
817
#include <bits/stdc++.h> #define ADD(a, b) a = (a + ll(b)) % mod #define MUL(a, b) a = (a * ll(b)) % mod #define MAX(a, b) a = max(a, b) #define MIN(a, b) a = min(a, b) #define rep(i, a, b) for (int i = int(a); i < int(b); i++) #define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--) #define all(a) (a).begin(), ...
#include <bits/stdc++.h> #define ADD(a, b) a = (a + ll(b)) % mod #define MUL(a, b) a = (a * ll(b)) % mod #define MAX(a, b) a = max(a, b) #define MIN(a, b) a = min(a, b) #define rep(i, a, b) for (int i = int(a); i < int(b); i++) #define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--) #define all(a) (a).begin(), ...
[["-", 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, 19], ["-", 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
891
#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++) using namespace std; int a[100010]; int main() { int n, m; scanf("%d%d", &n, &m); int t1 = 0, t2 = 0; Rep(i, m) { scanf("%d", &a[i]); if (a[i] & 1) { if (!t1) ...
#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++) using namespace std; int a[100010]; int main() { int n, m; scanf("%d%d", &n, &m); int t1 = 0, t2 = 0; Rep(i, m) { scanf("%d", &a[i]); if (a[i] & 1) { if (!t1) ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
293
#include <cstdio> const int N = 105; int n, i, dn, d[3], an, a[N]; int read() { char c = getchar(); int k = 0; for (; c < 48 || c > 57; c = getchar()) ; for (; c > 47 && c < 58; c = getchar()) k = (k << 3) + (k << 1) + c - 48; return k; } void write(int x) { if (x > 9) write(x / 10); putchar(x...
#include <cstdio> const int N = 105; int n, i, dn, d[3], an, a[N]; int read() { char c = getchar(); int k = 0; for (; c < 48 || c > 57; c = getchar()) ; for (; c > 47 && c < 58; c = getchar()) k = (k << 3) + (k << 1) + c - 48; return k; } void write(int x) { if (x > 9) write(x / 10); putchar(x...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 91, 17, 111], ["-", 0, 57, 15, 339, 51, 16, 12, 91, 28, 22], ["-", 0, 57, 64, 1, 0, 11, 31, 69, 28, 22], ["-", 64, 1, 0, 11, 31, 69, 341, 342, 0, 70...
1
374
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define sz(x) (int)(x.size()) #define fr(i, a, b) for (int i = a; i < b; ++i) ///////////////////// vector<int> a, b; int n, m; void bad() { cout << "Impossible" << endl; exit(0); } void solve() { cin >> n >> m; a.resize(m); ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define sz(x) (int)(x.size()) #define fr(i, a, b) for (int i = a; i < b; ++i) ///////////////////// vector<int> a, b; int n, m; void bad() { cout << "Impossible" << endl; exit(0); } void solve() { cin >> n >> m; a.resize(m); ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["+", 64,...
1
375
#include <algorithm> #include <array> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <tuple> #include <unord...
#include <algorithm> #include <array> #include <bitset> #include <chrono> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <tuple> #include <unord...
[["+", 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], ["+", 31, 16, 3...
1
660
#include <bits/stdc++.h> using namespace std; typedef long long int LL; typedef LL ll; typedef string str; typedef pair<ll, ll> pll; typedef vector<ll> vll; typedef stringstream strs; #define X first #define Y second #define PB push_back #define For(i, a, b) for (int i = a; i < b; i++) #define Ford(i, a, b) for (int...
#include <bits/stdc++.h> using namespace std; typedef long long int LL; typedef LL ll; typedef string str; typedef pair<ll, ll> pll; typedef vector<ll> vll; typedef stringstream strs; #define X first #define Y second #define PB push_back #define For(i, a, b) for (int i = a; i < b; i++) #define Ford(i, a, b) 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], ["+", 0, 57, 64...
1
386
#include <bits/stdc++.h> using namespace std; const int N = 100010, M = 110; int n, m, a[M], b[N], cnt, tot, res[N]; int rec[3]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; ++i) { scanf("%d", &a[i]); cnt += a[i] & 1; if (a[i] & 1 && cnt <= 2) rec[cnt] = a[i]; } if (cnt > 2) ...
#include <bits/stdc++.h> using namespace std; const int N = 100010, M = 110; int n, m, a[M], b[N], cnt, tot, res[N]; int rec[3]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; ++i) { scanf("%d", &a[i]); cnt += a[i] & 1; if (a[i] & 1 && cnt <= 2) rec[cnt] = a[i]; } if (cnt > 2) ...
[["+", 0, 14, 8, 9, 0, 7, 8, 57, 0, 121], ["+", 8, 9, 0, 7, 8, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 69, 28, 22], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["+", 8, 57, 15, 339, 51, 16, 31, 16, 17, 10...
1
352
#include <cstdio> #include <cstring> #include <vector> using namespace std; int n, m; vector<int> s1, s2, s; int main() { scanf("%d%d", &n, &m); int c0 = 0; for (int i = 1; i <= m; i++) { int t; scanf("%d", &t); if (t & 1) s2.push_back(t); else s1.push_back(t); } if (s2.size() > ...
#include <cstdio> #include <cstring> #include <vector> using namespace std; int n, m; vector<int> s1, s2, s; int main() { scanf("%d%d", &n, &m); int c0 = 0; for (int i = 1; i <= m; i++) { int t; scanf("%d", &t); if (t & 1) s2.push_back(t); else s1.push_back(t); } if (s2.size() > ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
381
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define each(i, a) for (auto &&i : a) #define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++) #define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--) #define REP(i, n) FOR(i, 0, n...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define each(i, a) for (auto &&i : a) #define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++) #define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--) #define REP(i, n) FOR(i, 0, n...
[["+", 8, 9, 0, 246, 8, 9, 0, 57, 0, 121], ["+", 0, 246, 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, 246, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 246, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 64, 9,...
1
998
#include <algorithm> #include <cstdio> #include <cstring> #define rep(i, a, b) for (i = a; i <= b; i++) using namespace std; const int N = 110; int a[N], b[N]; int k1[N], k2[N]; int cnt1, cnt2, cnt; int main() { // freopen("a.in","r",stdin); // freopen("a.out","w",stdout); int n, m, i; scanf("%d%d", &n, &m); ...
#include <algorithm> #include <cstdio> #include <cstring> #define rep(i, a, b) for (i = a; i <= b; i++) using namespace std; const int N = 110; int a[N], b[N]; int k1[N], k2[N]; int cnt1, cnt2, cnt; int main() { // freopen("a.in","r",stdin); // freopen("a.out","w",stdout); int n, m, i; scanf("%d%d", &n, &m); ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["+", 64, 1...
1
335
// This amazing code is by Eric Sunli Chen. #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using ...
// This amazing code is by Eric Sunli Chen. #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using ...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 64, ...
1
626
#include <cstdio> #include <iostream> using namespace std; const int M = 105; int n, m, arr[M]; int main() { int p1 = 0, p2 = 0; scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &arr[i]); if (arr[i] & 1) { if (p1 && p2) return !puts("Impossible"); else if (!p1) ...
#include <cstdio> #include <iostream> using namespace std; const int M = 105; int n, m, arr[M]; int main() { int p1 = 0, p2 = 0; scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &arr[i]); if (arr[i] & 1) { if (p1 && p2) return puts("Impossible"), 0; else if (!p1) ...
[["-", 64, 9, 0, 57, 64, 37, 0, 91, 17, 111], ["+", 64, 9, 0, 57, 64, 37, 0, 34, 0, 21], ["+", 64, 9, 0, 57, 64, 37, 0, 34, 12, 13], ["-", 8, 9, 0, 57, 64, 37, 0, 91, 17, 111], ["+", 8, 9, 0, 57, 64, 37, 0, 34, 0, 21], ["+", 8, 9, 0, 57, 64, 37, 0, 34, 12, 13], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, ...
1
331
#include <bits/stdc++.h> using namespace std; int n, m, a[105], b[105]; int main() { int odd, p1, p2, ma, mb; cin >> n >> m; for (int i = 1; i <= m; ++i) cin >> a[i]; odd = p1 = p2 = 0; for (int i = 1; i <= m; ++i) if (a[i] & 1) { ++odd; if (!p1) p1 = i; else if (!p2) ...
#include <bits/stdc++.h> using namespace std; int n, m, a[105], b[105]; int main() { int odd, p1, p2, ma, mb; cin >> n >> m; for (int i = 1; i <= m; ++i) cin >> a[i]; odd = p1 = p2 = 0; for (int i = 1; i <= m; ++i) if (a[i] & 1) { ++odd; if (!p1) p1 = i; else if (!p2) ...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 8, 9, 0, 57, 64, 1, 0, 34, 0, 21], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["-", 0, 34, 12, 34, 31, 11, 12, 16, 31, 22], ["-", 0, 34, 12, 34, 31, 11, 12, 16, 17, 33], ["-", 0, 57, 64, 1, 0, 34, 12, 34, 0, 21], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 64, 9, 0, 1, ...
1
385
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; #define rep(i, n) for (int i = 0; i < ...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 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], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["...
1
528
#include <bits/stdc++.h> using namespace std; const int N = 5e5 + 9; vector<int> V[2], ans, ret; int n, sum; int main() { scanf("%d%d", &sum, &n); for (int i = 1, j; i <= n; ++i) { scanf("%d", &j); V[j & 1].emplace_back(j); } if (V[1].size() > 2) return puts("Impossible"), 0; if (V[1].size()) ...
#include <bits/stdc++.h> using namespace std; const int N = 5e5 + 9; vector<int> V[2], ans, ret; int n, sum; int main() { scanf("%d%d", &sum, &n); for (int i = 1, j; i <= n; ++i) { scanf("%d", &j); V[j & 1].emplace_back(j); } if (V[1].size() > 2) return puts("Impossible"), 0; if (V[1].size()) ...
[["+", 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, 2, 3, 4, 0, 25], ["+", 0, 14, 8, ...
1
276
#include <algorithm> #include <iostream> #include <memory.h> #include <stdio.h> #include <vector> using namespace std; typedef long long LL; const int maxn = 505; const int A = 1000; int n, m, a[maxn], stk[maxn], top; int main() { #ifdef Amberframe freopen("agc001d.in", "r", stdin); freopen("agc001d.out", "w", st...
#include <algorithm> #include <iostream> #include <memory.h> #include <stdio.h> #include <vector> using namespace std; typedef long long LL; const int maxn = 505; const int A = 1000; int n, m, a[maxn], stk[maxn], top; int main() { #ifdef Amberframe freopen("agc001d.in", "r", stdin); freopen("agc001d.out", "w", st...
[["+", 75, 76, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], [...
1
313
#include <bits/stdc++.h> using namespace std; int n, m, a[110], b[100005], cnt = 0; int pla1, pla2; int main() { scanf("%d %d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &a[i]); if (a[i] & 1) { cnt++; if (pla1) pla2 = i; else pla1 = i; } } if (m == 1) { ...
#include <bits/stdc++.h> using namespace std; int n, m, a[110], b[100005], cnt = 0; int pla1, pla2; int main() { scanf("%d %d", &n, &m); for (int i = 1; i <= m; i++) { scanf("%d", &a[i]); if (a[i] & 1) { cnt++; if (pla1) pla2 = i; else pla1 = i; } } if (m == 1) { ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
338
// 2017-8-22 // miaomiao // #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; #define LL long long #define For(i, a, b) for (int i = (a); i <= (int)(b); ++i) #define Forr(i, a, b) for (int i = (a); i >= (int)(b); --i) #define N (100...
// 2017-8-22 // miaomiao // #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; #define LL long long #define For(i, a, b) for (int i = (a); i <= (int)(b); ++i) #define Forr(i, a, b) for (int i = (a); i >= (int)(b); --i) #define N (100...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["+", 64, 1...
1
774
#include <bits/stdc++.h> using namespace std; int m, n; const int N = 200; int ai[N], c; int main() { cin >> m >> n; if (n == 1) { int a; cin >> a; if (a == 1) cout << 1 << endl << 1 << endl << 1 << endl; else cout << a << endl << 2 << endl << a - 1 << " " << 1 << endl; return 0; }...
#include <bits/stdc++.h> using namespace std; int m, n; const int N = 200; int ai[N], c; int main() { cin >> m >> n; if (n == 1) { int a; cin >> a; if (a == 1) cout << 1 << endl << 1 << endl << 1 << endl; else cout << a << endl << 2 << endl << a - 1 << " " << 1 << endl; return 0; }...
[["-", 8, 1, 0, 34, 12, 11, 12, 23, 0, 24], ["-", 12, 11, 12, 23, 0, 16, 31, 16, 17, 109], ["-", 12, 11, 12, 23, 0, 16, 31, 16, 12, 13], ["-", 0, 34, 12, 11, 12, 23, 0, 16, 17, 60], ["-", 0, 34, 12, 11, 12, 23, 0, 16, 12, 13], ["-", 8, 1, 0, 34, 12, 11, 12, 23, 0, 25], ["+", 8, 1, 0, 34, 12, 11, 12, 16, 17, 67], ["+", ...
1
367
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; const int MAX_N = 100005; int N, M, A[MAX_N], B[MAX_N], odd; int main() { scanf("%d%d", &N, &M); for (int i = 1; i <= M; ++i) { scanf("%d", &A[i]); if (A[i] & 1) odd++; } if (M == 1) { if (N == 1) printf("...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; const int MAX_N = 100005; int N, M, A[MAX_N], B[MAX_N], odd; int main() { scanf("%d%d", &N, &M); for (int i = 1; i <= M; ++i) { scanf("%d", &A[i]); if (A[i] & 1) odd++; } if (M == 1) { if (N == 1) printf("...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107], ["-", 64, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 70], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 73], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
402
#include <bits/stdc++.h> using namespace std; int n, m, a[210]; int main() { #ifdef h10 freopen("D.in", "r", stdin); freopen("D.out", "w", stdout); #endif int i, j; scanf("%d%d", &m, &n); for (i = 1; i <= n; i++) scanf("%d", &a[i]); if (n == 1) { printf("%d\n", a[1]); printf("2\n"); printf...
#include <bits/stdc++.h> using namespace std; int n, m, a[210]; int main() { #ifdef h10 freopen("D.in", "r", stdin); freopen("D.out", "w", stdout); #endif int i, j; scanf("%d%d", &m, &n); for (i = 1; i <= n; i++) scanf("%d", &a[i]); if (n == 1) { printf("%d\n", a[1]); if (a[1] == 1) prin...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
531
#include <algorithm> #include <cstdio> int N, M, a[100], b[100]; int main() { scanf("%d%d", &N, &M); for (int i = 0; i < M; i++) scanf("%d", a + i); if (M == 1) { if (N == 1) puts("1\n1\n1"); else printf("%d\n2\n1 %d\n", N, N - 1); return 0; } int Odd = std::count_if(a, a + M, [](i...
#include <algorithm> #include <cstdio> int N, M, a[100], b[100]; int main() { scanf("%d%d", &N, &M); for (int i = 0; i < M; i++) scanf("%d", a + i); if (M == 1) { if (N == 1) puts("1\n1\n1"); else printf("%d\n2\n1 %d\n", N, N - 1); return 0; } int Odd = std::count_if(a, a + M, [](i...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["-", 64, 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], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 8, ...
1
614
#include <bits/stdc++.h> using namespace std; int a[110], flag, n, x, m; int main() { scanf("%d%d", &m, &n); for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), x += a[i] % 2; if (n == 1) return printf("%d\n2\n%d %d", a[1], a[1] - 1, 1), 0; if (x > 2) return puts("Impossible"), 0; if (x) for (int...
#include <bits/stdc++.h> using namespace std; int a[110], flag, n, x, m; int main() { scanf("%d%d", &m, &n); for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), x += a[i] % 2; if (n == 1 && a[1] == 1) return printf("1\n1\n1"), 0; if (n == 1) return printf("%d\n2\n%d %d", a[1], a[1] - 1, 1), 0; if (x ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 1...
1
277
#include <bits/stdc++.h> using namespace std; const int N = 105; int n, m, a[N], k, b[N], l; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]), k += a[i] & 1; if (k > 2) puts("Impossible"), exit(0); for (int i = 1; i <= m; i++) if (a[i] & 1) swap(a[1], a[i]...
#include <bits/stdc++.h> using namespace std; const int N = 105; int n, m, a[N], k, b[N], l; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]), k += a[i] & 1; if (k > 2) puts("Impossible"), exit(0); for (int i = 1; i <= m; i++) if (a[i] & 1) swap(a[1], a[i]...
[["-", 0, 57, 64, 1, 0, 34, 31, 2, 63, 22], ["-", 64, 1, 0, 34, 31, 2, 3, 4, 0, 24], ["-", 0, 34, 31, 2, 3, 4, 0, 5, 0, 62], ["-", 0, 34, 31, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 34, 31, 2, 3, 4, 0, 5, 0, 44], ["-", 64, 1, 0, 34, 31, 2, 3, 4, 0, 21], ["-", 31, 2, 3, 4, 0, 16, 31, 69, 28, 22], ["-", 3, 4, 0, 16, 31, 69, 341, ...
1
335
#include <algorithm> #include <cstdio> #include <cstring> #define N 110 using namespace std; int n, m, sum, s, a[N], b[N]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]); sum = 0; for (int i = 1; i <= m; i++) if (a[i] & 1) sum++; if (sum >= 3) { printf("I...
#include <algorithm> #include <cstdio> #include <cstring> #define N 110 using namespace std; int n, m, m1, sum, s, a[N], b[N]; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++) scanf("%d", &a[i]); sum = 0; for (int i = 1; i <= m; i++) if (a[i] & 1) sum++; if (sum >= 3) { print...
[["+", 36, 36, 36, 36, 0, 30, 0, 43, 49, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 75, 76,...
1
382
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <vector> using namespace std; const int MAXN = 100000 + 100; int len, n; vector<int> odd, ans; int main() { ios::sync_with_stdio(false); // freopen("1.in", "r", stdin); /...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <vector> using namespace std; const int MAXN = 100000 + 100; int len, n; vector<int> odd, ans; int main() { ios::sync_with_stdio(false); // freopen("1.in", "r", stdin); /...
[["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["-", 0, 16, 31, 16, 31...
1
321
#include <bits/stdc++.h> #define long long long #define ull unsigned long long #define up(i, a, b) for (int i = a; i <= b; i++) #define upadj(i, adj) \ if (adj.size() > 0) \ up(i, 0, adj.size() - 1) #de...
#include <bits/stdc++.h> #define long long long #define ull unsigned long long #define up(i, a, b) for (int i = a; i <= b; i++) #define upadj(i, adj) \ if (adj.size() > 0) \ up(i, 0, adj.size() - 1) #de...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
704
#include <bits/stdc++.h> using namespace std; #define X first #define Y second #define pb push_back #define mp make_pair typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef long long LL; int a[105]; int main() { int n, m; scanf("%d %d", &n, &m); if (m == 1) { printf("%d\n", n); ...
#include <bits/stdc++.h> using namespace std; #define X first #define Y second #define pb push_back #define mp make_pair typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef long long LL; int a[105]; int main() { int n, m; scanf("%d %d", &n, &m); if (m == 1) { printf("%d\n", n); ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["+", 0, ...
1
406
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define fi first #define sc second #define mod 1000000007 int n, m, a[105]; int ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define fi first #define sc second #define mod 1000000007 int n, m, a[105]; int ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 64, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["+", 0, ...
1
585
#include <cstdio> #include <cstring> #include <iostream> const int N = 105; int s[N]; int n, m; int main() { scanf("%d%d", &n, &m); int cnt = 0; for (int i = 1; i <= m; i++) { scanf("%d", s + i); if (s[i] & 1) cnt++; } if (cnt > 2) printf("Impossible\n"); else { if (m == 1) { pri...
#include <cstdio> #include <cstring> #include <iostream> const int N = 105; int s[N]; int n, m; int main() { scanf("%d%d", &n, &m); int cnt = 0; for (int i = 1; i <= m; i++) { scanf("%d", s + i); if (s[i] & 1) cnt++; } if (cnt > 2) printf("Impossible\n"); else { // if(cnt==1)while(1){...
[["+", 0, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
343
#include <bits/stdc++.h> using namespace std; #define MAX 100002 int n; int m; vector<int> v; vector<int> vv[2]; vector<int> w; vector<int> ans; int main() { cin >> n >> m; for (int i = 0; i < m; i++) { int a; scanf("%d", &a); vv[a & 1].push_back(a); w.push_back(a); } if (m == 1) { cout...
#include <bits/stdc++.h> using namespace std; #define MAX 100002 int n; int m; vector<int> v; vector<int> vv[2]; vector<int> w; vector<int> ans; int main() { cin >> n >> m; for (int i = 0; i < m; i++) { int a; scanf("%d", &a); vv[a & 1].push_back(a); w.push_back(a); } if (m == 1 && w[0] == ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 1...
1
444
#include <iostream> using namespace std; int N, M; int A[100005]; int p[3]; int main() { cin >> N >> M; for (int i = 1; i <= M; i++) { cin >> A[i]; if (A[i] % 2 == 1) { p[0]++; if (p[0] > 2) { cout << "Impossible"; return 0; } p[p[0]] = i; } } if (p[1]) sw...
#include <iostream> using namespace std; int N, M; int A[100005]; int p[3]; int main() { cin >> N >> M; for (int i = 1; i <= M; i++) { cin >> A[i]; if (A[i] % 2 == 1) { p[0]++; if (p[0] > 2) { cout << "Impossible"; return 0; } p[p[0]] = i; } } if (p[1]) sw...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
289
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) typedef long long LL; int N, M; int A[101]; vector<int> v; vecto...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) typedef long long LL; int N, M; int A[101]; vector<int> v; vecto...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
520
#include <cstdio> #include <vector> using namespace std; const int M = 110; int a2[M]; vector<int> odd; vector<int> even; vector<int> a; vector<int> b; int main() { int n, m; scanf("%d %d", &n, &m); for (int i = 0; i < m; i++) { scanf("%d", &a2[i]); if (a2[i] & 1) odd.push_back(a2[i]); else ...
#include <cassert> #include <cstdio> #include <vector> using namespace std; const int M = 110; int a2[M]; vector<int> odd; vector<int> even; vector<int> a; vector<int> b; int main() { int n, m; scanf("%d %d", &n, &m); for (int i = 0; i < m; i++) { scanf("%d", &a2[i]); if (a2[i] & 1) odd.push_bac...
[["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 11...
1
454
#include <bits/stdc++.h> using namespace std; const int mmax = 100 + 10; int n, m; int a[mmax], b[mmax]; int main() { // freopen("input","r",stdin); // freopen("output","w",stdout); scanf("%d %d", &n, &m); int odd = 0; for (int i = 1; i <= m; ++i) { scanf("%d", &a[i]); odd += (a[i] & 1); } ...
#include <bits/stdc++.h> using namespace std; const int mmax = 100 + 10; int n, m; int a[mmax], b[mmax]; int main() { // freopen("input","r",stdin); // freopen("output","w",stdout); scanf("%d %d", &n, &m); int odd = 0; for (int i = 1; i <= m; ++i) { scanf("%d", &a[i]); odd += (a[i] & 1); } ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["-", 75, 76, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 75, 76, 0, 1, 0, ...
1
366
#include <iostream> using namespace std; int main(int argc, char *argv[]) { int N, M; cin >> N >> M; int oddcount = 0; int odd[2]; int A[M]; int i; int r; for (i = 0; i < M; ++i) { cin >> r; if (r % 2 != 0) { if (oddcount > 1) { cout << "Impossible" << endl; return 0; ...
#include <iostream> using namespace std; int main(int argc, char *argv[]) { int N, M; cin >> N >> M; int oddcount = 0; int odd[2]; int A[M]; int i; int r; for (i = 0; i < M; ++i) { cin >> r; if (r % 2 != 0) { if (oddcount > 1) { cout << "Impossible" << endl; return 0; ...
[["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["-", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
620
#include <iostream> #include <vector> void output(std::vector<int> v) { for (int i = 0; i < v.size() - 1; i++) { std::cout << v[i] << " "; } std::cout << v[v.size() - 1] << std::endl; } int main(void) { std::vector<int> odd; std::vector<int> even; std::vector<int> A; int N, M; std::cin >> N >> M; ...
#include <iostream> #include <vector> void output(std::vector<int> v) { for (int i = 0; i < v.size() - 1; i++) { std::cout << v[i] << " "; } std::cout << v[v.size() - 1] << std::endl; } int main(void) { std::vector<int> odd; std::vector<int> even; std::vector<int> A; int N, M; std::cin >> N >> M; ...
[["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 51, 16, 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, 13], ["-", 12, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 109], ["-", 15, 339, 51, 16, 12, 16, 3...
1
485
#include <algorithm> #include <stdio.h> using namespace std; int n, L, w[110], c1, c2, R[110], RC, s; int main() { int i; scanf("%d%d", &L, &n); for (i = 1; i <= n; i++) { scanf("%d", &w[i]); if (w[i] % 2) { if (!c1) c1 = i; else if (!c2) c2 = i; else { printf("Im...
#include <algorithm> #include <stdio.h> using namespace std; int n, L, w[110], c1, c2, R[110], RC, s; int main() { int i; scanf("%d%d", &L, &n); for (i = 1; i <= n; i++) { scanf("%d", &w[i]); if (w[i] % 2) { if (!c1) c1 = i; else if (!c2) c2 = i; else { printf("Im...
[["-", 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
387
#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...
[["+", 0, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
644
#include <bits/stdc++.h> using namespace std; const int MN = 111; int a[MN]; int main() { int n, m; cin >> n >> m; vector<int> odd; vector<int> even; for (int i = 0; i < m; ++i) { cin >> a[i]; if (a[i] % 2 == 1) odd.push_back(a[i]); else even.push_back(a[i]); } if (n == 1) { co...
#include <bits/stdc++.h> using namespace std; const int MN = 111; int a[MN]; int main() { int n, m; cin >> n >> m; vector<int> odd; vector<int> even; for (int i = 0; i < m; ++i) { cin >> a[i]; if (a[i] % 2 == 1) odd.push_back(a[i]); else even.push_back(a[i]); } if (n == 1) { co...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 13], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]]
1
690
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.util.NoSuchElementException; public class Main { private static class Task { void solve(FastScanner in, PrintWriter out) { i...
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.util.NoSuchElementException; public class Main { private static class Task { void solve(FastScanner in, PrintWriter out) { i...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 62], ["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 64, 196, 0, 1, 0, 492, 3, 4, 0, 499], ["+", 64, 196, 0, 1, 0, 492, 3, 4, 0, 25], ["+", 64, 196, 0, 57, 64, 196, 0, 1, 0, 35], ["+", 0, 57, 64, 196, 0, 1, 0, 492, 500, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 492, 0, 131], ["+", 0, 57, 64...
3
1,146
#include <bits/stdc++.h> // iostream is too mainstream #include <cstdio> // bitch please #include <algorithm> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <time.h> #include <vector> #define dibs reserv...
#include <bits/stdc++.h> // iostream is too mainstream #include <cstdio> // bitch please #include <algorithm> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <time.h> #include <vector> #define dibs reserv...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 31, 22], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 12, 16, 31, 69, 341,...
1
491
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #pragma comment(linker, "/STACK:102400000,102400000") using namespace std; #define LL long long #define ULL unsigned long l...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #pragma comment(linker, "/STACK:102400000,102400000") using namespace std; #define LL long long #define ULL unsigned long l...
[["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["+", 64, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 0,...
1
634
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define ROF(i, a, b) for (int i = (a); i >= (b); i--) #define MST(a, x) memset(a, x, sizeof(a)) #define ll long long #define PB push_back #define PH push #define MP make_pair #define FT first #define SD second #define N 100005 #define M 305 ...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define ROF(i, a, b) for (int i = (a); i >= (b); i--) #define MST(a, x) memset(a, x, sizeof(a)) #define ll long long #define PB push_back #define PH push #define MP make_pair #define FT first #define SD second #define N 100005 #define M 305 ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 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, 20], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 75, 76, 0, ...
1
353
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef long double ld; #define fi first #define se second #define pb push_back #define mp make_pair const int MOD = 1e9 + 7; void no() { cout << "Impossible" << '\n'; } int main() { ios_base::...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef long double ld; #define fi first #define se second #define pb push_back #define mp make_pair const int MOD = 1e9 + 7; void no() { cout << "Impossible" << '\n'; } int main() { ios_base::...
[["-", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 64, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["-", 64, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["-", 0, 57, 64, 9, 0, 57, 7...
1
407
#include <cstdio> #include <vector> using namespace std; int m, n; int a[111]; vector<int> ans, odd, even, x; int main() { scanf("%d%d", &m, &n); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); if (a[i] % 2) odd.push_back(a[i]); else even.push_back(a[i]); } if (odd.size() > 2) { ...
#include <cstdio> #include <vector> using namespace std; int m, n; int a[111]; vector<int> ans, odd, even, x; int main() { scanf("%d%d", &m, &n); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); if (a[i] % 2) odd.push_back(a[i]); else even.push_back(a[i]); } if (odd.size() > 2) { ...
[["+", 0, 7, 8, 57, 64, 9, 0, 57, 0, 121], ["+", 8, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17...
1
408
#include <bits/stdc++.h> using namespace std; int n, m; const int maxn = 1e5 + 10; int a[maxn], b[maxn]; int main() { cin >> n >> m; int f = 0; for (int i = 1; i <= m; i++) { cin >> a[i]; if (a[i] % 2) { f++; } } if (f > 2) { cout << "Impossible"; return 0; } int p = 0; if (m =...
#include <bits/stdc++.h> using namespace std; int n, m; const int maxn = 1e5 + 10; int a[maxn], b[maxn]; int main() { cin >> n >> m; int f = 0; for (int i = 1; i <= m; i++) { cin >> a[i]; if (a[i] % 2) { f++; } } if (f > 2) { cout << "Impossible"; return 0; } int p = 0; if (m =...
[["-", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["-", 15, 339, 51, 16, 31, 23, 0, 16, 17, 33], ["-", 15, 339, 51, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17,...
1
432
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) const double PI = 3.1415926535897932384626433832795028841971; const int INF = 100000000; const double EPS = 1e-10; const int MOD = 1000000007; using namespace std; typedef long long ll; typedef pair<int, int> P; int n, m; int a[100]; bool checkfun...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) const double PI = 3.1415926535897932384626433832795028841971; const int INF = 100000000; const double EPS = 1e-10; const int MOD = 1000000007; using namespace std; typedef long long ll; typedef pair<int, int> P; int n, m; int a[100]; bool checkfun...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 109], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 0, 7, 8, 1, 0, 2, 3, 4, 0, 13], ...
1
931
import static java.lang.Math.*; import static java.util.Arrays.*; import java.io.*; import java.util.*; public class Main { void solve() { int N = sc.nextInt(); int M = sc.nextInt(); int[] A = sc.nextIntArray(M); if (M == 1) { int[] B = new int[] {A[0] - 1, 1}; print(A); out.prin...
import static java.lang.Math.*; import static java.util.Arrays.*; import java.io.*; import java.util.*; public class Main { void solve() { int N = sc.nextInt(); int M = sc.nextInt(); int[] A = sc.nextIntArray(M); if (M == 1) { if (A[0] == 1) { print(A); out.println(1); ...
[["+", 8, 196, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 0, 57, 64, 196, 0, 57, 15, 15, 0, 24], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 516, 22], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 0, 70], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 71, 499], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 0, 73], ["+", 64, 196, 0, 57, 15, 15, 0, 16, 17, 60]...
3
998
#include <bits/stdc++.h> using namespace std; struct UnionFind { vector<int> data; UnionFind(int size) : data(size, -1) {} bool unite(int x, int y) { x = root(x); y = root(y); if (x != y) { if (data[y] < data[x]) swap(x, y); data[x] += data[y]; data[y] = x; } return ...
#include <bits/stdc++.h> using namespace std; struct UnionFind { vector<int> data; UnionFind(int size) : data(size, -1) {} bool unite(int x, int y) { x = root(x); y = root(y); if (x != y) { if (data[y] < data[x]) swap(x, y); data[x] += data[y]; data[y] = x; } return ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 2, 3, 4, 0, 69, 28, 22], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["-", 0, 2, 3, 4, 0, 69, 3...
1
758
#include <bits/stdc++.h> using namespace std; const int maxm = 111; int m, n; int f[maxm]; int odd; vector<int> g; int main() { scanf("%d%d", &m, &n); for (int i = 1; i <= n; i++) { scanf("%d", &f[i]); if (f[i] % 2 == 1) odd++; } if (odd > 2) { cout << "Impossible" << endl; return 0; } ...
#include <bits/stdc++.h> using namespace std; const int maxm = 111; int m, n; int f[maxm]; int odd; vector<int> g; int main() { scanf("%d%d", &m, &n); for (int i = 1; i <= n; i++) { scanf("%d", &f[i]); if (f[i] % 2 == 1) odd++; } if (odd > 2) { cout << "Impossible" << endl; return 0; } ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 69, 28, 22], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17,...
1
378
#include <bits/stdc++.h> using namespace std; int M, N; int main() { scanf("%d%d", &M, &N); vector<int> even; vector<int> odd; for (int i = 0; i < N; i++) { int a; scanf("%d", &a); if (a % 2 == 0) even.push_back(a); else odd.push_back(a); } if (odd.size() > 2) printf("Impo...
#include <bits/stdc++.h> using namespace std; int M, N; int main() { scanf("%d%d", &M, &N); vector<int> even; vector<int> odd; for (int i = 0; i < N; i++) { int a; scanf("%d", &a); if (a % 2 == 0) even.push_back(a); else odd.push_back(a); } if (odd.size() > 2) printf("Impo...
[["+", 75, 76, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73...
1
301
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; int *A = new int[M]; int cnt = 0; for (int i = 0; i < M; ++i) { cin >> A[i]; if (A[i] % 2 == 1) ++cnt; } if (cnt == 0) { // sequ...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; int *A = new int[M]; int cnt = 0; for (int i = 0; i < M; ++i) { cin >> A[i]; if (A[i] % 2 == 1) ++cnt; } if (cnt == 0) { // sequ...
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 44], ["+", 0, 16, 31, 16, 12, 16, 31, 69, 28, 22], ["+", 31, 16, 12, 1...
1
767
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <typeinfo> #include <vector> #define DIV 1000000007 using namespace std; long long N, M; lon...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <typeinfo> #include <vector> #define DIV 1000000007 using namespace std; long long N, M; lon...
[["-", 64, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 1, 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, 13], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 73], ["+",...
1
585
#include <bits/stdc++.h> using namespace std; int n, m; int a[500]; int main() { scanf("%d%d", &n, &m); for (int i = 0; i < m; i++) scanf("%d", &a[i]); if (m == 1) { if (n == 1) printf("%d\n%d\n%d\n", 1, 1, 1); else printf("%d\n%d %d\n", n, n - 1, 1); } else { vector<int> f, g; ...
#include <bits/stdc++.h> using namespace std; int n, m; int a[500]; int main() { scanf("%d%d", &n, &m); for (int i = 0; i < m; i++) scanf("%d", &a[i]); if (m == 1) { if (n == 1) printf("%d\n%d\n%d\n", 1, 1, 1); else printf("%d\n2\n%d %d\n", n, n - 1, 1); } else { vector<int> f, g; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 1...
1
471
#include <bits/stdc++.h> using namespace std; int n, m; int a[500]; int main() { scanf("%d%d", &n, &m); for (int i = 0; i < m; i++) scanf("%d", &a[i]); if (m == 1) { if (n == 1) printf("%d\n%d\n", 1, 1); else printf("%d\n%d %d\n", 2, n - 1, 1); } else { vector<int> f, g; for (i...
#include <bits/stdc++.h> using namespace std; int n, m; int a[500]; int main() { scanf("%d%d", &n, &m); for (int i = 0; i < m; i++) scanf("%d", &a[i]); if (m == 1) { if (n == 1) printf("%d\n%d\n%d\n", 1, 1, 1); else printf("%d\n2\n%d %d\n", n, n - 1, 1); } else { vector<int> f, g; ...
[["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 75, 76, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 0...
1
473
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vb = vector<bool>; using vvb = vector<vb>; using vl = vector<ll>; using vvl = vector<vl>; using vd = vector<double>; using vvd = vector<vd>; #define REP(i, n) for (ll i = 0;...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vb = vector<bool>; using vvb = vector<vb>; using vl = vector<ll>; using vvl = vector<vl>; using vd = vector<double>; using vvd = vector<vd>; #define REP(i, n) for (ll i = 0;...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 1...
1
457
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue>...
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue>...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17...
1
321
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; const string IMPOSSIBLE = "Impossible"; #define LLD_SPEC "%lld" void Show(const vector<int> &ra, const vector<int> &rb) { for (int x : ra) { printf("%d ", x); } printf("\n"); printf("%d\n", (int)rb.size());...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; const string IMPOSSIBLE = "Impossible"; #define LLD_SPEC "%lld" void Show(const vector<int> &ra, const vector<int> &rb) { for (int x : ra) { printf("%d ", x); } printf("\n"); printf("%d\n", (int)rb.size());...
[["-", 0, 1, 0, 2, 3, 4, 0, 83, 0, 45], ["-", 3, 4, 0, 83, 0, 69, 341, 342, 0, 70], ["-", 3, 4, 0, 83, 0, 69, 341, 342, 0, 13], ["-", 3, 4, 0, 83, 0, 69, 341, 342, 0, 73], ["-", 0, 1, 0, 2, 3, 4, 0, 83, 0, 46], ["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 3, 4, 0, 16, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 2, 3, ...
1
561
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class Main { static InputStream is; static PrintWriter out; static String INPUT = ""; static void solve() { int ...
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class Main { static InputStream is; static PrintWriter out; static String INPUT = ""; static void solve() { int ...
[["+", 8, 196, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 0, 57, 64, 196, 0, 57, 15, 15, 0, 24], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 516, 22], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 0, 70], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 71, 499], ["+", 0, 57, 15, 15, 0, 16, 31, 504, 0, 73], ["+", 64, 196, 0, 57, 15, 15, 0, 16, 17, 60]...
3
1,468
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <map> #include <set> #include <vector> using namespace std; #define mp make_pair #define pb push_back #define x first #define y second typedef long long ll; typedef vector<int> vi; typedef pair<int...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <map> #include <set> #include <vector> using namespace std; #define mp make_pair #define pb push_back #define x first #define y second typedef long long ll; typedef vector<int> vi; typedef pair<int...
[["-", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["-", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["-", 0, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["-", 0, 11, 31, 69, 341, 342, 0, 27, 17, 29], ["-", 0, 11, 31, 69, 341, 342, 0, 27, 28, 22], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["-", 75, ...
1
594