problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int M = 20010; const long long M2 = 1e18; long long n, k, l, r, mid, ll, rr, mmid, cnt, i, a[M]; int main() { cin >> n >> k; for (i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); l = -M2; r = M2; while (l + 1 < r) { mid = l + r >> 1; cnt...
#include <bits/stdc++.h> using namespace std; const long long M = 2e5 + 10; const long long M2 = 1e18; long long n, k, l, r, mid, ll, rr, mmid, cnt, i, a[M]; int main() { cin >> n >> k; for (i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); l = -M2; r = M2; while (l + 1 < r) { mid = l + r >> 1...
replace
4
5
4
5
0
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; #define ALL(obj) (obj).begin(), (obj).end() #define SPEED \ cin.tie(0); \ ios::sync_w...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; #define ALL(obj) (obj).begin(), (obj).end() #define SPEED \ cin.tie(0); \ ios::sync_w...
insert
120
120
120
122
0
p02774
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; using ll = long long; const ll INF = ll(1e18) + 1; ll binary_search(ll x, ll ai, vector<ll> a) { int n = a.size(); int l = -1; int r = n; if (ai < 0) { while (l + 1 < r) { int c = (l + r) / 2; if...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; using ll = long long; const ll INF = ll(1e18) + 1; ll binary_search(ll x, ll ai, vector<ll> a) { int n = a.size(); int l = -1; int r = n; if (ai < 0) { while (l + 1 < r) { int c = (l + r) / 2; if...
replace
45
46
45
66
TLE
p02774
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; long long tot1, tot2, a[200010], b[200010], c[200010], kk; long long check1(long long ys) { long long ans = 0; for (long long i = 1; i <= tot1; i++...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; long long tot1, tot2, a[200010], b[200010], c[200010], kk; long long check1(long long ys) { long long ans = 0; for (long long i = 1; i <= tot1; i++...
replace
15
16
15
16
0
p02774
C++
Time Limit Exceeded
//////////////////////////////////////// /// tu3 pro-con template /// //////////////////////////////////////// #include "bits/stdc++.h" using namespace std; // -- typedefs -- // #define EPS 1e-9 typedef long long llong; // -- loop macros -- // #define LOOP_TYPE(s, n) ...
//////////////////////////////////////// /// tu3 pro-con template /// //////////////////////////////////////// #include "bits/stdc++.h" using namespace std; // -- typedefs -- // #define EPS 1e-9 typedef long long llong; // -- loop macros -- // #define LOOP_TYPE(s, n) ...
replace
223
224
223
224
TLE
p02774
C++
Runtime Error
//----------------------------templates #pragma GCC optimize("Ofast") #pragma GCC target("tune=native") #pragma GCC target("avx") //---------------------------- #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define int ll #define FOR(i, j, n) for (int i = (int)(j)...
//----------------------------templates #pragma GCC optimize("Ofast") #pragma GCC target("tune=native") #pragma GCC target("avx") //---------------------------- #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define int ll #define FOR(i, j, n) for (int i = (int)(j)...
replace
97
101
97
103
0
2 2 4 0 2 mid -9 , hit 2 mid -7 , hit 2 mid -6 , hit 4
p02774
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define FORR(i, m, n) for (int i = (m); i >= (n); --i) #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; typedef long long ll; t...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define FORR(i, m, n) for (int i = (m); i >= (n); --i) #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; typedef long long ll; t...
replace
70
71
70
71
0
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll count_neg(vector<ll> &neg, vector<ll> &pos, ll x) { // x以下の組み合わせを数え上げる ll cnt = 0; for (const auto &val : pos) { ll ng = -1; ll ok = neg.size(); auto isOK = [&](ll mid) { return val * neg[mid] > x; }; while (abs(ok - ng) > 1) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll count_neg(vector<ll> &neg, vector<ll> &pos, ll x) { // x以下の組み合わせを数え上げる ll cnt = 0; for (const auto &val : pos) { ll ng = -1; ll ok = neg.size(); auto isOK = [&](ll mid) { return val * neg[mid] > x; }; while (abs(ok - ng) > 1) ...
replace
83
85
83
85
0
p02774
C++
Runtime Error
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <clocale> #include <cmath> #include <cstdlib> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map...
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <clocale> #include <cmath> #include <cstdlib> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map...
replace
137
140
137
140
0
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 200005; int n; ll k; int a[N]; ll f(ll lim) { ll ans = 0; int neg_ptr = 0, pos_ptr = n; for (int i = 0; i < n; i++) { if (a[i] == 0) { if (lim >= 0) ans += n - 1; } else if (a[i] > 0) { while (pos_...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 200005; int n; ll k; int a[N]; ll f(ll lim) { ll ans = 0; int neg_ptr = 0, pos_ptr = n; for (int i = 0; i < n; i++) { if (a[i] == 0) { if (lim >= 0) ans += n - 1; } else if (a[i] > 0) { while (pos_...
insert
25
25
25
27
0
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, a, b) for (int i = a, i##_len = (b); i < i##_len; ++i) const int MAX_N = 200; int N; ll K; ll A[MAX_N]; const ll INF = (ll)1e18 + 1LL; bool cmp(ll a, ll b, ll X) { return a * b < X; } int b_search(ll key, ll X, bool right_true, bool (...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, a, b) for (int i = a, i##_len = (b); i < i##_len; ++i) const int MAX_N = 200100; int N; ll K; ll A[MAX_N]; const ll INF = (ll)1e18 + 1LL; bool cmp(ll a, ll b, ll X) { return a * b < X; } int b_search(ll key, ll X, bool right_true, boo...
replace
5
6
5
6
0
p02774
C++
Runtime Error
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> // #include <conio.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define rep(i, n) for (ll i = 0; i < (n); i++) #define SZ(x) ((ll)x.size()) #define pb push_back #define pf push_front #define popb pop_back #define popf pop_front #def...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> // #include <conio.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define rep(i, n) for (ll i = 0; i < (n); i++) #define SZ(x) ((ll)x.size()) #define pb push_back #define pf push_front #define popb pop_back #define popf pop_front #def...
replace
28
29
28
29
0
p02774
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; #define INF 100000000; ll n, k; int64_t intceil(int64_t a, int64_t b) { if (a >= 0) { return (a + b - 1) / b; } else { return a / b; } } int64_t intfloor(int64_t a, int64_t b) { if (a < 0) { return (a - b + ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define INF 100000000; ll n, k; int64_t intceil(int64_t a, int64_t b) { if (a >= 0) { return (a + b - 1) / b; } else { return a / b; } } int64_t intfloor(int64_t a, int64_t b) { if (a < 0) { return (a - b + 1) / b; } else { ...
delete
0
1
0
0
TLE
p02774
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define mt make_tuple #define lb lower_bound #define ub upper_bound #define f first #define s second #define resz resize #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() ...
#include <bits/stdc++.h> using namespace std; // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define mt make_tuple #define lb lower_bound #define ub upper_bound #define f first #define s second #define resz resize #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() ...
replace
254
255
254
255
TLE
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) #define de(c) cout << #c...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) #define de(c) cout << #c...
replace
31
32
31
32
0
p02774
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 1000000007, INF = 1010101010; constex...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 1000000007, INF = 1010101010; constex...
replace
74
75
74
75
0
p02774
C++
Runtime Error
/** * author: qodjf * created: 04.21.2020 23:13:45 */ #include <bits/stdc++.h> using namespace std; string to_string(string s) { return '"' + s + '"'; } string to_string(const char *s) { return to_string((string)s); } string to_string(bool b) { return (b ? "true" : "false"); } template <typename A, typen...
/** * author: qodjf * created: 04.21.2020 23:13:45 */ #include <bits/stdc++.h> using namespace std; string to_string(string s) { return '"' + s + '"'; } string to_string(const char *s) { return to_string((string)s); } string to_string(bool b) { return (b ? "true" : "false"); } template <typename A, typen...
replace
81
83
81
83
0
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; // int/long: -2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31) // long/long long: -9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 // (-2^63 <= long < 2^63) // lower_bound(A.begin(), A.end(), N) // upper_bound(... // A.erase(unique(A.begin...
#include <bits/stdc++.h> using namespace std; typedef long long ll; // int/long: -2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31) // long/long long: -9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 // (-2^63 <= long < 2^63) // lower_bound(A.begin(), A.end(), N) // upper_bound(... // A.erase(unique(A.begin...
replace
62
78
62
80
0
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, o, n) for (long long i = o; i < n; i++) #define oneforall \ ios::sync_with_stdio(false); \ cin.tie(0); #define all(v) (v).begin(), (v).end() #defi...
#include <bits/stdc++.h> using namespace std; #define FOR(i, o, n) for (long long i = o; i < n; i++) #define oneforall \ ios::sync_with_stdio(false); \ cin.tie(0); #define all(v) (v).begin(), (v).end() #defi...
replace
39
40
39
40
0
p02774
C++
Runtime Error
#include <algorithm> #include <bitset> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <unordered_map> #include <unordered_set> #include <ve...
#include <algorithm> #include <bitset> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <unordered_map> #include <unordered_set> #include <ve...
insert
54
54
54
56
0
p02774
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #...
replace
162
163
162
163
0
p02774
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, x, n) for (ll i = x; i <= n; i++) #define rep3(i, x, n) for (ll i = x; i >= n; i--) #define elif else if #define sp setprecision #define pb(x) push_back(x) typedef long long ll; typedef long double ld; typedef pa...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, x, n) for (ll i = x; i <= n; i++) #define rep3(i, x, n) for (ll i = x; i >= n; i--) #define elif else if #define sp setprecision #define pb(x) push_back(x) typedef long long ll; typedef long double ld; typedef pa...
insert
31
31
31
33
TLE
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define ff first #define ss second #define pb push_back #define pf push_front #define mp make...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define ff first #define ss second #define pb push_back #define pf push_front #define mp make...
replace
64
68
64
65
0
p02774
C++
Runtime Error
#define ENABLE_DEBUG 1 // Kana's kitchen {{{ #include <bits/stdc++.h> #define ALL(v) std::begin(v), std::end(v) #define LOOP(k) \ for (i64 ngtkana_is_a_genius = 0; ngtkana_is_a_genius < (i64)k; \ ngtkana_is_a_genius++) using i32 = std...
#define ENABLE_DEBUG 1 // Kana's kitchen {{{ #include <bits/stdc++.h> #define ALL(v) std::begin(v), std::end(v) #define LOOP(k) \ for (i64 ngtkana_is_a_genius = 0; ngtkana_is_a_genius < (i64)k; \ ngtkana_is_a_genius++) using i32 = std...
replace
96
98
96
99
0
p02774
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define LOCAL using namespace std; template <typename A, typename B> ostream &operator<<(ostream &out, const pair<A, B> &a) { out << "(" << a.first << "," << a.second << ")"; return out; } template <typename T, size_t N> ostream &operator<<(ostream &out, const array<T, N> &a) { out << "["...
#include <bits/stdc++.h> #define LOCAL using namespace std; template <typename A, typename B> ostream &operator<<(ostream &out, const pair<A, B> &a) { out << "(" << a.first << "," << a.second << ")"; return out; } template <typename T, size_t N> ostream &operator<<(ostream &out, const array<T, N> &a) { out << "["...
replace
83
84
83
84
TLE
p02774
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; int n = 0, x = 0, k = 0; int arr[200001]; vector<int> otr; vector<int> pol; vector<int> zeroes; int otr_p = 0, pol_p = 0, zero_p = 0; int pol_pol(int a, int b) { int ll = 0, rr = pol.size() - 1; while (ll < rr - 1) { int mm = (ll + rr) / 2; ...
#include <bits/stdc++.h> #define int long long using namespace std; int n = 0, x = 0, k = 0; int arr[200001]; vector<int> otr; vector<int> pol; vector<int> zeroes; int otr_p = 0, pol_p = 0, zero_p = 0; int pol_pol(int a, int b) { int ll = 0, rr = pol.size() - 1; while (ll < rr - 1) { int mm = (ll + rr) / 2; ...
insert
30
30
30
32
0
p02774
C++
Time Limit Exceeded
// #define NDEBUG #include "bits/stdc++.h" #include <array> #include <iostream> #include <random> #include <string> #include <unordered_map> #include <unordered_set> #ifdef _MSC_VER #include <ppl.h> // #include <boost/multiprecision/cpp_dec_float.hpp> // #include <boost/multiprecision/cpp_int.hpp> // #include <boost/ra...
// #define NDEBUG #include "bits/stdc++.h" #include <array> #include <iostream> #include <random> #include <string> #include <unordered_map> #include <unordered_set> #ifdef _MSC_VER #include <ppl.h> // #include <boost/multiprecision/cpp_dec_float.hpp> // #include <boost/multiprecision/cpp_int.hpp> // #include <boost/ra...
replace
339
344
339
340
TLE
p02774
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(void) { ll n, k; cin >> n >> k; vector<ll> a(n); for (auto &e : a) cin >> e; sort(a.begin(), a.end()); ll ng = 2e18, ok = -2e18; // ok譛ェ貅€縺ョ蛟区焚 < k while (ng - ok > 1) { ll m = (ok + ng) / 2; ll s = 0; fo...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(void) { ll n, k; cin >> n >> k; vector<ll> a(n); for (auto &e : a) cin >> e; sort(a.begin(), a.end()); ll ng = 2e18, ok = -2e18; // ok譛ェ貅€縺ョ蛟区焚 < k while (ng - ok > 1) { ll m = (ok + ng) / 2; ll s = 0; fo...
delete
46
47
46
46
TLE
p02774
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; typedef long long ll; typedef unsigned long lon...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; typedef long long ll; typedef unsigned long lon...
replace
75
76
75
76
TLE
p02774
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define ll long long #define ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define ll long long #define ...
replace
24
25
24
25
0
p02774
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define ff first #define ss second #define INF 1e9 // #define long long long long long long typedef long long ll; ll mod = 1e9 + 7; long long fast_exp(long long a, long long b) { if (b <= 0) return 1; else { long long...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define ff first #define ss second #define INF 1e9 // #define long long long long long long typedef long long ll; ll mod = 1e9 + 7; long long fast_exp(long long a, long long b) { if (b <= 0) return 1; else { long long...
replace
78
79
78
79
TLE
p02774
C++
Runtime Error
// Author: Vamsi Krishna Reddy Satti // With love for Competitive Programming! #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; string to_string(const string &s) { return '"' + s + '"'; } void debug_out() { cout << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail....
// Author: Vamsi Krishna Reddy Satti // With love for Competitive Programming! #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; string to_string(const string &s) { return '"' + s + '"'; } void debug_out() { cout << endl; } template <typename Head, typename... Tail> void debug_out(Head H, Tail....
replace
33
34
33
35
0
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct init_ { init_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } init_; template <class C> using iodef_rng_t = typename enable_if<decltype(declval<C>().begin(), true_type{})::value && ...
#include <bits/stdc++.h> using namespace std; struct init_ { init_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } init_; template <class C> using iodef_rng_t = typename enable_if<decltype(declval<C>().begin(), true_type{})::value && ...
replace
130
131
130
133
0
p02774
C++
Time Limit Exceeded
// Optimize #pragma GCC optimize("Ofast") // Head File #include <bits/stdc++.h> using namespace std; #define il inline // Variable #define ll long long #define ull unsigned long long #define db double #define lb long double #define ui unsigned int // Debug #define B cerr << "Break Point" << endl; #define P(x) cerr ...
// Optimize #pragma GCC optimize("Ofast") // Head File #include <bits/stdc++.h> using namespace std; #define il inline // Variable #define ll long long #define ull unsigned long long #define db double #define lb long double #define ui unsigned int // Debug #define B cerr << "Break Point" << endl; #define P(x) cerr ...
delete
136
137
136
136
TLE
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int INF = 0x3f3f3f3f; const LL mod = 1e9 + 7; const int N = 100005; int n; LL m; int a[N]; vector<LL> b, c; LL zero; bool check(LL x) { LL cnt = 0; if (x < 0) { x = -x; for (auto u : b) { LL t = (x + u - 1) / u; cnt += c....
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int INF = 0x3f3f3f3f; const LL mod = 1e9 + 7; const int N = 200005; int n; LL m; int a[N]; vector<LL> b, c; LL zero; bool check(LL x) { LL cnt = 0; if (x < 0) { x = -x; for (auto u : b) { LL t = (x + u - 1) / u; cnt += c....
replace
5
6
5
6
0
p02774
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef l...
#include <algorithm> #include <bitset> #include <climits> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef l...
insert
171
171
171
173
0
p02774
C++
Runtime Error
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; using ll = long long; long long find_min(function<bool(long long)> solve, long long low, long long high) { long long ng = low, ok = high; while (ok - ng > 1) { long long mid = (ok + ng) / 2;...
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; using ll = long long; long long find_min(function<bool(long long)> solve, long long low, long long high) { long long ng = low, ok = high; while (ok - ng > 1) { long long mid = (ok + ng) / 2;...
replace
74
78
74
81
0
p02774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; #define REP(i, n) for (ll i = 0; i < (n); ++i) ll binary_search(ll lo, ll hi, function<bool(ll)> is_ok, bool maximize) { while (lo < hi) { if (maximize) { const ll mid = (lo + hi + 1) / 2; if (is_ok(mi...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; #define REP(i, n) for (ll i = 0; i < (n); ++i) ll binary_search(ll lo, ll hi, function<bool(ll)> is_ok, bool maximize) { while (lo < hi) { if (maximize) { const ll mid = (lo + hi + 1) / 2; if (is_ok(mi...
replace
51
52
51
52
-6
97eaee68-a4be-479f-841f-fd73075030ce.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02774/C++/s904219173.cpp:53: ll floordiv(ll, ll): Assertion `x < 0 && y > 0' failed.
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; int dp[N][2]; int main() { string s; cin >> s; dp[0][0] = s[0] - '0'; dp[0][1] = 1 + 10 - s[0] + '0'; for (int i = 1; i < s.size(); i++) { int x = s[i] - '0'; dp[i][0] = min(dp[i - 1][0] + x, dp[i - 1][1] + x); dp[i][1] = min(dp...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int dp[N][2]; int main() { string s; cin >> s; dp[0][0] = s[0] - '0'; dp[0][1] = 1 + 10 - s[0] + '0'; for (int i = 1; i < s.size(); i++) { int x = s[i] - '0'; dp[i][0] = min(dp[i - 1][0] + x, dp[i - 1][1] + x); dp[i][1] = min(dp...
replace
2
3
2
3
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) typedef long long ll; int main() { string s; cin >> s; int N = s.size(); ll dp[100005][2]; dp[0][1] = 1; REP(i, N) { int num = s[i] - '0'; int num2 = 10 - num; dp[i + 1][0] = min(dp[i][0] + num, dp[i][...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) typedef long long ll; int main() { string s; cin >> s; int N = s.size(); ll dp[1000005][2]; dp[0][1] = 1; REP(i, N) { int num = s[i] - '0'; int num2 = 10 - num; dp[i + 1][0] = min(dp[i][0] + num, dp[i]...
replace
9
10
9
10
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 // #define MOD 998244353 #define INF 1145141919810893364 // #define INF 810114514 // #define PI 3.141592653589 typedef pair<int, int> PP; typedef long long ll; #define int ll #define setdouble setprecision #define REP(i, n) for (int i = 0; i < (n); ++...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 // #define MOD 998244353 #define INF 1145141919810893364 // #define INF 810114514 // #define PI 3.141592653589 typedef pair<int, int> PP; typedef long long ll; #define int ll #define setdouble setprecision #define REP(i, n) for (int i = 0; i < (n); ++...
replace
25
26
25
26
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define mod 1000000007 #define fi first #define sc second #define rep(i, x) for ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define mod 1000000007 #define fi first #define sc second #define rep(i, x) for ...
replace
24
25
24
25
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> #include <type_traits> using namespace std; using ll = int64_t; #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 ddrep(i, n) for (int i = n; i > 0; --i) #define srep(i, s, t) for (int ...
#include <bits/stdc++.h> #include <type_traits> using namespace std; using ll = int64_t; #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 ddrep(i, n) for (int i = n; i > 0; --i) #define srep(i, s, t) for (int ...
replace
53
54
53
54
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; typedef long long ll; char s[N]; ll dp[N][2]; int main() { scanf("%s", s + 1); int n = strlen(s + 1); dp[0][1] = 1000; for (int i = 1; i <= n; i++) { int x = s[i] - '0'; dp[i][0] = dp[i - 1][0] + min(x, 10 - x + 1); dp[i][0] = min(...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long ll; char s[N]; ll dp[N][2]; int main() { scanf("%s", s + 1); int n = strlen(s + 1); dp[0][1] = 1000; for (int i = 1; i <= n; i++) { int x = s[i] - '0'; dp[i][0] = dp[i - 1][0] + min(x, 10 - x + 1); dp[i][0] = min(...
replace
2
3
2
3
0
p02775
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int maxn = 105; int num[maxn]; int main() { string ss; cin >> ss; reverse(ss.begin(), ss.end()); for (int i = 1; i <= ss.length(); i++) num[i] = (ss[i - 1] - '0'); int ans = 0; for (int i = 1; i <= s...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int maxn = 1e6 + 5; int num[maxn]; int main() { string ss; cin >> ss; reverse(ss.begin(), ss.end()); for (int i = 1; i <= ss.length(); i++) num[i] = (ss[i - 1] - '0'); int ans = 0; for (int i = 1; i ...
replace
5
6
5
6
0
p02775
C++
Runtime Error
#define _LIBCPP_DEBUG 0 #include <bits/stdc++.h> using namespace std; typedef long long int ll; ll MOD = 1e9 + 7; int main(void) { string N; cin >> N; vector<int> vec(N.length()); for (ll i = 0; i < N.length(); i++) { vec[i + 1] = N[i] - '0'; } ll ans = 0; for (ll i = N.length(); i >= 0; --i) { ...
#define _LIBCPP_DEBUG 0 #include <bits/stdc++.h> using namespace std; typedef long long int ll; ll MOD = 1e9 + 7; int main(void) { string N; cin >> N; vector<int> vec(N.length() + 1); for (int i = 0; i < N.length(); i++) { vec[i + 1] = N[i] - '0'; } ll ans = 0; for (ll i = N.length(); i >= 0; --i) ...
replace
10
12
10
12
0
p02775
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef l...
#include <algorithm> #include <bitset> #include <climits> #include <complex> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef l...
replace
122
123
122
123
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 2e5 + 10; int d[N][2]; int main() { string s; cin >> s; d[0][0] = s[0] - '0'; d[0][1] = 11 - (s[0] - '0'); for (int i = 1; i < s.size(); i++) { d[i][0] = min(d[i - 1][0], d[i - 1][1]) + s[i] - '0'; d[i][1] = min(d[i - 1][...
#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 2e6 + 10; int d[N][2]; int main() { string s; cin >> s; d[0][0] = s[0] - '0'; d[0][1] = 11 - (s[0] - '0'); for (int i = 1; i < s.size(); i++) { d[i][0] = min(d[i - 1][0], d[i - 1][1]) + s[i] - '0'; d[i][1] = min(d[i - 1][...
replace
3
4
3
4
0
p02775
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return 1; } return 0; } template <class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return 1; } return 0; } const int MAX_N =...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <class T, class U> inline bool chmax(T &a, U b) { if (a < b) { a = b; return 1; } return 0; } template <class T, class U> inline bool chmin(T &a, U b) { if (a > b) { a = b; return 1; } return 0; } const int MAX_N =...
replace
17
18
17
18
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define sz(x) int(x.size()) #define show(x) \ { \ for (auto i : x) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define sz(x) int(x.size()) #define show(x) \ { \ for (auto i : x) { ...
replace
14
16
14
16
0
p02775
C++
Runtime Error
#include "bits/stdc++.h" #define FI first.first #define SE first.second #define TH second #define fi first #define se second #define th second using namespace std; class DebugStream { } LOG; template <typename T> DebugStream &operator<<(DebugStream &s, const T &) { return s; } #ifdef DEBUG #define LOG clog #endif ...
#include "bits/stdc++.h" #define FI first.first #define SE first.second #define TH second #define fi first #define se second #define th second using namespace std; class DebugStream { } LOG; template <typename T> DebugStream &operator<<(DebugStream &s, const T &) { return s; } #ifdef DEBUG #define LOG clog #endif ...
replace
24
25
24
25
0
p02775
C++
Runtime Error
#include "bits/stdc++.h" #include <random> using namespace std; typedef long long int lint; typedef pair<lint, lint> plint; typedef pair<double long, double long> pld; #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((lint)(x).size()) #define POW2(n) (1LL << (n)) #define FOR(i, begin, end) ...
#include "bits/stdc++.h" #include <random> using namespace std; typedef long long int lint; typedef pair<lint, lint> plint; typedef pair<double long, double long> pld; #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((lint)(x).size()) #define POW2(n) (1LL << (n)) #define FOR(i, begin, end) ...
replace
40
41
40
41
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; string nd; int dp[110][2]; int main() { cin >> nd; string n = "0" + nd; int nlen = n.length(); for (int i = 0; i <= nlen + 2; ++i) { for (int j = 0; j < 2; ++j) { dp[i][j] = 0; } } int now = 0; for (int i = nlen - 1; i >= 0; --i) { int ch...
#include <bits/stdc++.h> using namespace std; string nd; int dp[10000100][2]; int main() { cin >> nd; string n = "0" + nd; int nlen = n.length(); for (int i = 0; i <= nlen + 2; ++i) { for (int j = 0; j < 2; ++j) { dp[i][j] = 0; } } int now = 0; for (int i = nlen - 1; i >= 0; --i) { i...
replace
3
4
3
4
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[200]; string s; int main(void) { cin >> s; for (ll i = 0; i < s.size(); i++) { a[i + 1] = s[i] - '0'; } ll cnt = 0, f = 0; a[0] = 0; for (ll i = s.size(); i > 0; i--) { a[i] = a[i] + f; cnt += min(a[i], 10 - a[i]); if (...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[1000005]; string s; int main(void) { cin >> s; for (ll i = 0; i < s.size(); i++) { a[i + 1] = s[i] - '0'; } ll cnt = 0, f = 0; a[0] = 0; for (ll i = s.size(); i > 0; i--) { a[i] = a[i] + f; cnt += min(a[i], 10 - a[i]); ...
replace
3
4
3
4
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back typedef long long ll; typedef pair<int, int> pint; string s; int n; ll dp[1000001][2]; int main() { cin >> s; n = s.size(); reverse(s.begin(), s.end()); mems...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back typedef long long ll; typedef pair<int, int> pint; string s; int n; ll dp[1000005][2]; int main() { cin >> s; n = s.size(); reverse(s.begin(), s.end()); mems...
replace
10
11
10
11
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using int64 = long long; const int mod = 1e9 + 7; const int64 infll = (1LL << 62) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); cerr << fixed << setpre...
#include <bits/stdc++.h> using namespace std; using int64 = long long; const int mod = 1e9 + 7; const int64 infll = (1LL << 62) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); cerr << fixed << setpre...
insert
105
105
105
110
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string N; int counter = 0; int count, counter1; cin >> N; int a[N.size()]; for (int i = 0; i < N.size(); i++) { a[i] = N.at(i) - '0'; } int dp[100010][2]{}; dp[0][0] = a[0]; dp[0][1] = 11 - a[0]; for (int i = 0; i < N.size() - 1; i++)...
#include <bits/stdc++.h> using namespace std; int main() { string N; int counter = 0; int count, counter1; cin >> N; int a[N.size()]; for (int i = 0; i < N.size(); i++) { a[i] = N.at(i) - '0'; } int dp[1000010][2]{}; dp[0][0] = a[0]; dp[0][1] = 11 - a[0]; for (int i = 0; i < N.size() - 1; i++...
replace
12
13
12
13
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; int temp = 0; for (int i = S.length() - 1; i >= 0; i--) { if ((S.at(i) - '0') + temp > 5) { ans += 10 - (S.at(i) - '0' + temp); temp = 1; } else if ((S.at(i) - '0') + temp == 5) { if (S.at(i -...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; int temp = 0; for (int i = S.length() - 1; i >= 0; i--) { if ((S.at(i) - '0') + temp > 5) { ans += 10 - (S.at(i) - '0' + temp); temp = 1; } else if ((S.at(i) - '0') + temp == 5 && i > 0) { if ...
replace
11
13
11
13
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define ld long double #define mk make_pair #define fi first #define se second #define vll vector<ll> #define pii pair<ll, ll> #define vvll vector<vector<ll>> #define pb push_back #define sz...
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define ld long double #define mk make_pair #define fi first #define se second #define vll vector<ll> #define pii pair<ll, ll> #define vvll vector<vector<ll>> #define pb push_back #define sz...
replace
54
55
54
55
0
p02775
C++
Runtime Error
#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...
replace
1,203
1,204
1,203
1,204
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> #define st first #define nd second #define pb push_back #define pf push_front #define all(a) (a).begin(), (a).end() #define lwb lower_bound #define upb upper_bound #define vvll vector<vector<ll>> #define Reset(s, n) memset(s, n, sizeof(s)) #define Sz(a) int((a).size()) #define Max(a, b, c) max...
#include <bits/stdc++.h> #define st first #define nd second #define pb push_back #define pf push_front #define all(a) (a).begin(), (a).end() #define lwb lower_bound #define upb upper_bound #define vvll vector<vector<ll>> #define Reset(s, n) memset(s, n, sizeof(s)) #define Sz(a) int((a).size()) #define Max(a, b, c) max...
replace
73
74
73
74
0
Time elapsed: 0ms
p02775
C++
Runtime Error
#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>; const int INF = 1001001001; int dp[100005][2]; int main() { string s; cin >> s; reverse(s.begin(), s.end()); s += "0"; int n = s.size(); rep(i, n + 1) { rep(j, 2) d...
#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>; const int INF = 1001001001; int dp[1000005][2]; int main() { string s; cin >> s; reverse(s.begin(), s.end()); s += "0"; int n = s.size(); rep(i, n + 1) { rep(j, 2) ...
replace
7
8
7
8
0
p02775
C++
Runtime Error
#pragma region cp -helper #include <bits/stdc++.h> using namespace std; #define AC \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cou...
#pragma region cp -helper #include <bits/stdc++.h> using namespace std; #define AC \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cou...
replace
37
38
37
38
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define REP(i, s, e) for (int i = (s); i < (int)(e); i++) #define repr(i, n) REPR(i, n, 0) #define REPR(i, s, e) for (int i = (int)(s - 1); i >= (int)(e); i--) #define pb push_back #define all(r) r.begin(), r.end() #define rall(r) r.rbegin(), ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define REP(i, s, e) for (int i = (s); i < (int)(e); i++) #define repr(i, n) REPR(i, n, 0) #define REPR(i, s, e) for (int i = (int)(s - 1); i >= (int)(e); i--) #define pb push_back #define all(r) r.begin(), r.end() #define rall(r) r.rbegin(), ...
replace
25
26
25
26
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define lvector vector<ll> #define P pair<ll, ll> #define rep(i, n) for (ll(i) = 0; (i) < (n); ++(i)) #define print(a) cout << (a) << endl int main() { ios::sync_with_stdio(false); cin.tie(0); string N; cin >> N; ll ans = 0, l = N.length(); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define lvector vector<ll> #define P pair<ll, ll> #define rep(i, n) for (ll(i) = 0; (i) < (n); ++(i)) #define print(a) cout << (a) << endl int main() { ios::sync_with_stdio(false); cin.tie(0); string N; cin >> N; ll ans = 0, l = N.length(); ...
replace
15
16
15
16
0
p02775
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> using namespace std; int f[105][2], n, num; char s[105]; bool check(int num) { if (num >= 0 && num <= 9) return 1; return 0; } int main() { scanf("%s", s + 1); n = strlen(s + 1); memset(f, 0x3f3f3f3f, sizeof(f)); f[0][0] = 0; f[0][1] = 1; for ...
#include <cstdio> #include <cstring> #include <iostream> using namespace std; int f[1000005][2], n, num; char s[1000005]; bool check(int num) { if (num >= 0 && num <= 9) return 1; return 0; } int main() { scanf("%s", s + 1); n = strlen(s + 1); memset(f, 0x3f3f3f3f, sizeof(f)); f[0][0] = 0; f[0][1] = 1...
replace
4
6
4
6
0
p02775
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; int n, dp[1000001][2]; int main() { string s; cin >> s; reverse(s.begin(), s.end()); s += "0"; n = s.length(); for (int i = 0; i <= n; i++) { dp[i][0] = dp[i][1] = 1000000000; } dp[0][0] = 0; for (int i = 0; i < n; i...
#include <algorithm> #include <iostream> #include <string> using namespace std; int n, dp[1000005][2]; int main() { string s; cin >> s; reverse(s.begin(), s.end()); s += "0"; n = s.length(); for (int i = 0; i <= n; i++) { dp[i][0] = dp[i][1] = 1000000000; } dp[0][0] = 0; for (int i = 0; i < n; i...
replace
5
6
5
6
0
p02775
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define dbg(x) cerr << #x << ": " << x << endl #define all(x) (x).begin(), (x).end() int dp[100000][2]; const int INF = 1000000005; int main() { string s; cin >> s; ...
#include <algorithm> #include <iostream> #include <string> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define dbg(x) cerr << #x << ": " << x << endl #define all(x) (x).begin(), (x).end() int dp[1000100][2]; const int INF = 1000000005; int main() { string s; cin >> s;...
replace
9
10
9
10
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = b - 1; i >= a; i--) #define ALL(a) a.begin(), a.end() #define pii pair<int, int> #pragma GCC optimize("Ofast") #define pcnt __builtin_popcount #define buli(x) __builtin...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = b - 1; i >= a; i--) #define ALL(a) a.begin(), a.end() #define pii pair<int, int> #pragma GCC optimize("Ofast") #define pcnt __builtin_popcount #define buli(x) __builtin...
replace
118
119
118
119
0
p02775
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define chmin(x, y) x = min(x, y) const int INF = 1001001001; int dp[100][2]; int main() { string s; cin >> s; revers...
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define chmin(x, y) x = min(x, y) const int INF = 1001001001; int dp[1000005][2]; int main() { string s; cin >> s; re...
replace
12
13
12
13
0
p02775
C++
Runtime Error
#include <iostream> using namespace std; #define MAX 1000001 #define ll long long const ll INF = 1e18 + 7; string s; ll num[MAX], sum[MAX], dp[MAX][2]; int main() { cin >> s; s = '0' + s; int len = s.length(); for (int i = 0; i < len; ++i) { num[i] = s[i] - '0'; sum[i + 1] = sum[i] + num[i]; } fo...
#include <iostream> using namespace std; #define MAX 1000002 #define ll long long const ll INF = 1e18 + 7; string s; ll num[MAX], sum[MAX], dp[MAX][2]; int main() { cin >> s; s = '0' + s; int len = s.length(); for (int i = 0; i < len; ++i) { num[i] = s[i] - '0'; sum[i + 1] = sum[i] + num[i]; } fo...
replace
2
3
2
3
0
p02775
C++
Runtime Error
#include <algorithm> #include <functional> #include <iostream> #include <numeric> #include <tuple> #include <utility> #include <vector> template <class T, class U> inline bool chmin(T &lhs, const U &rhs) { if (lhs > rhs) { lhs = rhs; return true; } return false; } template <class T, class U> inline boo...
#include <algorithm> #include <functional> #include <iostream> #include <numeric> #include <tuple> #include <utility> #include <vector> template <class T, class U> inline bool chmin(T &lhs, const U &rhs) { if (lhs > rhs) { lhs = rhs; return true; } return false; } template <class T, class U> inline boo...
replace
65
66
65
66
0
p02775
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include ...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include ...
replace
78
79
78
79
0
p02775
C++
Runtime Error
#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; const int INF = 0x3f3f3f3f; int dp[200000][2]; int main() { string s; cin >> s; memset(dp, 0x3f, sizeof(dp)); s = "0" + s; dp[s.size()][0] = 0; for (int i = s.size...
#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; const int INF = 0x3f3f3f3f; int dp[2000000][2]; int main() { string s; cin >> s; memset(dp, 0x3f, sizeof(dp)); s = "0" + s; dp[s.size()][0] = 0; for (int i = s.siz...
replace
8
9
8
9
0
p02775
C++
Runtime Error
// atcoder/abc155/E/main.cpp // author: @___Johniel // github: https://github.com/johniel/ #include <bits/stdc++.h> #define each(i, c) for (auto &i : c) #define unless(cond) if (!(cond)) using namespace std; template <typename P, typename Q> ostream &operator<<(ostream &os, pair<P, Q> p) { os << "(" << p.first <<...
// atcoder/abc155/E/main.cpp // author: @___Johniel // github: https://github.com/johniel/ #include <bits/stdc++.h> #define each(i, c) for (auto &i : c) #define unless(cond) if (!(cond)) using namespace std; template <typename P, typename Q> ostream &operator<<(ostream &os, pair<P, Q> p) { os << "(" << p.first <<...
replace
73
74
73
74
0
p02775
C++
Runtime Error
/* AuThOr GaRyMr */ #include <bits/stdc++.h> #define rb(a, b, c) for (int a = b; a <= c; ++a) #define rl(a, b, c) for (int a = b; a >= c; --a) #define LL long long #define IT iterator #define PB push_back #define II(a, b) make_pair(a, b) #define FIR first #define SEC second #define FREO freopen("check.out", "w", stdout...
/* AuThOr GaRyMr */ #include <bits/stdc++.h> #define rb(a, b, c) for (int a = b; a <= c; ++a) #define rl(a, b, c) for (int a = b; a >= c; --a) #define LL long long #define IT iterator #define PB push_back #define II(a, b) make_pair(a, b) #define FIR first #define SEC second #define FREO freopen("check.out", "w", stdout...
replace
26
27
26
27
0
p02775
C++
Runtime Error
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define rep2...
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define rep2...
replace
129
130
129
130
0
p02775
Python
Time Limit Exceeded
s = input() keta = len(s) n = int(s) infi = 10**10 dp = [[infi] * (2) for _ in range(keta + 1)] dp[0][0] = 0 s = s[::-1] for i in range(keta): for j in range(2): num = int(s[i]) if j == 1: num += 1 ni = i + 1 if num == 10: nj = 1 num = 0 ...
s = input() keta = len(s) infi = 10**10 dp = [[infi] * (2) for _ in range(keta + 1)] dp[0][0] = 0 s = s[::-1] for i in range(keta): for j in range(2): num = int(s[i]) if j == 1: num += 1 ni = i + 1 if num == 10: nj = 1 num = 0 dp[ni][nj...
delete
2
3
2
2
TLE
p02775
C++
Time Limit Exceeded
#include <bits/stdc++.h> // #define int long long #define endl '\n' #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.ti...
#include <bits/stdc++.h> // #define int long long #define endl '\n' #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.ti...
replace
59
60
59
60
TLE
p02775
C++
Runtime Error
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <bitset> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector>...
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <bitset> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector>...
replace
48
49
48
49
0
p02775
C++
Runtime Error
// agrawal117 // chahatagrawal117 #pragma GCC optimize("O3", "unroll-loops") #pragma GCC target("avx2") #include <bits/stdc++.h> #define endl '\n' using namespace std; typedef long long int ll; #define MAX 1005 ll dp[1000009][2]; string s; ll solve(int i, int carry) { if (i < 0) return carry; if (dp[i][carry] !...
// agrawal117 // chahatagrawal117 #pragma GCC optimize("O3", "unroll-loops") #pragma GCC target("avx2") #include <bits/stdc++.h> #define endl '\n' using namespace std; typedef long long int ll; #define MAX 1005 ll dp[1000009][4]; string s; ll solve(int i, int carry) { if (i < 0) return carry; if (dp[i][carry] !...
replace
9
10
9
10
0
p02775
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; /**** Type Define ****/ typedef...
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; /**** Type Define ****/ typedef...
replace
234
236
234
236
0
p02775
C++
Runtime Error
#include <bits/extc++.h> #include <bits/stdc++.h> using namespace std; #define _rep(n, a, b) for (ll n = (a); n <= (b); ++n) #define _rev(n, a, b) for (ll n = (a); n >= (b); --n) #define _for(n, a, b) for (ll n = (a); n < (b); ++n) #define _rof(n, a, b) for (ll n = (a); n > (b); --n) #define oo 0x3f3f3f3f3f3f #define ...
#include <bits/extc++.h> #include <bits/stdc++.h> using namespace std; #define _rep(n, a, b) for (ll n = (a); n <= (b); ++n) #define _rev(n, a, b) for (ll n = (a); n >= (b); --n) #define _for(n, a, b) for (ll n = (a); n < (b); ++n) #define _rof(n, a, b) for (ll n = (a); n > (b); --n) #define oo 0x3f3f3f3f3f3f #define ...
replace
20
21
20
21
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rep2(i, m, n) for (int i = (int)m; i < (int)n; i++) #define ALL(vec) vec.begin(), vec.end() typedef long long ll; typedef long double ld; int main() { string N; cin >> N; ll n = N.size(); ll inc = 0; vect...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rep2(i, m, n) for (int i = (int)m; i < (int)n; i++) #define ALL(vec) vec.begin(), vec.end() typedef long long ll; typedef long double ld; int main() { string N; cin >> N; ll n = N.size(); ll inc = 0; vect...
replace
13
14
13
14
0
p02775
C++
Time Limit Exceeded
#include <iostream> #include <map> #include <string> #include <list> #include <map> #include <queue> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> #include <algorithm> #include <cinttypes> #include <cmath> #include <cstdlib> using namespace std; int main() { string n; cin >...
#include <iostream> #include <map> #include <string> #include <list> #include <map> #include <queue> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> #include <algorithm> #include <cinttypes> #include <cmath> #include <cstdlib> using namespace std; int main() { string n; cin >...
insert
56
56
56
57
TLE
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int uli; typedef long double Lf; typedef pair<int, int> pii; typedef vector<int> vi; #define fastIO \ std::ios::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int uli; typedef long double Lf; typedef pair<int, int> pii; typedef vector<int> vi; #define fastIO \ std::ios::sync_with_stdio(false); ...
replace
11
12
11
12
0
p02775
C++
Runtime Error
#include <memory.h> #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <uti...
#include <memory.h> #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <uti...
replace
31
32
31
32
0
p02775
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vecto...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vecto...
replace
56
57
56
57
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; string s; const int N = 1e5; int dp[2][N + 5]; int calc(int st, int pos) { if (pos == -1) return st; int &res = dp[st][pos]; if (res != -1) return res; res = 1e9; int val = s[pos] - '0'; if (st == 0) { res = min(calc(0, pos ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; string s; const int N = 1e6; int dp[2][N + 5]; int calc(int st, int pos) { if (pos == -1) return st; int &res = dp[st][pos]; if (res != -1) return res; res = 1e9; int val = s[pos] - '0'; if (st == 0) { res = min(calc(0, pos ...
replace
7
8
7
8
0
p02775
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int64_t min(int64_t a, int64_t b) { if (a > b) { return b; } else { return a; } } int main() { string str; cin >> str; while (1) { if (str.at(str.size() - 1) == '0') { str....
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int64_t min(int64_t a, int64_t b) { if (a > b) { return b; } else { return a; } } int main() { string str; cin >> str; while (1) { if (str.at(str.size() - 1) == '0') { str....
insert
29
29
29
30
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, N) for (int i = 0; i < N; i++) #define rep2(i, N) for (int i = 1; i <= N; i++) using namespace std; long long INF = 1e18; long long mod = 1e9 + 7; long long dp[100010][2]; // status unsolved long long solve(string s) { fill((long long *)dp, (long long *)dp + sizeof(dp) / size...
#include <bits/stdc++.h> #define rep(i, N) for (int i = 0; i < N; i++) #define rep2(i, N) for (int i = 1; i <= N; i++) using namespace std; long long INF = 1e18; long long mod = 1e9 + 7; long long dp[1000010][2]; // status unsolved long long solve(string s) { fill((long long *)dp, (long long *)dp + sizeof(dp) / siz...
replace
7
8
7
8
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = 2e5 + 5; string s; int dp[N][2]; int solve(int idx, int c) { if (idx < 0) return c; int &ret = dp[idx][c]; if (~ret) return ret; int cur = s[idx] - '0' + c; ret = solve(idx - 1, 0) + cur; ret = min(ret, solve(idx - 1, ...
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = 2e6 + 5; string s; int dp[N][2]; int solve(int idx, int c) { if (idx < 0) return c; int &ret = dp[idx][c]; if (~ret) return ret; int cur = s[idx] - '0' + c; ret = solve(idx - 1, 0) + cur; ret = min(ret, solve(idx - 1, ...
replace
4
5
4
5
0
p02775
C++
Runtime Error
// GYM problem J ArabellaCPC 2019 #include <bits/stdc++.h> #include <set> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, ...
// GYM problem J ArabellaCPC 2019 #include <bits/stdc++.h> #include <set> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, ...
replace
23
24
23
24
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) using P = pair<int, int>; const int INF = 1000100100; /* 大文字を小文字に変換 */ char tolower(char c) { return (c + 0x20); } /* 小文字を大文字に変換 */ char toupr(char c) { return (c - 0x20); } // if('A'<...
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) using P = pair<int, int>; const int INF = 1000100100; /* 大文字を小文字に変換 */ char tolower(char c) { return (c + 0x20); } /* 小文字を大文字に変換 */ char toupr(char c) { return (c - 0x20); } // if('A'<...
replace
25
26
25
26
0
p02775
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define all(x) x.begin(), x.end() #define fi first #define se second...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define all(x) x.begin(), x.end() #define fi first #define se second...
replace
33
34
33
34
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, o, n) for (long long i = o; i < n; i++) #define oneforall \ ios::sync_with_stdio(false); \ cin.tie(0); #define all(v) (v).begin(), (v).end() #defi...
#include <bits/stdc++.h> using namespace std; #define FOR(i, o, n) for (long long i = o; i < n; i++) #define oneforall \ ios::sync_with_stdio(false); \ cin.tie(0); #define all(v) (v).begin(), (v).end() #defi...
replace
36
37
36
37
0
p02775
C++
Runtime Error
#pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #include <algorithm> #include <assert.h> #include <bitset> #include <cfloat> #include <complex> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include...
#pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #include <algorithm> #include <assert.h> #include <bitset> #include <cfloat> #include <complex> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include...
replace
91
92
91
92
0
p02775
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #define pb push_back #define ff first #define ss second #define sz size() #define mp make_pair #define int long long int #define double long double #define bp __builtin_popcountll #define FOR(i, a, b) ...
#include <bits/stdc++.h> using namespace std; #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #define pb push_back #define ff first #define ss second #define sz size() #define mp make_pair #define int long long int #define double long double #define bp __builtin_popcountll #define FOR(i, a, b) ...
replace
15
16
15
16
0
p02775
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctype.h> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <stdi...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctype.h> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <stdi...
replace
1,047
1,048
1,047
1,048
0
p02775
C++
Runtime Error
#include <algorithm> #include <complex> #include <cstdlib> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define SAY_YES cout << "YES"...
#include <algorithm> #include <complex> #include <cstdlib> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define SAY_YES cout << "YES"...
replace
42
43
42
43
0