buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string a, b, c; cin >> a >> b >> c; int na = a.size(); int nb = b.size(); int nc = c.size(); vector<int> ab, bc, ac; for (int i = -nb + 1; i < na; i++) { bool check = true; for (int j = max(0, i); j <= min(na - 1, i +...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string a, b, c; cin >> a >> b >> c; int na = a.size(); int nb = b.size(); int nc = c.size(); vector<int> ab, bc, ac; for (int i = -nb + 1; i < na; i++) { bool check = true; for (int j = max(0, i); j <= min(na - 1, i ...
[["+", 75, 76, 0, 9, 0, 57, 64, 116, 0, 117], ["+", 75, 76, 0, 9, 0, 57, 64, 116, 0, 35]]
1
1,021
#include "bits/stdc++.h" using namespace std; typedef long long ll; const int INF = (1 << 30); const ll INFLL = (1ll << 60); const ll MOD = (ll)(1e9 + 7); #define l_ength size void mul_mod(ll &a, ll b) { a *= b; a %= MOD; } void add_mod(ll &a, ll b) { a = (a < MOD) ? a : (a - MOD); b = (b < MOD) ? b : (b - M...
#include "bits/stdc++.h" using namespace std; typedef long long ll; const int INF = (1 << 30); const ll INFLL = (1ll << 60); const ll MOD = (ll)(1e9 + 7); #define l_ength size void mul_mod(ll &a, ll b) { a *= b; a %= MOD; } void add_mod(ll &a, ll b) { a = (a < MOD) ? a : (a - MOD); b = (b < MOD) ? b : (b - M...
[["-", 0, 11, 12, 2, 3, 4, 0, 83, 0, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 83, 0, 13], ["-", 12, 2, 3, 4, 0, 83, 0, 16, 31, 13], ["+", 12, 2, 3, 4, 0, 83, 0, 16, 31, 13]]
1
744
#include <bits/stdc++.h> using namespace std; template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; } template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; } using Int = long long; const char newl = '\n'; // INSERT ABOVE HERE signed main() {...
#include <bits/stdc++.h> using namespace std; template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; } template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; } using Int = long long; const char newl = '\n'; // INSERT ABOVE HERE signed main() {...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20]]
1
503
#include <bits/stdc++.h> using namespace std; struct fast_ios { fast_ios() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) for (int i = (begin); i < (end); i++) #define REP(i, n) FOR(i, 0, n) #define IFOR(i, begin, end) for (int i ...
#include <bits/stdc++.h> using namespace std; struct fast_ios { fast_ios() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) for (int i = (begin); i < (end); i++) #define REP(i, n) FOR(i, 0, n) #define IFOR(i, begin, end) for (int i ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
802
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #define PB push_back #define MP make_pair #define PII pair<int, int> #define FIR first #define SEC second #define ll long long using namespace std; template <class T> inline void rd(T &x) { x = 0; char c = getchar(); i...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #define PB push_back #define MP make_pair #define PII pair<int, int> #define FIR first #define SEC second #define ll long long using namespace std; template <class T> inline void rd(T &x) { x = 0; char c = getchar(); i...
[["+", 36, 36, 0, 30, 0, 14, 0, 114, 0, 174], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
438
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include ...
[["-", 12, 16, 31, 2, 3, 4, 0, 16, 31, 22], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 31, 22]]
1
4,559
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cfloat> #include <chrono> #include <climits> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstre...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cfloat> #include <chrono> #include <climits> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstre...
[["-", 0, 16, 31, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 16, 31, 2, 3, 4, 0, 16, 12, 22], ["-", 0, 16, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 31, 22]]
1
934
#include <bits/stdc++.h> using namespace std; using ll = long long int; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) const ll s = pow(3, 29); ll solve(ll a1, ll a2, ll b1, ll b2) { if (a2 > b2) { swap(a1, b1); swap(a2, b2); } ll res = abs(a1 - b1) + abs(a2 - b2); for (ll ss = s; ss >= 0; ss /= ...
#include <bits/stdc++.h> using namespace std; using ll = long long int; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) const ll s = pow(3, 29); ll solve(ll a1, ll a2, ll b1, ll b2) { if (a2 > b2) { swap(a1, b1); swap(a2, b2); } ll res = abs(a1 - b1) + abs(a2 - b2); for (ll ss = s; ss > 0; ss /= 3...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47]]
1
333
#include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; ll solve(ll ai, ll aj, ll bi, ll bj) { if (aj > bj) { swap(ai, bi); swap(aj, bj); } ll s = 1; rep(i, 30) s *= 3; ll dist = abs(ai - bj) + abs(aj ...
#include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; ll solve(ll ai, ll aj, ll bi, ll bj) { if (aj > bj) { swap(ai, bi); swap(aj, bj); } ll s = 1; rep(i, 30) s *= 3; ll dist = abs(ai - bi) + abs(aj ...
[["-", 51, 16, 31, 2, 3, 4, 0, 16, 12, 22], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 12, 22]]
1
342
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <sstream> #include <string> using namespace std; long long width[30]; long long process(long long x1, long long y1, long long x2, long long y2, int level) { if (level == 0...
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <sstream> #include <string> using namespace std; long long width[30]; long long process(long long x1, long long y1, long long x2, long long y2, int level) { if (level == 0...
[["-", 64, 37, 0, 2, 3, 4, 0, 11, 17, 32], ["+", 64, 37, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 16, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 17, 33]]
1
370
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <sstream> #include <string> using namespace std; long long process(long long x1, long long y1, long long x2, long long y2) { long long d = 1; for (int i = 0; i < 30; i++) d *= 3; if...
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <sstream> #include <string> using namespace std; long long process(long long x1, long long y1, long long x2, long long y2) { long long d = 1; for (int i = 0; i < 30; i++) d *= 3; if...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22]]
1
356
def solve(A,B,C,D, level): E = 3**level if level == 0: return int(abs(A-C) + abs(B-D)) a,b,c,d = A//E, B//E, C//E, D//E if a != c and b != d: return int(abs(A-C) + abs(B-D)) if a == c and b==d: return solve(A,B,C,D,level-1) if a != c and b==d: A,B,C,D = B,A,D,C ...
def solve(A,B,C,D, level): E = 3**level if level == -1: return int(abs(A-C) + abs(B-D)) a,b,c,d = A//E, B//E, C//E, D//E if a != c and b != d: return int(abs(A-C) + abs(B-D)) if a == c and b==d: return solve(A,B,C,D,level-1) if a != c and b==d: A,B,C,D = B,A,D,C...
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 8, 196, 0, 57, 15, 666, 0, 664, 17, 33], ["+", 8, 196, 0, 57, 15, 666, 0, 664, 28, 612]]
5
473
#include <bits/stdc++.h> #define ll long long using namespace std; ll width[30] = {1}; ll cal(ll x1, ll y1, ll x2, ll y2, int level) { if (level == 0) return abs(y1 - y2); ll w = width[level - 1]; if (x1 / w != x2 / w) return abs(x1 - x2) + abs(y1 - y2); //不同层 if (x1 / w == 1 && abs(y1 / w - y...
#include <bits/stdc++.h> #define ll long long using namespace std; ll width[30] = {1}; ll cal(ll x1, ll y1, ll x2, ll y2, int level) { if (level == 0) return abs(y1 - y2); ll w = width[level - 1]; if (x1 / w != x2 / w) return abs(x1 - x2) + abs(y1 - y2); //不同层 if (x1 / w == 1 && abs(y1 / w - y...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20]]
1
315
#include <bits/stdc++.h> #define LL long long using namespace std; LL poww[35], a, b, c, d, ans; int main() { int T; poww[0] = 1; for (int i = 1; i <= 30; ++i) poww[i] = poww[i - 1] * 3; scanf("%d", &T); while (T--) { int flag = 1; scanf("%lld %lld %lld %lld", &a, &b, &c, &d); a--, b--, c--,...
#include <bits/stdc++.h> #define LL long long using namespace std; LL poww[35], a, b, c, d, ans; int main() { int T; poww[0] = 1; for (int i = 1; i <= 30; ++i) poww[i] = poww[i - 1] * 3; scanf("%d", &T); while (T--) { int flag = 1; scanf("%lld %lld %lld %lld", &a, &b, &c, &d); a--, b--, c--,...
[["+", 64, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 64, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
436
#include <bits/stdc++.h> using namespace std; #define LL long long typedef pair<int, int> pii; template <typename T> inline void read(T &x) { static char _c; static bool _f; x = 0; _f = 0; _c = getchar(); while (_c < '0' || '9' < _c) { if (_c == '-') _f = true; _c = getchar(); } while ...
#include <bits/stdc++.h> using namespace std; #define LL long long typedef pair<int, int> pii; template <typename T> inline void read(T &x) { static char _c; static bool _f; x = 0; _f = 0; _c = getchar(); while (_c < '0' || '9' < _c) { if (_c == '-') _f = true; _c = getchar(); } while ...
[["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
739
#include "bits/stdc++.h" using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vector<ll>>; using vvvll = vector<vector<vector<ll>>>; using vvvvll = vector<vector<vector<vector<ll>>>>; using pl4 = pair<ll, ll>; using str = string; using vpl4 = vector<pair<ll, ll>>; #define sz size() ...
#include "bits/stdc++.h" using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vector<ll>>; using vvvll = vector<vector<vector<ll>>>; using vvvvll = vector<vector<vector<vector<ll>>>>; using pl4 = pair<ll, ll>; using str = string; using vpl4 = vector<pair<ll, ll>>; #define sz size() ...
[["-", 3, 4, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 16, 12, 16, 12, 22], ["-", 12, 2, 3, 4, 0, 16, 12, 16, 12, 13], ["+", 12, 2, 3, 4, 0, 16, 12, 16, 12, 22]]
1
864
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> using namespace std; typedef long long ll; ll p, ans, a, b, c, d, x; int T; int main() { p = 1; for (int i = 1; i <= 29; i++) p *= 3; scanf("%d", &T); while (T--) { scanf("%lld %lld %lld %lld", &a, &b, &c, &d); a--; b--;...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> using namespace std; typedef long long ll; ll p, ans, a, b, c, d, x; int T; int main() { p = 1; for (int i = 1; i <= 30; i++) p *= 3; scanf("%d", &T); while (T--) { scanf("%lld %lld %lld %lld", &a, &b, &c, &d); a--; b--;...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22]]
1
296
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define RE...
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define RE...
[["+", 0, 2, 3, 4, 0, 16, 12, 16, 31, 13], ["+", 0, 2, 3, 4, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 12, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 64, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 64, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
1,189
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) using namespace std; typedef long long int ll; typedef pair<ll, ll> P; #define yn ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) using namespace std; typedef long long int ll; typedef pair<ll, ll> P; #define yn ...
[["-", 0, 11, 12, 16, 31, 74, 51, 23, 0, 24], ["-", 12, 16, 31, 74, 51, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 74, 51, 23, 0, 16, 12, 13], ["-", 0, 11, 12, 16, 31, 74, 51, 23, 0, 25]]
1
481
#include <bits/stdc++.h> using namespace std; #define ll long long struct node { ll f, s; } a[222222]; ll c[222222], dp[36]; bool mycmp(node xx, node yy) { return xx.f * (yy.s + 1) > yy.f * (xx.s + 1); } int main() { ll n, t, cnt1 = 0, cnt2 = 0, x, y, pp, ans = 0; cin >> n >> t; for (int i = 1; i <= n; i++) { ...
#include <bits/stdc++.h> using namespace std; #define ll long long struct node { ll f, s; } a[222222]; ll c[222222], dp[36]; bool mycmp(node xx, node yy) { return xx.f * (yy.s + 1) > yy.f * (xx.s + 1); } int main() { ll n, t, cnt1 = 0, cnt2 = 0, x, y, pp, ans = 0; cin >> n >> t; for (int i = 1; i <= n; i++) { ...
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 22]]
1
406
import java.util.Arrays; public class Main { private static void solve() { int n = ni(); int t = ni(); long[][] a = new long[n][2]; long[] b = new long[n]; int ap = 0, bp = 0; for (int i = 0; i < n; i++) { long x = ni(); long y = ni(); if (x == 0) { b[bp++] = y + ...
import java.util.Arrays; public class Main { private static void solve() { int n = ni(); int t = ni(); long[][] a = new long[n][2]; long[] b = new long[n]; int ap = 0, bp = 0; for (int i = 0; i < n; i++) { long x = ni(); long y = ni(); if (x == 0) { b[bp++] = y + ...
[["-", 51, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 12, 499], ["-", 51, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 51, 16, 12, 16, 31, 23, 0, 16, 12, 499]]
3
1,236
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <numeric> #include <q...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <list> #include <map> #include <numeric> #include <q...
[["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
539
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]]
1
1,935
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define mp make_pair #define PI pair<ll, ll> #define poly vector<ll> #define mem(a) memset((a), 0, sizeof(a)) #define For(i, l, r) for (int i = (int)(l); i <= (int)(r); i++) #define Rep(i, r, l) f...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define mp make_pair #define PI pair<ll, ll> #define poly vector<ll> #define mem(a) memset((a), 0, sizeof(a)) #define For(i, l, r) for (int i = (int)(l); i <= (int)(r); i++) #define Rep(i, r, l) f...
[["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
829
#include <bits/stdc++.h> using namespace std; #define ll long long const ll N = 2e5 + 5; ll n, T, b[N], ans, f[N], tot1, tot2; struct node { ll x, y; } a[N]; bool mycmp(node x, node y) { return x.x * (y.y + 1) > y.x * (x.y + 1); } int main() { scanf("%lld%lld", &n, &T); for (ll i = 1; i <= n; i++) { ll x, y; ...
#include <bits/stdc++.h> using namespace std; #define ll long long const ll N = 2e5 + 5; ll n, T, b[N], ans, f[N], tot1, tot2; struct node { ll x, y; } a[N]; bool mycmp(node x, node y) { return x.x * (y.y + 1) > y.x * (x.y + 1); } int main() { scanf("%lld%lld", &n, &T); for (ll i = 1; i <= n; i++) { ll x, y; ...
[["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
403
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e6 + 7; int n, t, zer; ll z[maxn], f[maxn]; struct node { ll a, b; } e[maxn]; bool cmp(node x, node y) { return y.a * (x.b + 1) < x.a * (y.b + 1); } int main() { // freopen(".in","r",stdin); // freopen(".out","w",stdout); i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e6 + 7; int n, t, zer; ll z[maxn], f[maxn]; struct node { ll a, b; } e[maxn]; bool cmp(node x, node y) { return y.a * (x.b + 1) < x.a * (y.b + 1); } int main() { // freopen(".in","r",stdin); // freopen(".out","w",stdout); i...
[["+", 12, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 64, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 12, 13], ["+", 64, 1, 0, 11, 12, 16, 12, 23, 0, 25]]
1
417
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxn = 1e6 + 7; ll n, t, zer; ll z[maxn], f[maxn]; struct node { ll a, b; } e[maxn]; bool cmp(node x, node y) { return y.a * (x.b + 1) < x.a * (y.b + 1); } int main() { // freopen(".in","r",stdin); // freopen(".out","w",stdout); ios...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxn = 1e6 + 7; ll n, t, zer; ll z[maxn], f[maxn]; struct node { ll a, b; } e[maxn]; bool cmp(node x, node y) { return y.a * (x.b + 1) < x.a * (y.b + 1); } int main() { // freopen(".in","r",stdin); // freopen(".out","w",stdout); ios...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
416
#include <bits/stdc++.h> using namespace std; #define maxn 200010 template <typename T> inline T read() { register T sum = 0; register char cc = getchar(); int sym = 1; while (cc != '-' && (cc > '9' || cc < '0')) cc = getchar(); if (cc == '-') sym = -1, cc = getchar(); sum = sum * 10 + cc - '0'; c...
#include <bits/stdc++.h> using namespace std; #define maxn 200010 template <typename T> inline T read() { register T sum = 0; register char cc = getchar(); int sym = 1; while (cc != '-' && (cc > '9' || cc < '0')) cc = getchar(); if (cc == '-') sym = -1, cc = getchar(); sum = sum * 10 + cc - '0'; c...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
699
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long...
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]]
1
2,643
#include "bits/stdc++.h" using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define pb push_back #define eb emplace_back #define ins insert #define f first #define s second ...
#include "bits/stdc++.h" using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define pb push_back #define eb emplace_back #define ins insert #define f first #define s second ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
620
#include <algorithm> #include <iostream> #include <vector> using namespace std; using ll = long long; const int H = 40; ll dp[H]; struct Shop { ll a, b; Shop(ll av, ll bv) : a(av), b(bv) {} bool operator<(const Shop &rhs) const { return a * rhs.b > rhs.a * b; } }; int main() { ios_base::sync_with_stdio(fals...
#include <algorithm> #include <iostream> #include <vector> using namespace std; using ll = long long; const int H = 40; ll dp[H]; struct Shop { ll a, b; Shop(ll av, ll bv) : a(av), b(bv) {} bool operator<(const Shop &rhs) const { return a * rhs.b > rhs.a * b; } }; int main() { ios_base::sync_with_stdio(fals...
[["-", 0, 14, 8, 9, 0, 1, 0, 27, 17, 29], ["-", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
456
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #define _USE_MATH_DEFINES #include <functional> #include <math.h> using namespace std; #define rep(i, x) for (ll i = 0; i < x; i++) #define repn(i, x) for (ll i...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #define _USE_MATH_DEFINES #include <functional> #include <math.h> using namespace std; #define rep(i, x) for (ll i = 0; i < x; i++) #define repn(i, x) for (ll i...
[["-", 8, 9, 0, 37, 0, 16, 31, 16, 17, 85], ["-", 0, 37, 0, 16, 31, 16, 12, 118, 28, 22], ["+", 8, 9, 0, 37, 0, 16, 31, 16, 17, 48], ["+", 0, 37, 0, 16, 31, 16, 12, 118, 28, 22], ["-", 8, 9, 0, 37, 0, 16, 12, 16, 17, 85], ["-", 0, 37, 0, 16, 12, 16, 12, 118, 28, 22], ["+", 8, 9, 0, 37, 0, 16, 12, 16, 17, 48], ["+", 0, ...
1
1,063
#include <bits/stdc++.h> #define PI 3.14159265358979323846264338327950288419 using namespace std; int n, T; pair<int, int> shop[200005]; const int INF = 1010101010; int dp[200005][32]; // consider shops 1..i, chose j, minimum time? bool comparator(pair<int, int> s, pair<int, int> t) { return 1LL * s.first * (1 +...
#include <bits/stdc++.h> #define PI 3.14159265358979323846264338327950288419 using namespace std; int n, T; pair<int, int> shop[200005]; const int INF = 1010101010; int dp[200005][32]; // consider shops 1..i, chose j, minimum time? bool comparator(pair<int, int> s, pair<int, int> t) { return 1LL * s.first * (1 +...
[["+", 49, 50, 51, 16, 31, 16, 12, 23, 0, 24], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 49, 50, 51, 16, 31, 16, 12, 23, 0, 25]]
1
498
// IOI 2021 #include <bits/stdc++.h> using namespace std; #define int ll #define endl '\n' #define ends ' ' #define die(x) return cout << x << endl, 0 #define all(v) v.begin(), v.end() #define sz(x) (int)(x.size()) void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tai...
// IOI 2021 #include <bits/stdc++.h> using namespace std; #define int ll #define endl '\n' #define ends ' ' #define die(x) return cout << x << endl, 0 #define all(v) v.begin(), v.end() #define sz(x) (int)(x.size()) void debug_out() { cerr << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tai...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
579
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define lll __int128 #define ull unsigned long long #define fi first #define se second #define db double #define ld long double #define lld __flo...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define lll __int128 #define ull unsigned long long #define fi first #define se second #define db double #define ld long double #define lld __flo...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72]]
1
762
// Link : https://codeforces.com/problemset/problem/821/D #include <bits/stdc++.h> using namespace std; #define ll long long #define N 200005 int a[N], b[N]; int ids[N]; bool cmp(int x, int y) { ll r = (ll)(a[x] + b[x]) * a[y] + b[y] + a[y]; ll u = (ll)(a[y] + b[y]) * a[x] + b[x] + a[x]; return u < u; } void s...
// Link : https://codeforces.com/problemset/problem/821/D #include <bits/stdc++.h> using namespace std; #define ll long long #define N 200005 int a[N], b[N]; int ids[N]; bool cmp(int x, int y) { ll r = (ll)(a[x] + b[x]) * a[y] + b[y] + a[y]; ll u = (ll)(a[y] + b[y]) * a[x] + b[x] + a[x]; return r < u; } void s...
[["-", 0, 14, 8, 9, 0, 37, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
520
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author cherrypi59 */ #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FFOR(i, a, b) FOR(i, a, b + 1) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) FOR(i, 1, n + 1) #define ALL(v) (v).b...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author cherrypi59 */ #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FFOR(i, a, b) FOR(i, a, b + 1) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) FOR(i, 1, n + 1) #define ALL(v) (v).b...
[["-", 51, 4, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 2, 3, 4, 0, 16, 12, 2, 63, 22], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 25], ["-", 8, 9, 0, 9, 0, 57, 64, 93, 0, 94], ["+", 8, 9, 0, 9, 0, 57, 64, 116, 0, 117]]
1
672
#include <bits/stdc++.h> #define R register #define mp make_pair #define ll long long #define pii pair<int, int> using namespace std; const ll inf = 1e9 + 1; int n, t; ll f[40]; vector<int> fr; vector<pii> st; template <class T> inline void read(T &x) { x = 0; char ch = getchar(), w = 0; while (!isdigit(ch)) ...
#include <bits/stdc++.h> #define R register #define mp make_pair #define ll long long #define pii pair<int, int> using namespace std; const ll inf = 1e9 + 1; int n, t; ll f[40]; vector<int> fr; vector<pii> st; template <class T> inline void read(T &x) { x = 0; char ch = getchar(), w = 0; while (!isdigit(ch)) ...
[["+", 3, 4, 0, 16, 31, 16, 31, 16, 12, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 72]]
1
470
// #pragma GCC optimize("Ofast") // #pragma GCC optimize("no-stack-protector") // #pragma GCC optimize("unroll-loops") // #pragma GCC optimize("fast-math") // #pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native") #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring...
// #pragma GCC optimize("Ofast") // #pragma GCC optimize("no-stack-protector") // #pragma GCC optimize("unroll-loops") // #pragma GCC optimize("fast-math") // #pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native") #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 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]]
1
626
#include "bits/stdc++.h" using namespace std; typedef long long ll; const ll MOD = (ll)(1e9 + 7); #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int(i) = 0; (i) < (int)(n); (i)++) int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int N; ll T, a[200000], b[200...
#include "bits/stdc++.h" using namespace std; typedef long long ll; const ll MOD = (ll)(1e9 + 7); #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int(i) = 0; (i) < (int)(n); (i)++) int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int N; ll T, a[200000], b[200...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
541
#include <bits/stdc++.h> using namespace std; const int64_t INF = 1LL << 60; template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } int main() { ios::sync_with_stdio(false); cin.tie(0); int N; int64_t T; cin >> N >> T; vector<int64_t> A, B, ...
#include <bits/stdc++.h> using namespace std; const int64_t INF = 1LL << 60; template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } int main() { ios::sync_with_stdio(false); cin.tie(0); int N; int64_t T; cin >> N >> T; vector<int64_t> A, B, ...
[["-", 8, 9, 0, 37, 0, 16, 12, 16, 17, 85], ["+", 8, 9, 0, 37, 0, 16, 12, 16, 17, 48]]
1
519
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<ll, ll>; #define fi first #define se second #define amin(a, b) a = min(a, b) #define amax(a, b) a = max(a, b) int main() { int n; ll t; cin >> n >> t; P sh...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<ll, ll>; #define fi first #define se second #define amin(a, b) a = min(a, b) #define amax(a, b) a = max(a, b) int main() { int n; ll t; cin >> n >> t; P sh...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
498
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> Pi; typedef vector<ll> Vec; typedef vector<int> Vi; typedef vector<string> Vs; typedef vector<P> VP; typedef vector<vector<ll>> VV; typedef vector<vector<int>> VVi; typedef vector<vector<vector<ll>>> VVV...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> Pi; typedef vector<ll> Vec; typedef vector<int> Vi; typedef vector<string> Vs; typedef vector<P> VP; typedef vector<vector<ll>> VV; typedef vector<vector<int>> VVi; typedef vector<vector<vector<ll>>> VVV...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
1,537
#include <bits/stdc++.h> #define N 200002 #define x second.first #define y second.second #define z first using namespace std; vector<pair<float, pair<int, int>>> a; vector<int> b, s; int d[32][N]; int bs(int t) { int r = 0, p, n = s.size(); for (p = 1 << 17; p; p /= 2) if (r + p < n && s[r + p] <= t) r +=...
#include <bits/stdc++.h> #define N 200002 #define x second.first #define y second.second #define z first using namespace std; vector<pair<float, pair<int, int>>> a; vector<int> b, s; int d[32][N]; int bs(int t) { int r = 0, p, n = s.size(); for (p = 1 << 17; p; p /= 2) if (r + p < n && s[r + p] <= t) r +=...
[["-", 8, 9, 0, 7, 10, 34, 12, 11, 12, 13], ["+", 8, 9, 0, 7, 10, 34, 12, 11, 12, 13]]
1
467
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") typedef vector<int> vi; typedef long long lint; typedef unsigned int uint; typedef pair<int, int> pii; typedef pair<lint, lint> pll; typedef unsigned long long ulint; #define endl '\n' #define fst first #define sed second #define pb push_back #...
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") typedef vector<int> vi; typedef long long lint; typedef unsigned int uint; typedef pair<int, int> pii; typedef pair<lint, lint> pll; typedef unsigned long long ulint; #define endl '\n' #define fst first #define sed second #define pb push_back #...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, ...
1
533
#include <algorithm> #include <iostream> #include <utility> #include <vector> #define llint long long #define inf 3e18 using namespace std; typedef pair<llint, llint> P; llint n, T; vector<P> avec, bvec; llint dp[200005][45]; bool comp(P x1, P x2) { return x2.first * (x1.second + 1) < x1.first * (x2.second + 1); }...
#include <algorithm> #include <iostream> #include <utility> #include <vector> #define llint long long #define inf 3e18 using namespace std; typedef pair<llint, llint> P; llint n, T; vector<P> avec, bvec; llint dp[200005][45]; bool comp(P x1, P x2) { return x2.first * (x1.second + 1) < x1.first * (x2.second + 1); }...
[["+", 3, 4, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 16, 31, 23, 0, 25]]
1
529
#include <bits/stdc++.h> using namespace std; using ll = long long; using PII = pair<int, int>; using VI = vector<int>; const ll MAX = 1e9 + 10; struct node { node(ll a, ll b) : a(a), b(b) {} ll a, b; bool operator<(const node &other) const { return b * other.a < a * other.b; } ll advance(ll t) const { retur...
#include <bits/stdc++.h> using namespace std; using ll = long long; using PII = pair<int, int>; using VI = vector<int>; const ll MAX = 1e9 + 10; struct node { node(ll a, ll b) : a(a), b(b) {} ll a, b; bool operator<(const node &other) const { return b * other.a < a * other.b; } ll advance(ll t) const { retur...
[["+", 0, 37, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 37, 0, 2, 3, 4, 0, 16, 12, 13]]
1
481
#include <algorithm> #include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long LL; template <typename F, typename S> std::ostream &operator<<(ostream &os, const ...
#include <algorithm> #include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long LL; template <typename F, typename S> std::ostream &operator<<(ostream &os, const ...
[["+", 49, 185, 54, 55, 0, 56, 0, 153, 0, 154], ["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 20], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13]]
1
769
// #define STOPIT #include <bits/stdc++.h> #define rep(i, n, m) for (int i = (n); i < (m); i++) #define rrep(i, n, m) for (int i = (n)-1; i >= (m); i--) using namespace std; using ll = long long; void debug_impl() { cerr << endl; } template <typename Head, typename... Tail> void debug_impl(Head head, Tail... tail) { ...
// #define STOPIT #include <bits/stdc++.h> #define rep(i, n, m) for (int i = (n); i < (m); i++) #define rrep(i, n, m) for (int i = (n)-1; i >= (m); i--) using namespace std; using ll = long long; void debug_impl() { cerr << endl; } template <typename Head, typename... Tail> void debug_impl(Head head, Tail... tail) { ...
[["+", 3, 4, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 31, 13], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 16, 31, 23, 0, 25]]
1
660
#include <bits/stdc++.h> using namespace std; #define ll long long #define mp make_pair #define pb push_back const int N = 2e5 + 5; int n, T; vector<pair<int, int>> v1; vector<int> v0; vector<ll> sum0; ll f[35][N]; bool comp(pair<int, int> a, pair<int, int> b) { return 1LL * b.first * (1 + a.second) < 1LL * a.firs...
#include <bits/stdc++.h> using namespace std; #define ll long long #define mp make_pair #define pb push_back const int N = 2e5 + 5; int n, T; vector<pair<int, int>> v1; vector<int> v0; vector<ll> sum0; ll f[35][N]; bool comp(pair<int, int> a, pair<int, int> b) { return 1LL * b.first * (1 + a.second) < 1LL * a.firs...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
569
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define pb push_back #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin()) #define ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define pb push_back #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin()) #define ...
[["+", 0, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 48]]
1
1,041
#include <bits/stdc++.h> using namespace std; #define MAXN 200002 #define LL long long struct Node { LL a, b; Node() {} Node(LL x, LL y) { a = x, b = y; } } s[MAXN]; int n, ans = 0, B[MAXN]; LL t, dp[33] = {0}; int cnt = 0, pf = 0; bool cmp(Node x, Node y) { return x.a * (y.b + 1) > y.a * (x.b + 1); } int mai...
#include <bits/stdc++.h> using namespace std; #define MAXN 200002 #define LL long long struct Node { LL a, b; Node() {} Node(LL x, LL y) { a = x, b = y; } } s[MAXN]; int n, ans = 0, B[MAXN]; LL t, dp[33] = {0}; int cnt = 0, pf = 0; bool cmp(Node x, Node y) { return x.a * (y.b + 1) > y.a * (x.b + 1); } int mai...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
503
// love yjl forever #include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define mp make_pair #define pb push_back #define fi first #define se second const int INF = 0x3f3f3f3f, N = 2e5 + 5; ll n, T; struct node { ll x, y; } a[N]; bool cmp(node x, node y) { return y.x * (x.y +...
// love yjl forever #include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define mp make_pair #define pb push_back #define fi first #define se second const int INF = 0x3f3f3f3f, N = 2e5 + 5; ll n, T; struct node { ll x, y; } a[N]; bool cmp(node x, node y) { return y.x * (x.y +...
[["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22]]
1
517
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; #define ll long long pair<ll, ll> a[maxn], tmp; ll c[maxn]; ll dp[maxn]; bool cmp(pair<ll, ll> A, pair<ll, ll> B) { return A.first * (B.second + 1) > B.first * (A.second + 1); } void solve() { int n; ll T; scanf("%d %lld", &n, &T); in...
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; #define ll long long pair<ll, ll> a[maxn], tmp; ll c[maxn]; ll dp[maxn]; bool cmp(pair<ll, ll> A, pair<ll, ll> B) { return A.first * (B.second + 1) > B.first * (A.second + 1); } void solve() { int n; ll T; scanf("%d %lld", &n, &T); in...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
439
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <uti...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <uti...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
602
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) #define ll long long #define lb(x) ((x) & (-x)) #define pii pair<int, int> #define vi vector<int> #define pb push_back #define fi first #define se second #define de(x) cout << x << " x" ...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = (a); i < (b); ++i) #define per(i, a, b) for (int i = (b)-1; i >= (a); --i) #define ll long long #define lb(x) ((x) & (-x)) #define pii pair<int, int> #define vi vector<int> #define pb push_back #define fi first #define se second #define de(x) cout << x << " x" ...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 31, 22]]
1
563
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int, int> #define mp make_pair int n, m, f[32], res; vector<int> zero; vector<pii> nz; bool cmp(const pii &x, const pii &y) { return x.first * x.second < y.first * y.second; } signed main() { scanf("%lld%lld", &n, &m); for (int i...
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int, int> #define mp make_pair int n, m, f[32], res; vector<int> zero; vector<pii> nz; bool cmp(const pii &x, const pii &y) { return y.first * x.second < x.first * y.second; } signed main() { scanf("%lld%lld", &n, &m); for (int i...
[["-", 0, 37, 0, 16, 31, 16, 31, 118, 28, 22], ["+", 0, 37, 0, 16, 31, 16, 31, 118, 28, 22], ["-", 0, 37, 0, 16, 12, 16, 31, 118, 28, 22], ["+", 0, 37, 0, 16, 12, 16, 31, 118, 28, 22]]
1
356
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 7; typedef long long ll; ll dp[maxn][57]; struct dian { int a, b; }; vector<dian> ld; vector<dian> ly; dian store[maxn]; bool comp(const dian &a, const dian &b) { return 1ll * b.a * (a.b + 1) < 1ll * a.a * (b.b + 1); } bool cmp1(const dian &a, con...
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 7; typedef long long ll; ll dp[maxn][57]; struct dian { int a, b; }; vector<dian> ld; vector<dian> ly; dian store[maxn]; bool comp(const dian &a, const dian &b) { return 1ll * b.a * (a.b + 1) < 1ll * a.a * (b.b + 1); } bool cmp1(const dian &a, con...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
527
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 49, 50, 51, 218, 369, 370, 0, 382, 0, 67]]
1
606
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e5 + 100; ll a[maxn], b[maxn]; struct node { ll a, b; } p[maxn], s2[maxn]; int cmp(node i, node j) { return j.a * i.b + j.a < i.a * j.b + i.a; } ll dp[maxn][35], s1[maxn]; int main() { ll n, T, i, tim, cost, mid, top1, top2, ans, ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e5 + 100; ll a[maxn], b[maxn]; struct node { ll a, b; } p[maxn], s2[maxn]; int cmp(node i, node j) { return j.a * i.b + j.a < i.a * j.b + i.a; } ll dp[maxn][35], s1[maxn]; int main() { ll n, T, i, tim, cost, mid, top1, top2, ans, ...
[["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
648
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define x first #define y second #define pii pair<int, int> #define mp make_pair #define pb push_back #define sz(a) (int)(a.size()) const int INF = 1000 * 1000 * 1000 + 7; const ll LINF = INF * (ll)INF; const int mod = INF; const int MAX = 1 << 25; ll ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define x first #define y second #define pii pair<int, int> #define mp make_pair #define pb push_back #define sz(a) (int)(a.size()) const int INF = 1000 * 1000 * 1000 + 7; const ll LINF = INF * (ll)INF; const int mod = INF; const int MAX = 1 << 25; ll ...
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47], ["+", 3, 4, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 16, 12, 23, 0, 25]]
1
532
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int INF = 0x3f3f3f3f; const LL mod = 1e9 + 7; const int N = 200005; struct Node { int x, y; }; bool cmp(const Node &p1, const Node &p2) { return (LL)p1.x * (p2.y + 1) > (LL)p2.x * (p1.y + 1); } LL f[30]; LL pre[N]; int main() { int n, T; ...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int INF = 0x3f3f3f3f; const LL mod = 1e9 + 7; const int N = 200005; struct Node { int x, y; }; bool cmp(const Node &p1, const Node &p2) { return (LL)p1.x * (p2.y + 1) > (LL)p2.x * (p1.y + 1); } LL f[30]; LL pre[N]; int main() { int n, T; ...
[["+", 0, 11, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 16, 31, 23, 0, 25]]
1
480
#include <bits/stdc++.h> #define f first #define s second #define MOD 1000000007 #define PMOD 998244353 #define pb(x) push_back(x) using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef pair<ll, ll> plii; typedef pair<int, pii> piii; const int INF = 1e9 + 10; const ll LINF = 1LL * INF * INF...
#include <bits/stdc++.h> #define f first #define s second #define MOD 1000000007 #define PMOD 998244353 #define pb(x) push_back(x) using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef pair<ll, ll> plii; typedef pair<int, pii> piii; const int INF = 1e9 + 10; const ll LINF = 1LL * INF * INF...
[["+", 31, 23, 0, 16, 31, 69, 341, 342, 0, 73], ["-", 0, 16, 31, 23, 0, 69, 341, 342, 0, 73], ["-", 12, 16, 31, 23, 0, 69, 341, 342, 0, 73]]
1
716
#include <bits/stdc++.h> #define LL long long #define mem(i, j) memset(i, j, sizeof(i)) #define rep(i, j, k) for (int i = j; i <= k; i++) #define dep(i, j, k) for (int i = k; i >= j; i--) #define pb push_back #define make make_pair #define INF INT_MAX #define inf LLONG_MAX #define PI acos(-1) #define fir first #define ...
#include <bits/stdc++.h> #define LL long long #define mem(i, j) memset(i, j, sizeof(i)) #define rep(i, j, k) for (int i = j; i <= k; i++) #define dep(i, j, k) for (int i = k; i >= j; i--) #define pb push_back #define make make_pair #define INF INT_MAX #define inf LLONG_MAX #define PI acos(-1) #define fir first #define ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38]]
1
451
#include <bits/stdc++.h> using namespace std; #define pb push_back #define int long long #define F first #define S second typedef pair<int, int> P; const int N = 30 + 5, INF = 0x3f3f3f3f; inline int read() { int x = 0, f = 0; char ch = 0; while (!isdigit(ch)) f |= ch == '-', ch = getchar(); while (isdigit(c...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define int long long #define F first #define S second typedef pair<int, int> P; const int N = 30 + 5, INF = 0x3f3f3f3f; inline int read() { int x = 0, f = 0; char ch = 0; while (!isdigit(ch)) f |= ch == '-', ch = getchar(); while (isdigit(c...
[["-", 0, 16, 12, 23, 0, 41, 75, 66, 17, 48], ["-", 12, 23, 0, 41, 75, 66, 28, 23, 0, 24], ["-", 75, 66, 28, 23, 0, 16, 12, 66, 17, 48], ["-", 0, 16, 12, 66, 28, 2, 3, 4, 0, 25]]
1
500
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <complex> #include <cstring> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limit...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <complex> #include <cstring> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limit...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 31, 22], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 17, 33]]
1
796
#include <bits/stdc++.h> #define fo(i, a, b) for (int i = (a); i <= (b); ++i) #define rv(i, a, b) for (int i = (a); i >= (b); --i) #define inf 0x3f3f3f3f #define SZ(x) ((int)x.size()) using namespace std; const int M = 220000; typedef long long ll; int n, m, k, t; struct node { int a, b; } e[M]; ll dp[60] = {0}; int ...
#include <bits/stdc++.h> #define fo(i, a, b) for (int i = (a); i <= (b); ++i) #define rv(i, a, b) for (int i = (a); i >= (b); --i) #define inf 0x3f3f3f3f #define SZ(x) ((int)x.size()) using namespace std; const int M = 220000; typedef long long ll; int n, m, k, t; struct node { int a, b; } e[M]; ll dp[60] = {0}; int ...
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
511
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (int)(b); i++) #define FORD(i, a, b) for (int i = a; i > (int)(b); i--) #define PPC(x) __builtin_popcount(x) #define MSB(x) (31 - __builtin_clz(x)) #define pb push_back #define ALL(x) (x).begin(), (x).end() #define ithBit(...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (int)(b); i++) #define FORD(i, a, b) for (int i = a; i > (int)(b); i--) #define PPC(x) __builtin_popcount(x) #define MSB(x) (31 - __builtin_clz(x)) #define pb push_back #define ALL(x) (x).begin(), (x).end() #define ithBit(...
[["+", 3, 4, 0, 16, 31, 16, 31, 16, 12, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
526
#include <algorithm> #include <cassert> #include <iostream> #include <vector> using namespace std; template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { os << "{"; for (typename vector<T>::const_iterator vi = v.begin(); vi != v.end(); ++vi) { if (vi != v.begin()) os << ", "; os...
#include <algorithm> #include <cassert> #include <iostream> #include <vector> using namespace std; template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { os << "{"; for (typename vector<T>::const_iterator vi = v.begin(); vi != v.end(); ++vi) { if (vi != v.begin()) os << ", "; os...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 338, 8, 9, 0, 57, 64, 93, 0, 94], ["+", 0, 338, 8, 9, 0, 57, 64, 116, 0, 117]]
1
723
#include "bits/stdc++.h" using namespace std; struct Point { int a, b; bool operator<(const Point &x) const { return 1ll * x.a * (b + 1) < 1ll * a * (x.b + 1); } }; vector<Point> A; vector<long long> B; long long Dp[111]; int N, T; int main() { int i, j; scanf("%d%d", &N, &T); for (i = 1; i <= N; ++i) {...
#include "bits/stdc++.h" using namespace std; struct Point { int a, b; bool operator<(const Point &x) const { return 1ll * x.a * (b + 1) < 1ll * a * (x.b + 1); } }; vector<Point> A; vector<long long> B; long long Dp[111]; int N, T; int main() { int i, j; scanf("%d%d", &N, &T); for (i = 1; i <= N; ++i) {...
[["+", 12, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 12, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
435
#include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int, int> #define app push_back #define all(a) a.begin(), a.end() #define bp __builtin_popcount #define ll long long #define mp make_pair #define f first #define s second #define Time (double)clock() / CLOCKS_PER_SEC const int N = 2e5 +...
#include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int, int> #define app push_back #define all(a) a.begin(), a.end() #define bp __builtin_popcount #define ll long long #define mp make_pair #define f first #define s second #define Time (double)clock() / CLOCKS_PER_SEC const int N = 2e5 +...
[["+", 3, 4, 0, 16, 31, 16, 31, 16, 12, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 72]]
1
418
import sys def input(): return sys.stdin.buffer.readline()[:-1] n, T = map(int, input().split()) zero = [] non_zero = [] for _ in range(n): a, b = map(int, input().split()) if a == 0: zero.append(b) else: non_zero.append((a, b)) zero.sort() if not zero: z_cum = [] else: z_cum = [zero[0] + 1] for i in ran...
import sys def input(): return sys.stdin.buffer.readline()[:-1] n, T = map(int, input().split()) zero = [] non_zero = [] for _ in range(n): a, b = map(int, input().split()) if a == 0: zero.append(b) else: non_zero.append((a, b)) zero.sort() if not zero: z_cum = [] else: z_cum = [zero[0] + 1] for i in ran...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 664, 28, 612], ["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 8, 196, 0, 57, 64, 196, 0, 116, 0, 117]]
5
383
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define ll long long #define rep2(i, a, b) for (ll i = a; i <= b; ++i) #define rep(i, n) for (ll i = 0; i < n; i++) #define rep3(i, a, b) for (ll i = a; i >= b; i--) #define pii pair<int, int> #define pll pair<ll, ll> #define pq priority_queue #define pb push_back #de...
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define ll long long #define rep2(i, a, b) for (ll i = a; i <= b; ++i) #define rep(i, n) for (ll i = 0; i < n; i++) #define rep3(i, a, b) for (ll i = a; i >= b; i--) #define pii pair<int, int> #define pll pair<ll, ll> #define pq priority_queue #define pb push_back #de...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 37, 0, 16, 31, 16, 17, 85], ["+", 8, 9, 0, 37, 0, 16, 31, 16, 17, 48], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 218...
1
782
#include <bits/stdc++.h> const int maxn = 4e5 + 3; typedef long long ll; int n; ll t; struct vec { ll a, b; void read() { scanf("%lld%lld", &a, &b); } bool operator<(const vec &other) const { return a * (other.b + 1ll) > other.a * (b + 1ll); } } v[maxn]; ll dp[32]; int main() { scanf("%d%lld", &n, &t);...
#include <bits/stdc++.h> const int maxn = 4e5 + 3; typedef long long ll; int n; ll t; struct vec { ll a, b; void read() { scanf("%lld%lld", &a, &b); } bool operator<(const vec &other) const { return a * (other.b + 1ll) > other.a * (b + 1ll); } } v[maxn]; ll dp[32]; int main() { scanf("%d%lld", &n, &t);...
[["+", 0, 16, 31, 16, 12, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 12, 23, 0, 25]]
1
426
#include "bits/stdc++.h" using namespace std; typedef long long li; int main() { cin.tie(0); ios::sync_with_stdio(false); li n, t; cin >> n >> t; vector<li> as(n), bs(n); vector<li> order; for (int i = 0; i < n; ++i) { cin >> as[i] >> bs[i]; bs[i] = as[i] + bs[i] + 1; order.push_back(i); ...
#include "bits/stdc++.h" using namespace std; typedef long long li; int main() { cin.tie(0); ios::sync_with_stdio(false); li n, t; cin >> n >> t; vector<li> as(n), bs(n); vector<li> order; for (int i = 0; i < n; ++i) { cin >> as[i] >> bs[i]; bs[i] = as[i] + bs[i] + 1; order.push_back(i); ...
[["+", 51, 16, 31, 69, 341, 342, 0, 69, 28, 22], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 73]]
1
457
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; int main() { int N; long long T; cin >> N >> T; vector<long long> a(N), b(N); for (int i = 0; i < N; i++) cin >> a[i] >> b[i]; vector<long long> a0, b0, a1, b1; for (int i = 0; i < N; i++) if (a[i]...
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; int main() { int N; long long T; cin >> N >> T; vector<long long> a(N), b(N); for (int i = 0; i < N; i++) cin >> a[i] >> b[i]; vector<long long> a0, b0, a1, b1; for (int i = 0; i < N; i++) if (a[i]...
[["-", 0, 218, 8, 9, 0, 37, 0, 16, 17, 18], ["+", 0, 218, 8, 9, 0, 37, 0, 16, 17, 47]]
1
601
// khodaya khodet komak kon #include <bits/stdc++.h> #define F first #define S second #define pb push_back #define all(x) x.begin(), x.end() #pragma GCC optimise("ofast") #pragma GCC optimise("unroll-loops") #define int long long using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef vector<i...
// khodaya khodet komak kon #include <bits/stdc++.h> #define F first #define S second #define pb push_back #define all(x) x.begin(), x.end() #pragma GCC optimise("ofast") #pragma GCC optimise("unroll-loops") #define int long long using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef vector<i...
[["+", 0, 1, 0, 11, 12, 16, 31, 69, 28, 22], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 73]]
1
613
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define MOD 1000000007 #define MOD2 998244353 #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #defi...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define MOD 1000000007 #define MOD2 998244353 #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #defi...
[["+", 64, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 64, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 43, 49, 50, 51, 118, 28, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 118, 28, 22]]
1
433
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 18], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33]]
1
847
import sys readline = sys.stdin.buffer.readline INF = 10**18+3 N, T = map(int, readline().split()) AB = [tuple(map(int, readline().split())) for _ in range(N)] ABzero = [b for a, b in AB if a == 0] ABnonzero = [(a, b) for a, b in AB if a] ABnonzero.sort(key = lambda x: (x[1]-1)/x[0]) dp = [0] for a, b in ABnonzero:...
import sys readline = sys.stdin.buffer.readline INF = 10**18+3 N, T = map(int, readline().split()) AB = [tuple(map(int, readline().split())) for _ in range(N)] ABzero = [b for a, b in AB if a == 0] ABnonzero = [(a, b) for a, b in AB if a] ABnonzero.sort(key = lambda x: (x[1]+1)/x[0]) dp = [0] for a, b in ABnonzero:...
[["-", 51, 670, 8, 657, 31, 23, 0, 657, 17, 33], ["+", 51, 670, 8, 657, 31, 23, 0, 657, 17, 72], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
316
#include <bits/stdc++.h> using namespace std; void chmin(int64_t &a, int64_t b) { a = min(a, b); } int main() { int N, T; cin >> N >> T; vector<pair<int64_t, int64_t>> AB; vector<int64_t> B0; for (int i = 0; i < N; i++) { int64_t a, b; cin >> a >> b; if (a > 0) { AB.emplace_back(a, b); ...
#include <bits/stdc++.h> using namespace std; void chmin(int64_t &a, int64_t b) { a = min(a, b); } int main() { int N, T; cin >> N >> T; vector<pair<int64_t, int64_t>> AB; vector<int64_t> B0; for (int i = 0; i < N; i++) { int64_t a, b; cin >> a >> b; if (a > 0) { AB.emplace_back(a, b); ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 51, 16, 31, 16, 31, 16, 31, 69, 28, 22], ["+", 31, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 31, 16, 31, 16, 31, 69, 341, 342, 0, 22], ["+", 31, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, ...
1
397
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define SZ(x) ((int)x.size()) #define FOR(i, a, b) for (int i = a; i <= b; ++i) #define FORD(i, a, b) for (int i = a; i >= b; --i) using namespace std; typedef long long LL; typedef pair<int, int> pa; typedef vector<in...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define SZ(x) ((int)x.size()) #define FOR(i, a, b) for (int i = a; i <= b; ++i) #define FORD(i, a, b) for (int i = a; i >= b; --i) using namespace std; typedef long long LL; typedef pair<int, int> pa; typedef vector<in...
[["+", 341, 342, 0, 69, 341, 342, 0, 16, 17, 72], ["+", 341, 342, 0, 69, 341, 342, 0, 16, 12, 13]]
1
671
#include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template<typename T, typename L> using gpp_map = tre...
#include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template<typename T, typename L> using gpp_map = tre...
[["-", 49, 50, 51, 16, 31, 74, 51, 23, 0, 24], ["-", 51, 16, 31, 74, 51, 23, 0, 16, 17, 33], ["-", 51, 16, 31, 74, 51, 23, 0, 16, 12, 13], ["-", 49, 50, 51, 16, 31, 74, 51, 23, 0, 25]]
1
934
#include <bits/stdc++.h> #define pb push_back #define F first #define S second #define all(x) x.begin(), x.end() #define debug(x) cerr << #x << " : " << x << '\n' using namespace std; typedef long long ll; typedef long double ld; typedef string str; typedef pair<ll, ll> pll; const ll Mod = 1000000007LL; const int N...
#include <bits/stdc++.h> #define pb push_back #define F first #define S second #define all(x) x.begin(), x.end() #define debug(x) cerr << #x << " : " << x << '\n' using namespace std; typedef long long ll; typedef long double ld; typedef string str; typedef pair<ll, ll> pll; const ll Mod = 1000000007LL; const int N...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
418
#pragma GCC optimize("O3") #pragma GCC target("avx") #include <algorithm> #include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <vector> #ifdef LOCAL #define eprintf(...) fprintf(stderr, __VA_ARGS__) #else #define NDEBUG #define eprintf(...) ...
#pragma GCC optimize("O3") #pragma GCC target("avx") #include <algorithm> #include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <vector> #ifdef LOCAL #define eprintf(...) fprintf(stderr, __VA_ARGS__) #else #define NDEBUG #define eprintf(...) ...
[["+", 64, 9, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 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, 22], ["+", 64, 9, 0, 9, 0, 57, 64, 9, 0, 46]]
1
618
#include <bits/stdc++.h> using namespace std; const int N = 200005, M = 40; template <class T> void read(T &x) { int sgn = 1; char ch; x = 0; for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = getchar()) ; if (ch == '-') ch = getchar(), sgn = -1; for (; '0' <= ch && ch <= '9'; ch = get...
#include <bits/stdc++.h> using namespace std; const int N = 200005, M = 40; template <class T> void read(T &x) { int sgn = 1; char ch; x = 0; for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = getchar()) ; if (ch == '-') ch = getchar(), sgn = -1; for (; '0' <= ch && ch <= '9'; ch = get...
[["+", 51, 83, 0, 16, 31, 16, 31, 69, 28, 22], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 22], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["+", 49, 50, 51, 83, 0, 16, 31, 16, 17, 72]]
1
708
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define rep(i, n) rep2(i, 0, n) #define re...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define rep(i, n) rep2(i, 0, n) #define re...
[["-", 8, 9, 0, 37, 0, 16, 31, 16, 17, 85], ["+", 8, 9, 0, 37, 0, 16, 31, 16, 17, 48]]
1
750
#include <bits/stdc++.h> #define MX 32 using namespace std; typedef long long int ll; typedef pair<ll, ll> P; bool comp(P p, P q) { return p.second * q.first < q.second * p.first; } ll dp[MX]; int main() { int n, T; scanf("%d %d", &n, &T); vector<int> all; vector<P> vx; for (int i = 0; i < n; i++) { int ...
#include <bits/stdc++.h> #define MX 32 using namespace std; typedef long long int ll; typedef pair<ll, ll> P; bool comp(P p, P q) { return p.second * q.first < q.second * p.first; } ll dp[MX]; int main() { int n, T; scanf("%d %d", &n, &T); vector<int> all; vector<P> vx; for (int i = 0; i < n; i++) { int ...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
412
#include <algorithm> #include <bitset> #include <iostream> using namespace std; bitset<1 << 10> T[10]; int N, M; bool tr = false; bitset<1 << 10> f[1 << 10]; int A[1 << 10][1 << 10]; main() { cin >> N >> M; if (N < M) { tr = true; swap(N, M); } for (int i = 0; i < N; i++) { for (int j = 0; j < 1 << ...
#include <algorithm> #include <bitset> #include <iostream> using namespace std; bitset<1 << 10> T[10]; int N, M; bool tr = false; bitset<1 << 10> f[1 << 10]; int A[1 << 10][1 << 10]; main() { cin >> N >> M; if (N < M) { tr = true; swap(N, M); } for (int i = 0; i < N; i++) { for (int j = 0; j < 1 << ...
[["-", 0, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["-", 8, 1, 0, 16, 12, 69, 341, 342, 0, 22], ["+", 8, 1, 0, 16, 12, 69, 341, 342, 0, 22]]
1
374
#include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template<typename T, typename L> using gpp_map = tre...
#include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template<typename T, typename L> using gpp_map = tre...
[["-", 8, 9, 0, 42, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 42, 0, 2, 3, 4, 0, 22]]
1
728
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> /*#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags #pragma GCC option("arch=native","tune=native","no-zero-upper...
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> /*#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags #pragma GCC option("arch=native","tune=native","no-zero-upper...
[["-", 0, 7, 8, 57, 15, 339, 51, 11, 17, 32], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 60]]
1
616
#include <algorithm> #include <bitset> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; #define fas...
#include <algorithm> #include <bitset> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; #define fas...
[["-", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111]]
1
1,013
a=gets if a=="AAA" print "No" elsif a=="BBB" print "No" else print "Yes" end
a=gets.chomp if a=="AAA" print "No" elsif a=="BBB" print "No" else print "Yes" end
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
29
#Macで実行する時 import sys import os if sys.platform=="darwin": base = os.path.dirname(os.path.abspath(__file__)) name = os.path.normpath(os.path.join(base, '../atcoder/input.txt')) sys.stdin = open(name) l = list(input()) #print(l) set_l = set(l) if len(set_l)==1: print("Yes") else: print("No")
#Macで実行する時 import sys import os if sys.platform=="darwin": base = os.path.dirname(os.path.abspath(__file__)) name = os.path.normpath(os.path.join(base, '../atcoder/input.txt')) sys.stdin = open(name) l = list(input()) #print(l) set_l = set(l) if len(set_l)==1: print("No") else: print("Yes")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
97
#include <bits/stdc++.h> #define _ \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define int long long #define sz(i...
#include <bits/stdc++.h> #define _ \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define int long long #define sz(i...
[["-", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125], ["+", 0, 1, 0, 11, 12, 16, 12, 103, 0, 125]]
1
225
s = input().split() x1=s[0][0] x2=s[0][1] x3=s[0][2] flag = False A = 'A' B = 'B' if x1==A and x2==A and x3==A: flag = True elif x1==B and x2==B and x3==B: flag = True else: flag = False if (flag): result = 'Yes' else: result = 'No' print(result)
s = input().split() x1=s[0][0] x2=s[0][1] x3=s[0][2] flag = False A = 'A' B = 'B' if x1==A and x2==A and x3==A: flag = True elif x1==B and x2==B and x3==B: flag = True else: flag = False if (flag): result = 'No' else: result = 'Yes' print(result)
[["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
107
import sys input = sys.stdin.readline s=input().rstrip() if len(set(s))>1: print('YES') else: print('NO')
import sys input = sys.stdin.readline s=input().rstrip() if len(set(s))>1: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
43
#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>; int main() { string s; cin >> s; if ((s[0] == s[1]) && (s[1] = s[2])) { cout << "No" << endl; } else { cout << "Yes" << endl; } return 0; }
#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>; int main() { string s; cin >> s; if ((s[0] == s[1]) && (s[1] == s[2])) { cout << "No" << endl; } else { cout << "Yes" << endl; } return 0; }
[["-", 51, 16, 12, 23, 0, 69, 0, 42, 0, 32], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 60]]
1
93
S = inpit() ans = 'Yes' if (S == 'AAA') or (S=='BBB'): ans = 'No' print(ans)
S = input() ans = 'Yes' if (S == 'AAA') or (S=='BBB'): ans = 'No' print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
36
s = gets().chomp puts s.split('').uniq == 1 ? 'No' : 'Yes'
s = gets().chomp puts s.split('').uniq.length == 1 ? 'No' : 'Yes'
[["+", 3, 4, 0, 754, 15, 738, 31, 652, 17, 131], ["+", 3, 4, 0, 754, 15, 738, 31, 652, 735, 22]]
4
27