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
#pragma comment(linker, "/STACK:256000000") #define _USE_MATH_DEFINES #define _CRT_NO_DEPRECEATE #define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> ...
#pragma comment(linker, "/STACK:256000000") #define _USE_MATH_DEFINES #define _CRT_NO_DEPRECEATE #define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> ...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 10, ...
1
359
#include <bits/stdc++.h> using namespace std; #define all(c) (c).begin(), (c).end() #define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define iter(c) __typeof((c).begin()) #define tr(it, c) for (iter(c) it = (c).begin()...
#include <bits/stdc++.h> using namespace std; #define all(c) (c).begin(), (c).end() #define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define iter(c) __typeof((c).begin()) #define tr(it, c) for (iter(c) it = (c).begin()...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 9, 0, 57, 64, 9, 0, 7, 0, 88], ["+", 0, 57, 64, 9, 0, 7, 10, 43, 39, 40], ["-", 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, 7, 10, 43, 49, 50, 0...
1
467
#include <algorithm> #include <functional> #include <stdio.h> #include <vector> using namespace std; #define all(A) (A).begin(), (A).end() #define II(A) \ int(A); \ scanf("%d", &(A)...
#include <algorithm> #include <functional> #include <stdio.h> #include <vector> using namespace std; #define all(A) (A).begin(), (A).end() #define II(A) \ int(A); \ scanf("%d", &(A)...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9,...
1
241
// {{{ by shik #include <bits/stdc++.h> #include <unistd.h> #define SZ(x) ((int)(x).size()) #define ALL(x) begin(x), end(x) #define REP(i, n) for (int i = 0; i < int(n); i++) #define REP1(i, a, b) for (int i = (a); i <= int(b); i++) #define FOR(it, c) for (auto it = (c).begin(); it != (c).end(); it++) #define MP make_p...
// {{{ by shik #include <bits/stdc++.h> #include <unistd.h> #define SZ(x) ((int)(x).size()) #define ALL(x) begin(x), end(x) #define REP(i, n) for (int i = 0; i < int(n); i++) #define REP1(i, a, b) for (int i = (a); i <= int(b); i++) #define FOR(it, c) for (auto it = (c).begin(); it != (c).end(); it++) #define MP make_p...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 1, 0, 2, 63, 22], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 0, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["+", 0, 57, 75, 76, 0, ...
1
992
#include <bits/stdc++.h> using namespace std; int a[100001]; int main() { register int n; cin >> n; for (register int i = 1; i <= n; ++i) scanf("%d", a[i]); sort(a + 1, a + n + 1, greater<int>()); for (register int i = 1; i <= n; ++i) if (i + 1 > a[i + 1]) { register int ans = 0; for (regi...
#include <bits/stdc++.h> using namespace std; bool cmp(int a, int b) { return a > b; } int a[100010]; int main() { register int n; cin >> n; for (register int i = 1; i <= n; ++i) scanf("%d", &a[i]); sort(a + 1, a + n + 1, cmp); for (register int i = 1; i <= n; ++i) if (i + 1 > a[i + 1]) { regist...
[["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 0, 30, 0, 14, 49, 53, 49, 22], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 24], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 49, 22], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 21], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 25], ["+", 3...
1
168
#include <bits/stdc++.h> #define pb push_back #define mk make_pair #define sc second #define fr first using namespace std; typedef long long ll; const int N = (int)1e6 + 5; const int mod = (int)1e9 + 7; int n, a[N], l = 1, t; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; sort(a + 1,...
#include <bits/stdc++.h> #define pb push_back #define mk make_pair #define sc second #define fr first using namespace std; typedef long long ll; const int N = (int)1e6 + 5; const int mod = (int)1e9 + 7; int n, a[N], l = 1, t, cnt; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; sort(a...
[["+", 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, 1, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 24], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 7, 10, 43,...
1
185
//#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; const int mod = (int)1e9 + 7; int n, a[N]; inline void solve() { scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); } sort(a + 1, a + n + 1, greater<int>()); int f ...
//#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; const int mod = (int)1e9 + 7; int n, a[N]; inline void solve() { scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); } sort(a + 1, a + n + 1, greater<int>()); int f ...
[["+", 31, 23, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 12, 22], ["+", 15, 16, 31, 23, 0, 16, 31, 23, 0, 25], ["+", 15, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 12, 22], ["-", 3, 4, 0, 41, 15, 23, 0, 16, 17, 67], ["-", ...
1
231
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int maxn = 1e5 + 5, inf = 1e9 + 10; int a[maxn]; int main() { int i, n, p, q; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &a[i]); sort(a, a + n); q = a[n - 1]; for (i = n - 1; i; i--) a[i] = a[i] - a[i - 1...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int maxn = 1e5 + 5, inf = 1e9 + 10; int a[maxn]; int main() { int i, n, p, q; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &a[i]); sort(a, a + n); q = a[n - 1]; for (i = n - 1; i; i--) a[i] = a[i] - a[i - 1...
[["-", 8, 9, 0, 7, 10, 11, 12, 16, 31, 22], ["-", 8, 9, 0, 7, 10, 11, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 10, 11, 12, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15...
1
254
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <string> #define REP(i, a, n) for (int i = a; i <= n; ++i) #define PER(i, a, n) for (int i =...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <string> #define REP(i, a, n) for (int i = a; i <= n; ++i) #define PER(i, a, n) for (int i =...
[["+", 12, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["+", 51, 16, 31, 16, 31, 23, 0, 16,...
1
451
// By Don4ick //#define _GLIBCXX_DEBUG #include <bits/stdc++.h> typedef long long ll; typedef long double ld; typedef unsigned int ui; #define forn(i, n) for (int i = 1; i <= n; i++) #define pb push_back #define all(x) x.begin(), x.end() #define y1 qewr1234 const double PI = acos(-1.0); const int DIR = 4; const int...
// By Don4ick //#define _GLIBCXX_DEBUG #include <bits/stdc++.h> typedef long long ll; typedef long double ld; typedef unsigned int ui; #define forn(i, n) for (int i = 1; i <= n; i++) #define pb push_back #define all(x) x.begin(), x.end() #define y1 qewr1234 const double PI = acos(-1.0); const int DIR = 4; const int...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 23, 0, 16, 31, 16, 31, 22], ["+", 51, 16, 12, 23, 0, 16, 31, 16, 17, 60], ["+", 51, 16, 12, 23, 0, 16, 31, 16, 12, 22], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 106], ["+", 12, 23, 0, 16, 12, 16, 31, 69, 28, 2...
1
341
#include <algorithm> #include <cstdio> #include <iostream> #define maxn 100005 using namespace std; int n, a[maxn]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a + 1, a + n + 1); for (int i = 1; i <= n; i++) { if (i + 1 > a[i + 1]) { int ans = 0; for (...
#include <algorithm> #include <cstdio> #include <iostream> #define maxn 100005 using namespace std; int n, a[maxn]; bool cmp(int x, int y) { return x > y; } int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a + 1, a + n + 1, cmp); for (int i = 1; i <= n; i++) { if (i + ...
[["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 0, 30, 0, 14, 49, 53, 49, 22], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 24], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 49, 22], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 21], ["+", 0, 30, 0, 14, 49, 53, 54, 55, 0, 25], ["+", 3...
1
177
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define int ll typedef vector<char> vc; typedef vector<vc> vvc; typedef vector<vvc> vvvc; typedef pair<int, int> pii; typedef pair<pii, pii> piii; typedef pair<ll, ll> pll; typ...
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define int ll typedef vector<char> vc; typedef vector<vc> vvc; typedef vector<vvc> vvvc; typedef pair<int, int> pii; typedef pair<pii, pii> piii; typedef pair<ll, ll> pll; typ...
[["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 24], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 49, 50, 51, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 16, 12, 23, 0, 25], ["-", 51, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
988
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int MAXN = 1e5 + 10; int n, a[MAXN]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a + 1, a + n + 1, greater<int>()); for (int i = 1; i <= n; i++) { if (i + 1 > a[i + 1]) { ...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int MAXN = 1e5 + 10; int n, a[MAXN]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a + 1, a + n + 1, greater<int>()); for (int i = 1; i <= n; i++) { if (i + 1 > a[i + 1]) { ...
[["-", 8, 9, 0, 57, 64, 9, 0, 43, 39, 40], ["-", 0, 57, 64, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 57, 64, 9, 0, 43, 49, 50, 0, 32], ["+", 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, 23, 0, 24], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 17, 72], ["+", 15, 33...
1
181
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; typedef long long li; #define rep(i, n) for (int i = 0; i < (n); i++) #define df 0 template <class T> void print(const T &t) { cout << t << "\n"; } template <class T, class... Ts> void print(const T &t, const Ts &...ts) { c...
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; typedef long long li; #define rep(i, n) for (int i = 0; i < (n); i++) #define df 0 template <class T> void print(const T &t) { cout << t << "\n"; } template <class T, class... Ts> void print(const T &t, const Ts &...ts) { c...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["+", 64, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 57, 64, 1, 0, 2, 3, 4, 0, 22], ["+", 0, 57, 64, 1, 0,...
1
452
#include <bits/stdc++.h> using namespace std; const int Maxn = 100005; int n, ct, pnt, a[Maxn]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a + 1, a + 1 + n, greater<int>()); for (int i = 1; i <= n; i++) if (a[i] < i) { pnt = i - 1; break; } for...
#include <bits/stdc++.h> using namespace std; const int Maxn = 100005; int n, ct, pnt, a[Maxn]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a + 1, a + 1 + n, greater<int>()); pnt = n; for (int i = 1; i <= n; i++) if (a[i] < i) { pnt = i - 1; break; ...
[["+", 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, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["-", 0, 41, 15, 16, 31, 23, 0, 16, 17, 72], ["-", 0, 41, 15, 16, 31, 23, ...
1
175
//#pragma GCC optimize(2) //#pragma GCC optimize(3,"Ofast","inline") #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <sstream> #include <stdio.h> #include <string.h> #include <string> //#include<unordered_map> #include <bitset> #include <deque> #include <queue> #include <set> #includ...
//#pragma GCC optimize(2) //#pragma GCC optimize(3,"Ofast","inline") #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <sstream> #include <stdio.h> #include <string.h> #include <string> //#include<unordered_map> #include <bitset> #include <deque> #include <queue> #include <set> #includ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 57, 64, 93, 0, 94], ["-", 0, 7, 8, 9, 0, 57, ...
1
312
//#pragma GCC optimize(2) //#pragma GCC optimize(3,"Ofast","inline") #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <sstream> #include <stdio.h> #include <string.h> #include <string> //#include<unordered_map> #include <bitset> #include <deque> #include <queue> #include <set> #includ...
//#pragma GCC optimize(2) //#pragma GCC optimize(3,"Ofast","inline") #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <sstream> #include <stdio.h> #include <string.h> #include <string> //#include<unordered_map> #include <bitset> #include <deque> #include <queue> #include <set> #includ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 139], ["+", 64, 9, 0, 57,...
1
321
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector<int> H(N); for (int i = 0; i < N; ++i) cin >> H[i]; sort(H.begin(), H.end(), greater<int>()); int cur = 0; while (cur + 1 < N && H[cur + 1] > cur + 1) cur++;...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector<int> H(N); for (int i = 0; i < N; ++i) cin >> H[i]; sort(H.begin(), H.end(), greater<int>()); int cur = 0; while (cur + 1 < N && H[cur + 1] > cur + 1) cur++;...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["-", 51, 16, 31, 16, 31, 16, 31, 16, 17, 72], ["-", 51, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 14, 8, ...
1
185
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double lf; typedef pair<int, int> ii; typedef pair<ii, int> iii; #define REP(i, n) for (int i = 0; i < n; i++) #define REP1(i, n) for (int i = 1; i <= n; i++) #define RST(i, n) memset(i, n, sizeof i) #define SZ(a) (int)a.size() #define ALL(a) a...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double lf; typedef pair<int, int> ii; typedef pair<ii, int> iii; #define REP(i, n) for (int i = 0; i < n; i++) #define REP1(i, n) for (int i = 1; i <= n; i++) #define RST(i, n) memset(i, n, sizeof i) #define SZ(a) (int)a.size() #define ALL(a) a...
[["-", 0, 52, 15, 339, 51, 16, 12, 16, 17, 60], ["-", 15, 339, 51, 16, 12, 16, 12, 69, 28, 22], ["-", 51, 16, 12, 16, 12, 69, 341, 342, 0, 70], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 47], ["-", 51, 16, 12, 16, 12, 69, 341, 342, 0, 73], ["-", 0, 14, 8, 9, 0, 52, 8, 1, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121],...
1
703
#include <bits/stdc++.h> #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++) #define FORR(i, n) for (ll i = (ll)n - 1LL; i >= 0LL; i--) #define rep(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; using ll = long long; constexpr ll Mod = 998244353; constexpr ll mod = 1e9 + 7; constexpr ll inf...
#include <bits/stdc++.h> #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++) #define FORR(i, n) for (ll i = (ll)n - 1LL; i >= 0LL; i--) #define rep(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; using ll = long long; constexpr ll Mod = 998244353; constexpr ll mod = 1e9 + 7; constexpr ll inf...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 8, 9, 0, 43,...
1
286
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; int a[N]; bool exist(int x, int y) { return y < a[x]; } bool solve(int x, int y) { bool down = exist(x + 1, y); bool right = exist(x, y + 1); bool corner = exist(x + 1, y + 1); if (!down && !right) return false; else if (!down) r...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; int a[N]; bool exist(int x, int y) { return y < a[x]; } bool solve(int x, int y) { bool down = exist(x + 1, y); bool right = exist(x, y + 1); bool corner = exist(x + 1, y + 1); if (!down && !right) return false; else if (!down) r...
[["-", 75, 76, 0, 57, 64, 37, 0, 91, 17, 111], ["-", 0, 57, 64, 37, 0, 91, 28, 2, 63, 22], ["+", 31, 16, 31, 23, 0, 16, 31, 69, 28, 22], ["+", 31, 23, 0, 16, 31, 69, 341, 342, 0, 70], ["-", 64, 37, 0, 91, 28, 2, 3, 4, 0, 21], ["+", 31, 23, 0, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["...
1
253
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int a[N]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n), reverse(a, a + n); int i = 1; while (i + 1 <= a[i]) i++; int h = a[i - 1] - i; int w = i; while (a[i] == a[w - 1]) i++; ...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int a[N]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n), reverse(a, a + n); int i = 1; while (i + 1 <= a[i]) i++; int h = a[i - 1] - i, w = 0; while (a[i + w] == i) w++; h %= 2, w...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 60], ["-", 0, 52, 15...
1
166
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; const ll MOD = 1000000007; // 998244353; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); rep(i, n) cin >> a[i]; sort(a.begin(), a.end()); reverse(a.b...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; const ll MOD = 1000000007; // 998244353; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); rep(i, n) cin >> a[i]; sort(a.begin(), a.end()); reverse(a.b...
[["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
199
#include <bits/stdc++.h> using namespace std; typedef long long ll; // mt19937 rng(333); mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); const int N = 107; const int MX = 107; int dp[N][MX]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> a(n)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; // mt19937 rng(333); mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); const int N = 107; const int MX = 107; int dp[N][MX]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> a(n)...
[["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 83, 0, 45], ["+", 0, 1, 0, 2, 3, 4, 0, 83, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 83, 0, 21], ["+", 0, 2, 3, 4, 0, 83, 0, 16, 31,...
1
580
#include <algorithm> #include <iostream> using i64 = long long; const int N = 1000000 + 7; int n; int a[N], b[N]; int main() { // freopen("code.in", "r", stdin); // freopen("code.out", "w", stdout); scanf("%d", &n); for (int i = 1; i <= n; ++i) scanf("%d", a + i); std::sort(a + 1, a + n + 1, [](int a...
#include <algorithm> #include <iostream> using i64 = long long; const int N = 1000000 + 7; int n; int a[N], b[N]; int main() { scanf("%d", &n); for (int i = 1; i <= n; ++i) scanf("%d", a + i); std::sort(a + 1, a + n + 1, [](int a, int b) { return a > b; }); for (int i = n; i; --i) b[i] = a[i] != a[i...
[["+", 3, 4, 0, 41, 15, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 16, 31, 69, 28, 22], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 31, 22], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 69, 341, 342, ...
1
234
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #define _USE_MATH_DEFINES #include <complex> #include <functional> #include <math.h> using namespace std; #define rep(i, x) for (ll i = 0; i < x; i++) #define r...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #define _USE_MATH_DEFINES #include <complex> #include <functional> #include <math.h> using namespace std; #define rep(i, x) for (ll i = 0; i < x; i++) #define r...
[["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 51, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 16, 31, 23, 0, 16, 31, 69, 28, 22], ["+", 31, 23, 0, 16, 31, 69, 341, 342, 0, 70], ["+", 31, 23, 0, 16, 31, 69, 341, 342, 0, 22], ["+", 31, 23, 0, 16, 31, 69, 341, 342, 0, 73], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 17,...
1
862
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; int main() { int n, l; cin >> n >> l; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; int pos = 0; for (int i = 0; i < n - 1; i++) { if (a[i] + a[i + 1] >= l) pos = i + 1; } if (pos == 0)...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; int main() { int n, l; cin >> n >> l; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; int pos = 0; for (int i = 0; i < n - 1; i++) { if (a[i] + a[i + 1] >= l) pos = i + 1; } if (pos == 0)...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 20], ["+", 75, ...
1
189
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define loop(i, n) for (ll i = 0; i < n; i++) #define Loop(i, m, n) for (ll i = m; i < n; i++) #define pool(i, n) for (ll i = n; i >= 0; i--) ...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define loop(i, n) for (ll i = 0; i < n; i++) #define Loop(i, m, n) for (ll i = m; i < n; i++) #define pool(i, n) for (ll i = n; i >= 0; i--) ...
[["-", 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, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17...
1
698
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { int n, l; cin >> n >> l; vector<int> a(n); rep(i, n) cin >> a[i]; int rope = 0; bool ok = false; rep(i, n - 1) { if (a[i] + a[i + 1] >= l) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { int n, l; cin >> n >> l; vector<int> a(n); rep(i, n) cin >> a[i]; int rope = 0; bool ok = false; rep(i, n - 1) { if (a[i] + a[i + 1] >= l) { ...
[["-", 0, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 75, 76, 0, 9, 0, 7, 10, 43, 0, 35], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 31, 22], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19], ["-", 75, 76, 0, 9, 0, 7, 26, 27, 17, 29], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 31, 22], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 20], ["+", 75, 76, 0, 9,...
1
207
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") // Begin Header {{{ using namespace std; #ifndef DEBUG #define dump(...) #endif #define all(x) x.begin(), x.end() #define rep(i, b, e) for (intmax_t i = (b), i##_limit = (e); i < i##_limit; ++i) #define reps(i, b, e) ...
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") // Begin Header {{{ using namespace std; #ifndef DEBUG #define dump(...) #endif #define all(x) x.begin(), x.end() #define rep(i, b, e) for (intmax_t i = (b), i##_limit = (e); i < i##_limit; ++i) #define reps(i, b, e) ...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 2, 63, 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], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 21],...
1
977
#include <bits/stdc++.h> #define int long long #define gcd __gcd #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define mod2 998244353 #define maxe *max_element #define mine *min_element #define inf 1e18 #define deci(x, y) fixed << setprecision(y) << x #define w(...
#include <bits/stdc++.h> #define int long long #define gcd __gcd #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define mod2 998244353 #define maxe *max_element #define mine *min_element #define inf 1e18 #define deci(x, y) fixed << setprecision(y) << x #define w(...
[["-", 0, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["-", 75, 76, 0, 9, 0, 7, 10, 43, 0, 35], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 31, 22], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19], ["-", 75, 76, 0, 9, 0, 7, 26, 27, 17, 29], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 20], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 75, 76...
1
334
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6], ["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["-", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["-", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22...
5
351
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6], ["-", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["-", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["-", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22...
5
351
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define DIV 1000000007 #define TE 2e5 using namespace std; using ll = long long; using ldb = long double; int main() { ll N, L; cin >> N >> L; vec...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define DIV 1000000007 #define TE 2e5 using namespace std; using ll = long long; using ldb = long double; int main() { ll N, L; cin >> N >> L; vec...
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 7, 8, 9, 0, 1, 0...
1
177
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, a, b) for (int i = a; i < b; i++) #define all(x) (x).begin(), (x).end() // 昇順ソート #define rall(v) (v).rbegin(), (v).rend() // 降順ソート #define FastIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) ty...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, a, b) for (int i = a; i < b; i++) #define all(x) (x).begin(), (x).end() // 昇順ソート #define rall(v) (v).rbegin(), (v).rend() // 降順ソート #define FastIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) ty...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 15, 16, ...
1
562
#include <bits/stdc++.h> using namespace std; #define loop(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < n; ++i) #define dump(a) cerr << #a << " = " << (a) << "(L:" << __LINE__ << ")" << endl const string YES = "Possible"; const string NO = "Impossible"; void solve(long long N, long ...
#include <bits/stdc++.h> using namespace std; #define loop(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < n; ++i) #define dump(a) cerr << #a << " = " << (a) << "(L:" << __LINE__ << ")" << endl const string YES = "Possible"; const string NO = "Impossible"; void solve(long long N, long ...
[["-", 0, 30, 0, 14, 8, 9, 0, 82, 0, 170], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 24], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 52, 15, 339, 0, 25], ["-", 0, 30, 0,...
1
362
N, M = map(int, input().split()) L = list(map(int, input().split())) count = 0 A = [] for i in range (0, N-1): if count == 0: if L[i]+L[i+1] >= M: count=1 A.append(N-1) else: A.append(i+1) else: A.append(i) if count == 0: print('Impossible') exit() else: print('Possible') for i in range (0, ...
N, M = map(int, input().split()) L = list(map(int, input().split())) count = 0 vouch = 0 A = [] for i in range (0, N-1): if count == 0: if L[i]+L[i+1] >= M: count=1 A.append(N-1) else: A.append(i+1) else: A.append(N-2-vouch) vouch+=1 if count == 0: print('Impossible') exit() else: print('Possib...
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 33], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 612], ["+...
5
142
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 8, 9, 0...
1
269
import sys input = sys.stdin.buffer.readline N, L = map(int, input().split()) a = list(map(int, input().split())) res = [] for i in range(N - 1): if a[i] + a[i + 1] >= L: res.append(i + 1) break if len(res): i = 1 while i < N: if i == res[0]: i += 1 res.append(i) i += 1 print("Possible...
import sys input = sys.stdin.buffer.readline N, L = map(int, input().split()) a = list(map(int, input().split())) res = [] for i in range(N - 1): if a[i] + a[i + 1] >= L: res.append(i + 1) break if len(res): i = res[0] - 1 while i > 0: res.append(i) i -= 1 i = res[0] + 1 while i < N: res.a...
[["+", 0, 1, 0, 662, 12, 657, 31, 206, 51, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 206, 0, 70], ["+", 0, 1, 0, 662, 12, 657, 31, 206, 206, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 206, 0, 73], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 0, 57, 64, 196, 0, 52, 15, 666, 667, 18], ["-", 0, 57, 64, 196, 0, 52, 15, 666...
5
153
N,L = map(int, input().split()) A=list(map(int, input().split())) choose = -1 for i in range(1, N): if A[i - 1] + A[i] >= L: choose = i - 1 break if choose == -1: print('Impossible') else: print('Possible') for i in range(0, choose - 1): print(i + 1) for i in range(choose + 2...
N,L = map(int, input().split()) A=list(map(int, input().split())) choose = -1 for i in range(1, N): if A[i - 1] + A[i] >= L: choose = i - 1 break if choose == -1: print('Impossible') else: print('Possible') for i in range(0, choose): print(i + 1) for i in range(N - 1, choose ...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 7,...
5
128
n,l=map(int,input().split()) a=list(map(int,input().split())) f=-1 for i in range(n-1): if a[i]+a[i+1]>=l: f=i break if f==-1: print("Impossible") exit() print("Possible") for i in range(n-1): if i!=f: print(i+1) print(f+1)
n,l=map(int,input().split()) a=list(map(int,input().split())) f=-1 for i in range(n-1): if a[i]+a[i+1]>=l: f=i break if f==-1: print("Impossible") exit() print("Possible") for i in range(n-1): if i<f: print(i+1) elif i>f: print(n-i+f) print(f+1)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 79], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 102]...
5
114
/* これを入れて実行 g++ code.cpp ./a.out */ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include ...
/* これを入れて実行 g++ code.cpp ./a.out */ #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include ...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9,...
1
628
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define INF (1LL << 50) #define MOD 1000000007 int main() { int N, L; cin >> N >> L; vector<int> A(N); rep(i, N) cin >> A[i]; int mid = -1; rep(i, N - 1) { if (A[i] + A[i + 1] >= L) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define INF (1LL << 50) #define MOD 1000000007 int main() { int N, L; cin >> N >> L; vector<int> A(N); rep(i, N) cin >> A[i]; int mid = -1; rep(i, N - 1) { if (A[i] + A[i + 1] >= L) { ...
[["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
185
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++) #define fi first #define se second long long mo = 1000000007; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<ll, ll> Pll; typede...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++) #define fi first #define se second long long mo = 1000000007; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<ll, ll> Pll; typede...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 8, 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], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32...
1
372
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define FOR(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) #define ROF(i, a, b) for (ll i = a; i >= b; i--) #define per(i, a) ROF(i, a, 0) #define pb push_back using namespace std; using ll = long long; using ld = long double; using ch = char; typedef ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define FOR(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) #define ROF(i, a, b) for (ll i = a; i >= b; i--) #define per(i, a) ROF(i, a, 0) #define pb push_back using namespace std; using ll = long long; using ld = long double; using ch = char; typedef ...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 2, 63, 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], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 21],...
1
378
#include <cstdio> #include <iostream> using namespace std; const int N = 2002020; int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); } retu...
#include <cstdio> #include <iostream> using namespace std; const int N = 2002020; int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); } retu...
[["-", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18], ["-", 75, 76, 0, 9, 0,...
1
272
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
[["+", 0, 9, 0, 57, 64, 9, 0, 43, 39, 78], ["+", 0, 9, 0, 57, 64, 9, 0, 43, 49, 22], ["+", 0, 9, 0, 57, 64, 9, 0, 43, 0, 35], ["-", 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, 2, 63, 118, 28, 22], ["+", 64, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 64, 9, 0, 1, 0...
1
418
#include <bits/stdc++.h> using namespace std; int main() { long long N, L; cin >> N >> L; int long long a[N]; for (int i = 0; i < N; i++) { cin >> a[i]; } int temp = -1; for (int i = 0; i < N - 1; i++) { if (a[i] + a[i + 1] >= L) { temp = i; } } if (temp == -1) { cout << "Imposs...
#include <bits/stdc++.h> using namespace std; int main() { long long N, L; cin >> N >> L; int long long a[N]; for (int i = 0; i < N; i++) { cin >> a[i]; } int temp = -1; for (int i = 0; i < N - 1; i++) { if (a[i] + a[i + 1] >= L) { temp = i; } } if (temp == -1) { cout << "Imposs...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 10, ...
1
190
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 100; int n, L, pos = 0, a[N]; int main() { cin >> n >> L; for (int i = 1; i <= n; ++i) cin >> a[i]; for (int i = 1; i < n; ++i) if (a[i] + a[i + 1] >= L) pos = i; if (pos) { puts("Possible"); for (int i = 1; i < n; ++i) ...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 100; int n, L, pos = 0, a[N]; int main() { cin >> n >> L; for (int i = 1; i <= n; ++i) cin >> a[i]; for (int i = 1; i < n; ++i) if (a[i] + a[i + 1] >= L) pos = i; if (pos) { puts("Possible"); for (int i = 1; i < pos; ++i...
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 57, 64, 9, 0, 7, 8, 57, 0, 121], ["+", 0, 7, 8, 1, 0, 16, 31, 16, 31, 22], ["+", 0, 7, 8, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 7, 8, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 7, 8, 1, 0, 16, 17, 151], ["+", 64, 9, 0, 7, 8, ...
1
153
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, L; cin >> n >> L; vector<ll> v(n), ans(n - 1); ll sum = 0; for (ll i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } for (ll f = 0, l = n - 1, j = 0; j < n - 1; j++) { if (v[f] < v[l]) { if (sum >= L...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, L; cin >> n >> L; vector<ll> v(n), ans(n - 1); ll sum = 0; for (ll i = 0; i < n; i++) { cin >> v[i]; sum += v[i]; } for (ll f = 0, l = n - 1, j = 0; j < n - 1; j++) { if (v[f] + v[f + 1] < v[l] + v[l - 1]...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 12, 69, 28, 22], ["+", 51, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 31, 22], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 12, 69, 34...
1
218
//↓見なくていいよ!ここから-------------------------------------------------- var read = require('readline').createInterface({ input : process.stdin, output : process.stdout }); var obj; var inLine = []; read.on('line', function(input) { inLine.push(input); }); read.on('close', function() { obj = init(inLine); console.erro...
//↓見なくていいよ!ここから-------------------------------------------------- var read = require('readline').createInterface({ input : process.stdin, output : process.stdout }); var obj; var inLine = []; read.on('line', function(input) { inLine.push(input); }); read.on('close', function() { obj = init(inLine); console.erro...
[["-", 0, 57, 75, 76, 0, 556, 0, 198, 0, 217], ["-", 75, 76, 0, 556, 0, 198, 0, 200, 141, 22], ["-", 75, 76, 0, 556, 0, 198, 0, 200, 0, 32], ["-", 75, 76, 0, 556, 0, 198, 0, 200, 51, 555], ["-", 0, 57, 75, 76, 0, 556, 0, 198, 0, 35], ["-", 0, 7, 10, 198, 0, 200, 51, 16, 31, 22], ["-", 0, 7, 10, 198, 0, 200, 51, 16, 17,...
2
756
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <float.h> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <float.h> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 14, 8, ...
1
609
#include <bits/stdc++.h> #define fi first #define se second #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define rng(a) a.begin(), a.end() #define rrng(a) a.rbegin()...
#include <bits/stdc++.h> #define fi first #define se second #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define rng(a) a.begin(), a.end() #define rrng(a) a.rbegin()...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 12, 69, 28, 22], ["+", 51, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 31, 22], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 12, 69, 34...
1
431
#include "bits/stdc++.h" using namespace std; #define DEBUG(x) cout << #x << ": " << x << endl; #define DEBUG_VEC(v) \ cout << #v << ":"; \ for (int i = 0; i < v.size(); i++) ...
#include "bits/stdc++.h" using namespace std; #define DEBUG(x) cout << #x << ": " << x << endl; #define DEBUG_VEC(v) \ cout << #v << ":"; \ for (int i = 0; i < v.size(); i++) ...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 70], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 73], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
271
#include <bits/stdc++.h> using namespace std; // type alias typedef long long LL; typedef pair<int, int> II; typedef tuple<int, int, int> III; typedef vector<int> VI; typedef vector<string> VS; typedef unordered_map<int, int> MAPII; typedef unordered_set<int> SETI; template <class T> using VV = vector<vector<T>>; // mi...
#include <bits/stdc++.h> using namespace std; // type alias typedef long long LL; typedef pair<int, int> II; typedef tuple<int, int, int> III; typedef vector<int> VI; typedef vector<string> VS; typedef unordered_map<int, int> MAPII; typedef unordered_set<int> SETI; template <class T> using VV = vector<vector<T>>; // mi...
[["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["-", 0, 1, 0, 34, 31, 2, 3, 4, 0, 25], ["-", 0, 14, 8, 9, 0, 1, 0, 34, 0, 21], ["-", 8, 9, 0, 1, 0, 34, 12, 2, 63, 22], ["-", 0, 1, 0, 34, 12, 2, 3, 4, 0, 24], ["-", 0, 34, 12, 2, 3, 4, 0, 2, 63, 22], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 24]]
1
694
#include <algorithm> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <utility> #include <vector> long long mod = 1e9 + 7; class Mint { public: long long ...
#include <algorithm> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <utility> #include <vector> long long mod = 1e9 + 7; class Mint { public: long long ...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 10, ...
1
659
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, a, b, l, i, mayor; cin >> n >> l; cin >> a; mayor = -1; for (i = 1; i < n; i++) { cin >> b; if (a + b >= l) mayor = i; a = b; } if (mayor == -1) cout << "Imposs...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, a, b, l, i, mayor; cin >> n >> l; cin >> a; mayor = -1; for (i = 1; i < n; i++) { cin >> b; if (a + b >= l) mayor = i; a = b; } if (mayor == -1) cout << "Imposs...
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, ...
1
150
#include <bits/stdc++.h> using namespace std; const int N = 1e5L + 11; int a[N]; int main() { ios ::sync_with_stdio(0); int n, l; cin >> n >> l; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i < n; i++) if (a[i] + a[i + 1] >= l) { cout << "Possible\n"; for (int j = 1; j < n; ...
#include <bits/stdc++.h> using namespace std; const int N = 1e5L + 11; int a[N]; int main() { ios ::sync_with_stdio(0); int n, l; cin >> n >> l; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i < n; i++) if (a[i] + a[i + 1] >= l) { cout << "Possible\n"; for (int j = 1; j < i; ...
[["-", 8, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 8, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["-", 8, 57, 64, 9, 0, 7, 8, 57, 0, 121], ["+", 0, 7, 8, 1, 0, 16, 31, 16, 31, 22], ["+", 0, 7, 8, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 7, 8, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 7, 8, 1, 0, 16, 17, 151], ["+", 0, 7, 8, 1, 0, 1...
1
150
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define MAXN 100000 using namespace std; int a[MAXN...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define MAXN 100000 using namespace std; int a[MAXN...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 57, 0, 121], ["+", 8, 9, 0, 7, 8, 1, 0, 2, 63, 22], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 7, 8, 1, 0, 2, 3, 4, 0, 21], ["-"...
1
193
#include <cstdio> #include <cstring> using namespace std; #define MAXN 100000 int n, l; int fl = 0; int a[MAXN + 5]; int read() { int x = 0, f = 1; char c = getchar(); while ('0' > c || c > '9') { if (c == '-') f = -1; c = getchar(); } while ('0' <= c && c <= '9') { x = x * 10 + c - '0'; ...
#include <cstdio> #include <cstring> using namespace std; #define MAXN 100000 long long n, l; long long fl = 0; long long a[MAXN + 5]; long long read() { long long x = 0, f = 1; char c = getchar(); while ('0' > c || c > '9') { if (c == '-') f = -1; c = getchar(); } while ('0' <= c && c <= '9') {...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 0, 30, 0, 14, 39, 86, 0, 96], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, ...
1
283
/// Bismillahir Rahmanir Rahim /// ALLAHU AKBAR #include <bits/stdc++.h> #define flash() \ ios::sync_with_stdio(0); \ cin.tie(0); \ co...
/// Bismillahir Rahmanir Rahim /// ALLAHU AKBAR #include <bits/stdc++.h> #define flash() \ ios::sync_with_stdio(0); \ cin.tie(0); \ co...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 17, 3...
1
699
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; typedef long long LL; int n, ok; LL a[N], L; int main() { cin >> n >> L; for (int i = 1; i <= n; i++) { cin >> a[i]; if (a[i] + a[i - 1] >= L) ok = i - 1; } if (!ok) cout << "Impossible" << endl; else { cout << "Poss...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; typedef long long LL; int n, ok; LL a[N], L; int main() { cin >> n >> L; for (int i = 1; i <= n; i++) { cin >> a[i]; if (i == 1) continue; if (a[i] + a[i - 1] >= L) ok = i - 1; } if (!ok) cout << "Impossible" << ...
[["+", 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, 7, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 7, 8, 9, 0, 57, 64, 116, 0, 35], ["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9,...
1
164
// 隣り合うのをL以上になるようにくっつけていきたいね 一箇所でもみつければあとは隣接してるのをくっつけていきたいね // そうしてできたのを逆から出力 package main import "fmt" func main() { var N, L int fmt.Scan(&N, &L) A := make([]int, N) for i := 0; i < N; i++ { fmt.Scan(&A[i]) } idx := -1 for i := 1; i < N; i++ { if A[i-1]+A[i] >= L { idx = i break } } if idx ==...
// 隣り合うのをL以上になるようにくっつけていきたいね 一箇所でもみつければあとは隣接してるのをくっつけていきたいね // -> てんでダメでした // よくよくみたらおかしいところ 端から切り離す感じにするようにした // -> なぜかWA // 3つ並んでる総和がL未満なら見込み0ってことか // -> そういうことではない package main import "fmt" func main() { var N, L int fmt.Scan(&N, &L) A := make([]int, N) for i := 0; i < N; i++ { fmt.Scan(&A[i]) } idx := -...
[["-", 0, 430, 10, 431, 12, 432, 0, 16, 31, 22], ["-", 0, 430, 10, 431, 12, 432, 0, 16, 17, 72], ["+", 0, 430, 10, 431, 12, 432, 0, 16, 31, 22], ["+", 0, 430, 10, 431, 12, 432, 0, 16, 17, 33], ["-", 8, 196, 0, 7, 0, 430, 15, 16, 17, 18], ["-", 8, 196, 0, 7, 0, 430, 15, 16, 12, 22], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 1...
7
224
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; using pli = pair<ll, int>; using pil = pair<int, ll>; using uint = unsigned int; template <typename T> using Graph = vector<vector<T>>; const ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; using pli = pair<ll, int>; using pil = pair<int, ll>; using uint = unsigned int; template <typename T> using Graph = vector<vector<T>>; const ...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 0, 57, 64, 9, 0, 57, 15, 339, 0, 25], ["-", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 57...
1
304
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int long long int32_t main() { ios::sync_with_stdio(0); cin.tie(0); int n, L; cin >> n >> L; vector<int> a(n); int s = 0; for (int i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } bool good = false; int pos = -1; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int long long int32_t main() { ios::sync_with_stdio(0); cin.tie(0); int n, L; cin >> n >> L; vector<int> a(n); int s = 0; for (int i = 0; i < n; i++) { cin >> a[i]; s += a[i]; } bool good = false; int pos = -1; ...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 14, 8...
1
234
#pragma GCC optimize(2) #include <bits/stdc++.h> #define ll long long #define maxn 1000005 #define inf 1e9 #define pb push_back #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) using namespace std; inline int read() { int x = 0, w = 1; char c = getchar(); while ...
#pragma GCC optimize(2) #include <bits/stdc++.h> #define ll long long #define maxn 1000005 #define inf 1e9 #define pb push_back #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) using namespace std; inline int read() { int x = 0, w = 1; char c = getchar(); while ...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 38], ["+", 0, 57, 6...
1
318
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const st...
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const st...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 9, 0, 57, 64, 9, 0, 7, 0, 88], ["+", 0, 57, 64, 9, 0, 7, 10, 43, 39, 40], ["-", 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, 7, 10, 43, 49, 50, 0...
1
1,038
n,l=map(int,input().split()) a=list(map(int,input().split())) flag=0 for i in range(n-1): if a[i]+a[i+1]>=l: flag=1 break if flag==0: print("Impossible") else: print("Possible") if i>0: for j in range(1,i+1): print(j) if i+2<n: for j in range(i+2,n): ...
n,l=map(int,input().split()) a=list(map(int,input().split())) flag=0 for i in range(n-1): if a[i]+a[i+1]>=l: flag=1 break if flag==0: print("Impossible") else: print("Possible") if i>0: for j in range(1,i+1): print(j) if i+2<n: tmp=[] for j in ra...
[["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 634, 0, 70], ["+", 64, 196, 0, 1, 0, 662, 12, 634, 0, 73], ["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 500, 22], ["+", 8, 196, 0, 1, 0, 652, 63, 319, 0, 131], ["...
5
134
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdint> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdint> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #includ...
[["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 75, 76, 0, 9, 0, 9, 0, 57, 0, 121], ["+", 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, 22], ["+", 0, 9, 0, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 9, 0, 9, 0, 1, 0, 16, 12...
1
780
//#pragma GCC optimize ("-O3") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <reg...
//#pragma GCC optimize ("-O3") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <reg...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["-", 75, 76, 0, 9, 0, 1, 0, 2, 63, 22], ["+", 75, 76, 0, 9...
1
5,378
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #include <vector> #d...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <utility> #include <vector> #d...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 10, ...
1
298
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (n); ++i) const string YES = "Possible"; const string NO = "Impossible"; int main() { ll n, l; cin >> n >> l; vector<pair<ll, ll>> a; vector<ll> ans; REP(i, n) { ll ai; cin >> ai; a.emplace_b...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < (n); ++i) const string YES = "Possible"; const string NO = "Impossible"; int main() { ll n, l; cin >> n >> l; vector<pair<ll, ll>> a; vector<ll> ans; REP(i, n) { ll ai; cin >> ai; a.emplace_b...
[["+", 75, 76, 0, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 21...
1
251
#include <algorithm> #include <cmath> #include <cstdint> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FOR(i, m, n) for (int(i)...
#include <algorithm> #include <cmath> #include <cstdint> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define FOR(i, m, n) for (int(i)...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 75, 76, 0, 9, 0, 7, 10, 43, 0, 35], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 31, 22], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 1...
1
280
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define double long double #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define double long double #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
[["-", 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, 25], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["+", 0, 7, 0, 42, 0, 2, 3, 4, 0, 25], ["+", 64, 9, 0, 7, 8, 1, 0, 2, 63, 22], ["+", 0, 7, 8, 1, 0, 2, 3, 4, 0, 24], ["+",...
1
1,974
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout << setprecision(32); int n, l; cin >> n >> l; int a[n]; for (int i = 0; i < n; i++) { cin >> a[...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout << setprecision(32); int n, l; cin >> n >> l; int a[n + 1]; for (int i = 1; i <= n; i++) { cin ...
[["+", 8, 9, 0, 43, 49, 80, 81, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 80, 81, 16, 12, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16,...
1
229
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef long double ld; #define fastInp ...
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef long double ld; #define fastInp ...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 10, ...
1
262
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < n; i++) #define REP(i, s, n) for (long long i = (s); i <= (n); i++) #define repr(i, n) for (long long i = n - 1; i >= 0; i--) #define REPR(i, s, n) for (long long i = (s); i >= (n); i--) #define all(a) (a).begin(), (a).end() #def...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < n; i++) #define REP(i, s, n) for (long long i = (s); i <= (n); i++) #define repr(i, n) for (long long i = n - 1; i >= 0; i--) #define REPR(i, s, n) for (long long i = (s); i >= (n); i--) #define all(a) (a).begin(), (a).end() #def...
[["+", 0, 9, 0, 57, 64, 9, 0, 43, 39, 78], ["+", 0, 57, 64, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 57, 64, 9, 0, 43, 49, 50, 0, 32], ["+", 64, 9, 0, 43, 49, 50, 51, 16, 31, 22], ["+", 64, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 64, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 9, 0, 57, 64, 9, 0, 43, 0, 35], ["+", 64, 9, 0...
1
1,179
#include <bits/stdc++.h> using namespace std; template <typename T> void fin(T a) { cout << a << endl; exit(0); } #define int long long signed main() { int n, l; cin >> n >> l; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v[i]; int a = -1; for (int i = 1; i < n; i++) if (v[i] + v[i - 1]...
#include <bits/stdc++.h> using namespace std; template <typename T> void fin(T a) { cout << a << endl; exit(0); } #define int long long signed main() { int n, l; cin >> n >> l; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v[i]; int a = -1; for (int i = 1; i < n; i++) if (v[i] + v[i - 1]...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 57, 0, 121], ["-", 8, 9, 0, 7, 8, 57, 15, 339, 0, 24], ["-", 0, 7, 8, 57, 15, 339, 51, 16, 31, 22], ["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 79], ["-", 0, 7, 8, 57, 15, 339, 51, 16, 12, 22], ["-", 8, 9, 0, 7,...
1
172
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int N, L; cin >> N >> L; std::vector<int> v(N); for (int i = 0; i < N; i++) cin >> v[i]; int ok = 0; int j; for (int i = 0; i < N - 1; i++) if (v[i] + v[i + 1] >= L) { ok++; j = i; } if (ok == 0)...
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int N, L; cin >> N >> L; std::vector<int> v(N); for (int i = 0; i < N; i++) cin >> v[i]; int ok = 0; int j; for (int i = 0; i < N - 1; i++) if (v[i] + v[i + 1] >= L) { ok++; j = i; } if (ok == 0)...
[["-", 0, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["-", 75, 76, 0, 9, 0, 7, 8, 57, 0, 121], ["+", 0, 7, 8, 1, 0, 16, 31, 16, 31, 22], ["+", 0, 7, 8, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 1, 0, 16, 3...
1
170
K=10**10 import sys N,L=map(int,input().split()) T=list(map(int,input().split())) for i in range(N-1): if T[i]+T[i+1]>=L: K=i print("Possible") break if K==10**10: print("Impossible") sys.exit() K=K+1 R=list(range(1,K)) R.extend(list(range(K+1,N))) R.append(K) for i in range(N-1): print(R[i])
K=10**10 import sys N,L=map(int,input().split()) T=list(map(int,input().split())) for i in range(N-1): if T[i]+T[i+1]>=L: K=i print("Possible") break if K==10**10: print("Impossible") sys.exit() K=K+1 R=list(range(1,K)) M=list(range(K+1,N)) M.reverse() R.extend(M) R.append(K) for i in range(N-1): pr...
[["-", 0, 656, 0, 1, 0, 652, 63, 319, 500, 22], ["-", 0, 656, 0, 1, 0, 652, 63, 319, 0, 131], ["-", 0, 656, 0, 1, 0, 652, 63, 319, 319, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+",...
5
148
#include <bits/stdc++.h> using namespace std; #define ll long long #define full(a) a.begin(), a.end() #define stoink stack<ll> #define vec vector<ll> #define vg vector<vector<ll>> #define vgw vector < vector<pair<ll, ll>> #define pa pair<ll, ll> #define mp make_pair #define pb push_back int main() { ll n, l; cin >>...
#include <bits/stdc++.h> using namespace std; #define ll long long #define full(a) a.begin(), a.end() #define stoink stack<ll> #define vec vector<ll> #define vg vector<vector<ll>> #define vgw vector < vector<pair<ll, ll>> #define pa pair<ll, ll> #define mp make_pair #define pb push_back int main() { ll n, l; cin >>...
[["+", 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, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 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, ...
1
198
#include <bits/stdc++.h> using namespace std; int main() { long long int N, L; cin >> N >> L; long long int arr[N], len[N]; for (long long int i = 1; i <= N; i++) { cin >> arr[i]; } bool flag = 0; long long int index = 0; for (long long int i = 1; i <= N - 1; i++) { len[i] = arr[i] + arr[i + 1]...
#include <bits/stdc++.h> using namespace std; int main() { long long int N, L; cin >> N >> L; long long int arr[N], len[N]; for (long long int i = 1; i <= N; i++) { cin >> arr[i]; } bool flag = 0; long long int index = 0; for (long long int i = 1; i <= N - 1; i++) { len[i] = arr[i] + arr[i + 1]...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 20], ["+", 64, ...
1
215
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pi 3.141592653589793238 #define int long long using namespace __gnu_pbds; using namespace std; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pi 3.141592653589793238 #define int long long using namespace __gnu_pbds; using namespace std; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 75, 76, 0, 9, 0, 7, 10, 43, 0, 35], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 31, 22], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19], ["-", 75, 76, 0, 9, 0, 7, 26, 27, 17, 29], ["+", 75, 76,...
1
276
#include <algorithm> #include <bits/stdc++.h> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string> #includ...
#include <algorithm> #include <bits/stdc++.h> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string> #includ...
[["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22...
1
6,336
/// nyaaaaa #include <bits/stdc++.h> #define sz(x) (int)((x).size()) using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; const int N = (int)3e5 + 5; const int inf = (int)1e9 + 7; int n, l; int a[N]; ll p[N]; set<pii> s; set<int> can; int sum(pii x) { return p[x.second] -...
/// nyaaaaa #include <bits/stdc++.h> #define sz(x) (int)((x).size()) using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; const int N = (int)3e5 + 5; const int inf = (int)1e9 + 7; int n, l; int a[N]; ll p[N]; set<pii> s; set<int> can; ll sum(pii x) { return p[x.second] - ...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 78], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["-", 49, 50, 51, 2, 3, 4, 0, 2, 63, 22], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["-", 51, 2, 3, 4, 0, 2, ...
1
522
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } bool ok = false; int id = -1; for (int i = 0; i < n - 1; i++) { ok |= (a[i] + a[i + 1] >= l); id = (ok) ? i : -1; } if (ok) { puts("Possible"); ...
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } bool ok = false; int id = -1; for (int i = 0; i < n - 1; i++) { if (a[i] + a[i + 1] >= l) { ok = true; id = i + 1; break; } } if (...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 160], ["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 146], ["-", 0, 1, 0, 11, 12, 41, 15, ...
1
179
#include <algorithm> #include <cassert> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string.h> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; typedef long l...
#include <algorithm> #include <cassert> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string.h> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; typedef long l...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 10, ...
1
241
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = x; i < y; i++) #define print(A, x, n) \ rep(I, 0, n) { cout << (I ? " " : "") << A[I] x; } \ cout << endl; #define pprint(A, y, m, n) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = x; i < y; i++) #define print(A, x, n) \ rep(I, 0, n) { cout << (I ? " " : "") << A[I] x; } \ cout << endl; #define pprint(A, y, m, n) ...
[["-", 0, 1, 0, 16, 31, 16, 31, 2, 63, 22], ["+", 0, 9, 0, 57, 64, 9, 0, 7, 0, 88], ["+", 0, 57, 64, 9, 0, 7, 10, 43, 39, 40], ["-", 0, 16, 31, 16, 31, 2, 3, 4, 0, 21], ["-", 31, 16, 31, 2, 3, 4, 0, 16, 31, 22], ["-", 31, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["-", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 64, 9, 0, 7, 10,...
1
190
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (i = 0; i < n; ++i) #define all(v) v.begin(), v.end() using ll = long long; int main() { ll i, j; ll n, l; cin >> n >> l; vector<ll> a(n); for (i = 0; i < n; ++i) { cin >> a.at(i); } stack<ll> ans; ll f = -1; for (i = 0; i < n -...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (i = 0; i < n; ++i) #define all(v) v.begin(), v.end() using ll = long long; int main() { ll i, j; ll n, l; cin >> n >> l; vector<ll> a(n); for (i = 0; i < n; ++i) { cin >> a.at(i); } stack<ll> ans; ll f = -1; for (i = 0; i < n -...
[["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
250
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define FORR(i, a, b) for (l...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define FORR(i, a, b) for (l...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 7, 10, 43, 0, 35], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 31, 22], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 20], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18], ["-", 75, 76,...
1
517
#include <bits/stdc++.h> using namespace std; #define repd(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) repd(i, 0, n) #define all(x) (x).begin(), (x).end() template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chma...
#include <bits/stdc++.h> using namespace std; #define repd(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) repd(i, 0, n) #define all(x) (x).begin(), (x).end() template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chma...
[["-", 75, 76, 0, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 57, 75, 76, 0, 9, 0, 7, 0, 88], ["+", 75, 76, 0, 9, 0, 7, 10, 43, 39, 40], ["-", 0, 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], ["+", 0, 9, 0, 7, 10, 43, 49, 50, 0,...
1
281
n,l = map(int,input().split()) a = list(map(int,input().split())) x = -1 for i in range(n-1): if a[i]+a[i+1] >= l: x = i break if x == -1: print('Impossible') else: print('Possible') for i in range(x-1): print(i+1) for i in range(n-1,x,-1): print(i) print(x)
n,l = map(int,input().split()) a = list(map(int,input().split())) x = -1 for i in range(n-1): if a[i]+a[i+1] >= l: x = i break if x == -1: print('Impossible') else: print('Possible') for i in range(x): print(i+1) for i in range(n-2,x,-1): print(i+1) print(x+1)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
125
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define N 100005 int n, l, a[N], x; signed main() { scanf("%d", &n)...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define N 100005 int n, l, a[N], x; signed main() { scanf("%d", &n)...
[["-", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 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, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 7, 8, 57, 0, 121], ["+", 8, 9, 0, 7, 8, 1, 0, 2, 63, 22], ["+", 8, 1, 0, 2, 3...
1
202
#pragma GCC optimize("O3") #pragma GCC target(sse, sse1, sse2, tune = native, popcnt) #include <bits/stdc++.h> /* const int MAX_MEM = 3e8; int mpos = 0; char mem[MAX_MEM]; inline void* operator new(size_t n) { char *res = mem + mpos; mpos += n; assert(mpos <= MAX_MEM); return (void *) res; } inline voi...
#pragma GCC optimize("O3") #pragma GCC target(sse, sse1, sse2, tune = native, popcnt) #include <bits/stdc++.h> /* const int MAX_MEM = 3e8; int mpos = 0; char mem[MAX_MEM]; inline void* operator new(size_t n) { char *res = mem + mpos; mpos += n; assert(mpos <= MAX_MEM); return (void *) res; } inline voi...
[["-", 0, 1, 0, 16, 31, 16, 31, 2, 63, 22], ["+", 0, 9, 0, 57, 64, 9, 0, 7, 0, 88], ["+", 0, 57, 64, 9, 0, 7, 10, 43, 39, 40], ["-", 0, 16, 31, 16, 31, 2, 3, 4, 0, 21], ["-", 0, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 64, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["-", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 7, 10, 43, 49,...
1
304
N,L=map(int,input().split()) a=list(map(int,input().split())) x=-1 for i in range(0,N-1): if a[i]+a[i+1]>=L: x=i break if x==-1: print("Impossible") else: print("Possible") for i in range(x+1, N-1): print(i+1) for i in range(0,x+1): print(i+1)
N,L=map(int,input().split()) a=list(map(int,input().split())) x=-1 for i in range(0,N-1): if a[i]+a[i+1]>=L: x=i break if x==-1: print("Impossible") else: print("Possible") for i in range(N-1, x+1,-1): print(i) for i in range(0,x+1): print(i+1)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
126
#include <iostream> //#include <bits/stdc++.h> // a&1 check odd or not and a>>=1 halfs a #include <algorithm> #include <cstdio> #include <cstdlib> #include <queue> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define pb(x) push_back(x) #define F first #define S second using namespace std; #define...
#include <iostream> //#include <bits/stdc++.h> // a&1 check odd or not and a>>=1 halfs a #include <algorithm> #include <cstdio> #include <cstdlib> #include <queue> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define pb(x) push_back(x) #define F first #define S second using namespace std; #define...
[["-", 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, 16, 31, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22], ["-", 75, 76, 0, 9, 0, 1, 0,...
1
343
#include <bits/stdc++.h> using namespace std; using i64 = long long; using P = pair<i64, i64>; #define overload3(_1, _2, _3, name, ...) name #define rep1(i, n) for (i64 i = 0LL; i < (n); ++i) #define rep2(i, a, b) for (i64 i = (a); i < (b); ++i) #define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__) #define...
#include <bits/stdc++.h> using namespace std; using i64 = long long; using P = pair<i64, i64>; #define overload3(_1, _2, _3, name, ...) name #define rep1(i, n) for (i64 i = 0LL; i < (n); ++i) #define rep2(i, a, b) for (i64 i = (a); i < (b); ++i) #define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__) #define...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 8, 9, 0, 1, 0, 16, 31, ...
1
330
#include <cstdio> #define MAXN 100005 int n, l; int a[MAXN]; int main() { bool f = 0; int pos; scanf("%d %d", &n, &l); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); if (i > 1 && a[i] + a[i - 1] >= l) { f = 1; pos = i - 1; } } if (f) { printf("Possible\n"); for (int i = 1...
#include <cstdio> #define MAXN 100005 int n, l; int a[MAXN]; int main() { bool f = 0; int pos; scanf("%d %d", &n, &l); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); if (i > 1 && a[i] + a[i - 1] >= l) { f = 1; pos = i - 1; } } if (f) { printf("Possible\n"); for (int i = 1...
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 19], ["+", 64, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["+", 0, 7...
1
187
#include <bits/stdc++.h> #define ALL(obj) begin(obj), end(obj) using namespace std; template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); } template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...)); } template <class T> bool...
#include <bits/stdc++.h> #define ALL(obj) begin(obj), end(obj) using namespace std; template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); } template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...)); } template <class T> bool...
[["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 44], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["-", 0, 14, 8, 9, ...
1
430
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define pa(x, n) \ for (ll i = 0; i < n; i++) { \ cout << (x[i]) << " \n"[i == n - 1]; \ };...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define pa(x, n) \ for (ll i = 0; i < n; i++) { \ cout << (x[i]) << " \n"[i == n - 1]; \ };...
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 7, 10, 43, 49, 50, 51, 4, 0, 13], ["+", 0, 7, 10, 43, 49, 50, 51, 4, 0, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31...
1
384