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
p02550
C++
Runtime Error
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define FOR(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) #define rFOR(i, a, b) for (ll i = a - 1; i >= b; i--) #define rrep(i, a) rFOR(i, a, 0) #define pb push_back using namespace std; using ll = long long; using ld = long double; typedef pair<ll...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define FOR(i, a, b) for (ll i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) #define rFOR(i, a, b) for (ll i = a - 1; i >= b; i--) #define rrep(i, a) rFOR(i, a, 0) #define pb push_back using namespace std; using ll = long long; using ld = long double; typedef pair<ll...
insert
74
74
74
75
-8
p02550
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define speed \ ios_base::sync_with_stdio(0); ...
#include <bits/stdc++.h> #include <iostream> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define speed \ ios_base::sync_with_stdio(0); ...
replace
62
63
62
63
-8
p02550
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; const ll INF = 1ll << 60; #define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define DEBUG(x) ; #d...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; const ll INF = 1ll << 60; #define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define DEBUG(x) ; #d...
insert
24
24
24
30
0
p02550
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <vector> #define llong long long #define rep(i, l, n) for (llong(i) = (l); (i) < (n); (i++)) #define _min(a, b) ((a) < (b) ? (a) : (b)) #define _max(a, b) ((a) > (b) ? (a) : (b)) #define _abs(a) ((a) > 0 ? (a) : (-(a))) using namespace...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <vector> #define llong long long #define rep(i, l, n) for (llong(i) = (l); (i) < (n); (i++)) #define _min(a, b) ((a) < (b) ? (a) : (b)) #define _max(a, b) ((a) > (b) ? (a) : (b)) #define _abs(a) ((a) > 0 ? (a) : (-(a))) using namespace...
replace
28
29
28
29
0
p02550
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <bitset> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <...
#include <algorithm> #include <array> #include <bitset> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <...
replace
335
336
335
336
TLE
p02550
C++
Runtime Error
// why tle lol #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<string> vs; typedef complex<double> pnt; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<pii, pii> pp; typedef double ld; typedef long double lld; #define ...
// why tle lol #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<string> vs; typedef complex<double> pnt; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<pii, pii> pp; typedef double ld; typedef long double lld; #define ...
replace
87
88
87
88
0
p02550
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #include <vector> using namespace std; int main() { long long n, x, m; cin >> n >> x >> m; vector<long long> id(m, -1); vector<long long> ans; long long res; long long j = 0; long long len = 0; while (id[x] == -1) { id[x] = len; ans[j] = x; x = (x ...
#include <bits/stdc++.h> #include <cmath> #include <vector> using namespace std; int main() { long long n, x, m; cin >> n >> x >> m; vector<long long> id(m, -1); vector<long long> ans; long long res; long long j = 0; long long len = 0; while (id[x] == -1) { id[x] = len; ans.push_back(x); x...
replace
16
17
16
17
-11
p02550
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #include <vector> using namespace std; int main() { long long n, x, m; cin >> n >> x >> m; vector<long long> id(m, -1); vector<long long> ans(n, 0); long long res; long long j = 0; long long len = 0; while (id[x] == -1) { id[x] = len; ans.at(j) = x; ...
#include <bits/stdc++.h> #include <cmath> #include <vector> using namespace std; int main() { long long n, x, m; cin >> n >> x >> m; vector<long long> id(m, -1); vector<long long> ans(m, 0); long long res; long long j = 0; long long len = 0; while (id[x] == -1) { id[x] = len; ans.at(j) = x; ...
replace
10
11
10
11
0
p02550
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #include <string> using namespace std; #define ll long long int #define ld long double #define pb push_back #define all(v) v.begin(), v.end() #define sz(x) ((int)(x).size()) #define fi first #define se second #define deb(x) cout << #x << '=' << x << endl #define MOD 100000000...
#include <bits/stdc++.h> #include <cmath> #include <string> using namespace std; #define ll long long int #define ld long double #define pb push_back #define all(v) v.begin(), v.end() #define sz(x) ((int)(x).size()) #define fi first #define se second #define deb(x) cout << #x << '=' << x << endl #define MOD 100000000...
replace
60
62
60
64
-8
p02550
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; typedef long long LL; LL n, x, m, a[100005], cnt, sum[100005], mpd[100005]; bool vis[100005]; int main() { scanf("%lld %lld %lld", &n, &x, &m); LL now = x; while (!vis[now]) { vis[now] = true; a[++cnt] = now; sum[cnt] = sum...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; typedef long long LL; LL n, x, m, a[100005], cnt, sum[100005], mpd[100005]; bool vis[100005]; int main() { scanf("%lld %lld %lld", &n, &x, &m); LL now = x; while (!vis[now]) { vis[now] = true; a[++cnt] = now; sum[cnt] = sum...
replace
25
29
25
28
TLE
p02550
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define per(i, n) for (int i = n - 1; i >= 0; i--) typedef long long ll; typedef pair<int, int> P; typedef pair<long long, long long> Pll; typedef vector<int> vi; typedef vector<ll> vll; const long long mod = 1000000007LL; int ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define per(i, n) for (int i = n - 1; i >= 0; i--) typedef long long ll; typedef pair<int, int> P; typedef pair<long long, long long> Pll; typedef vector<int> vi; typedef vector<ll> vll; const long long mod = 1000000007LL; int ...
replace
22
23
22
23
0
p02550
C++
Runtime Error
#include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rep1(i, n) FOR(i, 1, n + 1) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define whole(x) (x)...
#include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rep1(i, n) FOR(i, 1, n + 1) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define whole(x) (x)...
replace
63
64
63
64
0
p02550
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second typedef long long int ll; #define int long long int typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; #define INF numeric_limits<ll>::max() #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x.size()) ll pow...
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second typedef long long int ll; #define int long long int typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; #define INF numeric_limits<ll>::max() #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x.size()) ll pow...
replace
44
45
44
45
0
p02551
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> ...
replace
118
119
118
119
0
p02551
C++
Runtime Error
#include <iostream> #include <set> using namespace std; typedef long long ll; int main() { ll n; int q; cin >> n >> q; set<ll> st1, st2; st1.insert(n); st2.insert(n); ll c1[100005]{0}, c2[100005]{0}; ll ans = (n - 2) * (n - 2); while (q--) { int c; ll x; cin >> c >> x; if (c == 1) { ...
#include <iostream> #include <set> using namespace std; typedef long long ll; int main() { ll n; int q; cin >> n >> q; set<ll> st1, st2; st1.insert(n); st2.insert(n); ll c1[200005]{0}, c2[200005]{0}; ll ans = (n - 2) * (n - 2); while (q--) { int c; ll x; cin >> c >> x; if (c == 1) { ...
replace
12
13
12
13
0
p02551
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, q; struct Node { int c[N]; int sum(int x) { int res = n; while (x) { res = min(res, c[x]); x -= x & -x; } return res; } void add(int x...
#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, q; struct Node { int c[N]; int sum(int x) { int res = n; while (x) { res = min(res, c[x]); x -= x & -x; } return res; } void add(int x...
replace
5
6
5
6
0
p02551
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vll vector<ll> #define vpii vector<pair<int, int>> #define vpll vector<pair<ll, ll>> #define fr(i, k, n) for (int i = k; i < n; ++i) #define fri(i, k, n) for (int i = k;...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vll vector<ll> #define vpii vector<pair<int, int>> #define vpll vector<pair<ll, ll>> #define fr(i, k, n) for (int i = k; i < n; ++i) #define fri(i, k, n) for (int i = k;...
replace
43
44
43
44
0
p02551
C++
Runtime Error
#pragma GCC optimize(2) #pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; #define rint register int #define rep(i, l, r) for (rint i = l; i <= r; i++) #define per(i, l, r) for (rint i = l; i >= r; i--) #define ll long long #define ull unsigned long long #define pii pair<int, int> #define pll pair<ll...
#pragma GCC optimize(2) #pragma GCC optimize(3) #include <bits/stdc++.h> using namespace std; #define rint register int #define rep(i, l, r) for (rint i = l; i <= r; i++) #define per(i, l, r) for (rint i = l; i >= r; i--) #define ll long long #define ull unsigned long long #define pii pair<int, int> #define pll pair<ll...
replace
34
35
34
35
0
p02551
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #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>; int main() { int n, q; ...
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #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>; int main() { int n, q; ...
replace
28
29
28
31
TLE
p02551
C++
Runtime Error
#ifdef __LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> using namespace std; template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } #define...
#ifdef __LOCAL #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> using namespace std; template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } #define...
replace
265
266
265
267
0
p02551
C++
Runtime Error
#include <bits/stdc++.h> #define int long long #define counter(m) for (int i = 0; i < m; i++) #define gcd __gcd #define endl "\n" #define pb emplace_back #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define mod2 998244353 #define maxe *max_element #define mine...
#include <bits/stdc++.h> #define int long long #define counter(m) for (int i = 0; i < m; i++) #define gcd __gcd #define endl "\n" #define pb emplace_back #define setbits(x) __builtin_popcountll(x) #define zrobits(x) __builtin_ctzll(x) #define mod 1000000007 #define mod2 998244353 #define maxe *max_element #define mine...
replace
67
69
67
71
0
p02552
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N; cin >> N; int ans = 1 - N; cout << ans; for (long long i = 1; i < 10000000; i++) { cout << endl; } }
#include <iostream> using namespace std; int main() { int N; cin >> N; int ans = 1 - N; cout << ans; for (long long i = 1; i < 100000; i++) { cout << endl; } }
replace
8
9
8
9
TLE
p02552
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ar array #define ll long long const int MAX_N = 1e5 + 1; const int MOD = 1e9 + 7; const int INF = 1e9; const ll LINF = 1e18; void solve() {} int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("input.txt", "r", stdin); // fr...
#include <bits/stdc++.h> using namespace std; #define ar array #define ll long long const int MAX_N = 1e5 + 1; const int MOD = 1e9 + 7; const int INF = 1e9; const ll LINF = 1e18; void solve() {} int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("input.txt", "r", stdin); // fr...
replace
24
25
24
25
1
p02552
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; return !x; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << (!x) << endl; }
replace
7
8
7
8
0
p02552
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; return !x; } static int fastio = []() { #define endl '\n' ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0); return 0; }();
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << !x; } static int fastio = []() { #define endl '\n' ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0); return 0; }();
replace
6
7
6
7
0
p02552
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a; cin >> a; if (a) return 0; return 1; }
#include <iostream> using namespace std; int main() { int a; cin >> a; if (a) cout << "0" << endl; else cout << "1" << endl; return 0; }
replace
7
9
7
11
0
p02552
C++
Time Limit Exceeded
// Code by: A Gokul Karthik #include <bits/stdc++.h> #define ll long long int #define mkp make_pair #define pb push_back #define ff first #define ss second #define fast std::ios_base::sync_with_stdio(false) #define debug1(a) cout << a << endl; #define debug2(a, b) cout << a << ' ' << b << endl; #define debug3(a, b, c)...
// Code by: A Gokul Karthik #include <bits/stdc++.h> #define ll long long int #define mkp make_pair #define pb push_back #define ff first #define ss second #define fast std::ios_base::sync_with_stdio(false) #define debug1(a) cout << a << endl; #define debug2(a, b) cout << a << ' ' << b << endl; #define debug3(a, b, c)...
insert
47
47
47
48
TLE
p02552
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair using namespace std; int main() { int t = 1; // cin >> t; while (t--) { ll n; cin >> n; return n == 0; } }
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair using namespace std; int main() { int t = 1; // cin >> t; while (t--) { ll n; cin >> n; cout << (n == 0); } }
replace
12
13
12
13
0
p02552
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set...
replace
384
385
384
385
TLE
p02553
C++
Time Limit Exceeded
#include <iostream> #define ll long long using namespace std; int main() { // your code goes here ll a, b, c, d, p = -1000000000, i, j; cin >> a >> b >> c >> d; for (i = a; i <= b; i++) { for (j = c; j <= d; j++) p = max(p, i * j); } cout << p << endl; return 0; }
#include <iostream> #define ll long long using namespace std; int main() { // your code goes here ll a, b, c, d, p = -1000000000, i, j; cin >> a >> b >> c >> d; cout << max(max(a * c, a * d), max(b * c, b * d)) << endl; return 0; }
replace
8
13
8
9
TLE
p02553
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { long long a, b, c, d, i, j; cin >> a >> b >> c >> d; long long max; if (0 < a && 0 < c) { cout << b * d << endl; return 0; } else if (0 >= b && 0 >= d) { cout << a * c << endl; return 0; } else { ...
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { long long a, b, c, d, i, j; cin >> a >> b >> c >> d; long long max, max1, max2, max3, max4; max1 = a * c; max2 = a * d; max3 = b * c; max4 = b * d; max = max1; if (max < max2) max = max2; if (max < max3...
replace
8
29
8
20
TLE
p02553
C++
Time Limit Exceeded
#include <iostream> using namespace std; typedef long long LL; int main() { int l1, r1, l2, r2; cin >> l1 >> r1 >> l2 >> r2; LL res = -1e18 - 10; for (int i = l1; i <= r1; ++i) for (int j = l2; j <= r2; ++j) { res = max(res, (LL)i * j); } cout << res << endl; return 0; }
#include <iostream> using namespace std; typedef long long LL; int main() { int a, b, c, d; cin >> a >> b >> c >> d; LL ans1 = (LL)a * c; LL ans2 = (LL)a * d; LL ans3 = (LL)b * c; LL ans4 = (LL)b * d; // cout<<ans1<<" "<<ans2<<" "<<ans3<<" "<<ans4<<endl; LL ans = max(ans1, ans2); ans = max(ans, max(...
replace
6
14
6
16
TLE
p02553
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d; cin >> a >> b >> c >> d; long long ans = a * c; for (long long i = a; i <= b; i++) { for (long long j = c; j <= d; j++) { ans = max(ans, i * j); } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d; cin >> a >> b >> c >> d; long long ans; ans = max(max(max(a * c, a * d), b * c), b * d); cout << ans << endl; return 0; }
replace
5
11
5
7
TLE
p02553
C++
Time Limit Exceeded
/******************************* * BASMILLAHHIR RAHMANNIR RAHIM * * MD SHAHINUR RAHMAN * * DATE: 12/sep/2020 * * DEPT. OF CSE * * LEADING UNIVERSITY, SYLHET * *******************************/ #include <algorithm> #include <bits/stdc++.h> #include <math.h> #include <stdlib.h>...
/******************************* * BASMILLAHHIR RAHMANNIR RAHIM * * MD SHAHINUR RAHMAN * * DATE: 12/sep/2020 * * DEPT. OF CSE * * LEADING UNIVERSITY, SYLHET * *******************************/ #include <algorithm> #include <bits/stdc++.h> #include <math.h> #include <stdlib.h>...
replace
30
39
30
31
TLE
p02553
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; // Factors of an num /* vector<ll> fact(ll n){ vector<ll>v; for(int i=1;i*i<=n;i++){ if(n%i ==0){ v.push_back(i); if(i!=n/i) v.push_back(n/i); ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; // Factors of an num /* vector<ll> fact(ll n){ vector<ll>v; for(int i=1;i*i<=n;i++){ if(n%i ==0){ v.push_back(i); if(i!=n/i) v.push_back(n/i); ...
replace
96
109
96
104
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02553
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long int a, b, c, d, p, i, j; cin >> a >> b >> c >> d; p = a * c; for (i = a; i <= b; i = i + (b - a)) { for (j = c; j <= d; j = j + (d - c)) { if (p < (i * j)) p = (i * j); if (j == d) break; } } cout << p; ret...
#include <bits/stdc++.h> using namespace std; int main() { long int a, b, c, d, p, i, j; cin >> a >> b >> c >> d; p = a * c; for (i = a; i <= b; i = i + (b - a)) { for (j = c; j <= d; j = j + (d - c)) { if (p < (i * j)) p = (i * j); if (j == d) break; } if (i == b) ...
insert
13
13
13
15
TLE
p02553
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; int main() { long long a, b, c, d; cin >> a >> b >> c >> d; long long maxNum = -1000000000; for (long long x = a; x <= b; x++) { for (long long y = c; y <= d; y++) { max...
#include <algorithm> #include <cmath> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; int main() { long long a, b, c, d; cin >> a >> b >> c >> d; cout << max(max(a * c, a * d), max(b * c, b * d)) << endl; }
replace
13
20
13
14
TLE
p02553
C++
Runtime Error
#include <stdio.h> long long max(long long a, long long b, long long c, long long d) { if (a > b) { if (a > c) { if (a > d) { return a; } else { return d; } } else { if (c > d) { return c; } else { return d; } } } else { if (b > c) ...
#include <stdio.h> long long max(long long a, long long b, long long c, long long d) { if (a > b) { if (a > c) { if (a > d) { return a; } else { return d; } } else { if (c > d) { return c; } else { return d; } } } else { if (b > c) ...
replace
35
36
35
36
-11
p02553
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define f first #define s second #define sz size() #define ll long long #define all(_v) _v.begin(), _v.end() #define pii pair<int, int> #define pll pair<ll, ll> #define pvllvll pair<vector<ll>, vector<ll>> #define ld long double #de...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define f first #define s second #define sz size() #define ll long long #define all(_v) _v.begin(), _v.end() #define pii pair<int, int> #define pll pair<ll, ll> #define pvllvll pair<vector<ll>, vector<ll>> #define ld long double #de...
replace
24
43
24
32
0
p02553
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int #define FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) using namespa...
#include <bits/stdc++.h> #define ll long long int #define FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) using namespa...
replace
13
14
13
14
-6
*** stack smashing detected ***: terminated
p02553
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d, i, j, p, m, s; cin >> a >> b >> c >> d; long long h = a * c; for (i = a; i <= b; i++) { for (j = c; j <= d; j++) { p = i * j; if (p > h) { h = p; } } } cout << h; }
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d, i, j, p, m, s; cin >> a >> b >> c >> d; long long w, x, y, z; w = a * c; x = b * c; y = a * d; z = b * d; p = max(w, x); m = max(p, y); s = max(m, z); cout << s; }
replace
5
15
5
14
TLE
p02553
Python
Runtime Error
if __name__ == "__main__": a = int(input()) b = int(input()) c = int(input()) d = int(input()) if b <= 0: if d <= 0: xy = a * c elif d > 0: if c > 0: xy = b * c elif c == 0: xy = 0 elif c < 0: ...
if __name__ == "__main__": a, b, c, d = (int(x) for x in input().split()) if b <= 0: if d <= 0: xy = a * c elif d > 0: if c > 0: xy = b * c elif c == 0: xy = 0 elif c < 0: xy = a * c elif b > 0: ...
replace
1
5
1
2
ValueError: invalid literal for int() with base 10: '1 2 1 1'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02553/Python/s444735134.py", line 3, in <module> a = int(input()) ValueError: invalid literal for int() with base 10: '1 2 1 1'
p02553
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, c, d; cin >> a >> b >> c >> d; vector<long long int> v1; vector<long long int> v2; for (int i = a; i <= b; i++) { v1.push_back(i); } for (int i = c; i <= d; i++) { v2.push_back(i); } long long int res = v1[0] * v2[0...
#include <bits/stdc++.h> using namespace std; int main() { long long int a, b, c, d; cin >> a >> b >> c >> d; long long int a1 = a * c; long long int a2 = a * d; long long int a3 = b * c; long long int a4 = b * d; long long int x = max(a1, a2); long long int y = max(a3, a4); long long int z = max(x, y...
replace
5
22
5
13
TLE
p02553
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long int using namespace std; int main() { ll a[4]; while (1) { cin >> a[0] >> a[1] >> a[2] >> a[3]; vector<ll> b; b.push_back(a[0] * a[2]); b.push_back(a[0] * a[3]); b.push_back(a[1] * a[2]); b.push_back(a[1] * a[3]); sort(b.begin(), b.end()); ...
#include <bits/stdc++.h> #define ll long long int using namespace std; int main() { ll a[4]; cin >> a[0] >> a[1] >> a[2] >> a[3]; vector<ll> b; b.push_back(a[0] * a[2]); b.push_back(a[0] * a[3]); b.push_back(a[1] * a[2]); b.push_back(a[1] * a[3]); sort(b.begin(), b.end()); cout << b[3] << endl; retu...
replace
5
15
5
13
TLE
p02553
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) using P = pair<int, int>; using pq = priority_queue<int>; typedef long long ll; int main() { long a, b, c, d; long max = LONG_MIN; cin >> a >> b >> c >> d; f...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) using P = pair<int, int>; using pq = priority_queue<int>; typedef long long ll; int main() { long a, b, c, d; long max = LONG_MIN; cin >> a >> b >> c >> d; l...
replace
12
19
12
23
TLE
p02553
C++
Runtime Error
#include <bits/stdc++.h> #include <string> using namespace std; long int a, b, c, d; int solve() { long int ans = a * c; if (a * d > ans) { ans = a * d; } if (b * c > ans) { ans = b * c; } if (b * d > ans) { ans = b * d; } cout << ans; } int main() { cin >> a >> b >> c >> d; solve...
#include <bits/stdc++.h> #include <string> using namespace std; long int a, b, c, d; void solve() { long int ans = a * c; if (a * d > ans) { ans = a * d; } if (b * c > ans) { ans = b * c; } if (b * d > ans) { ans = b * d; } cout << ans; } int main() { cin >> a >> b >> c >> d; solv...
replace
7
8
7
8
0
p02553
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long a, b, c, d; cin >> a; cin >> b; cin >> c; cin >> d; return b * d; }
#include <bits/stdc++.h> using namespace std; int main() { long a, b, c, d; cin >> a; cin >> b; cin >> c; cin >> d; cout << max({a * c, b * d, a * d, b * c}) << endl; return 0; }
replace
10
11
10
12
2
p02553
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d; cin >> a >> b >> c >> d; long long ans = -1000000000000000000; for (long long i = a; i <= b; i++) { for (long long j = c; j <= d; j++) { long long cnt = i * j; ans = max(cnt, ans); } } cout << ans << en...
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d; cin >> a >> b >> c >> d; long long ans = -1000000000000000000; long long cnt[4] = {a * c, a * d, b * c, b * d}; for (long long i = 0; i < 4; i++) ans = max(ans, cnt[i]); cout << ans << endl; return 0; }
replace
10
16
10
14
TLE
p02553
C++
Time Limit Exceeded
// https://atcoder.jp/contests/abc178/tasks/abc178_b #include <iostream> #include <vector> using namespace std; #define ll long long int int main() { ll a[5], b[5], ans; cin >> a[0] >> a[1] >> b[0] >> b[1]; ll mx = (ll)(-1e10); for (ll i = a[0]; i <= a[1]; i++) { for (ll j = b[0]; j <= b[1]; j++) { an...
// https://atcoder.jp/contests/abc178/tasks/abc178_b #include <iostream> #include <vector> using namespace std; #define ll long long int int main() { ll a, b, c, d; cin >> a >> b >> c >> d; ll mx = a * c; if (a <= 0 && c <= 0) mx = max(mx, a * c); if (b >= 0 && d >= 0) mx = max(mx, b * d); mx = max(...
replace
6
15
6
15
TLE
p02553
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll a, b, c, d; cin >> a >> b >> c >> d; ll ans1 = b * d; ll ans2 = b * d; ll x = b; ll y = d; ll ans3 = a * c; while (x > a) { x--; ans1 = max(ans1, x * d); // a<x<b; c<y<d } ans1 = max(ans1, ans3); while (y > ...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll a, b, c, d; cin >> a >> b >> c >> d; ll x, y; ll maxi = -1e18; maxi = max({maxi, a * c, b * d, a * d, b * c}); cout << maxi; }
replace
6
22
6
10
TLE
p02553
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define IOS ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define IOS ...
replace
36
41
36
49
TLE
p02554
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define ll long long using namespace std; const int INF = 0x3f3f3f3f; const double pi = acos(-1.0), eps = 1e-8; const ll mod = 1e9 + 7; const i...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define ll long long using namespace std; const int INF = 0x3f3f3f3f; const double pi = acos(-1.0), eps = 1e-8; const ll mod = 1e9 + 7; const i...
replace
16
17
16
17
0
p02554
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define ls id << 1 #define rs id << 1 | 1 #define mem(array, value, size, type) \ memset(array, value, ((size) + 5) * sizeof(type)) #define memarray(array, value) memset(array, value, sizeof(array)) #define fillarray(array, value, ...
#include <bits/stdc++.h> #define ll long long #define ls id << 1 #define rs id << 1 | 1 #define mem(array, value, size, type) \ memset(array, value, ((size) + 5) * sizeof(type)) #define memarray(array, value) memset(array, value, sizeof(array)) #define fillarray(array, value, ...
replace
191
195
191
195
TLE
p02554
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long using namespace std; #define w(x) \ int x; \ cin >> x; \ while (x...
#include <bits/stdc++.h> #define ll long long using namespace std; #define w(x) \ int x; \ cin >> x; \ while (x...
replace
25
26
25
26
TLE
p02554
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 2e5 + 5; const int mod = 1e9 + 7; int n, dp[N][2][2]; void add(int &x, int y) { x += y; if (x >= mod) x -= mod; } signed main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; dp[0][0][0] = 1; f...
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e6 + 5; const int mod = 1e9 + 7; int n, dp[N][2][2]; void add(int &x, int y) { x += y; if (x >= mod) x -= mod; } signed main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; dp[0][0][0] = 1; f...
replace
6
7
6
7
0
p02554
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> #define ll long long #define IO ...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <string> #include <vector> #define ll long long #define IO ...
replace
57
63
57
61
TLE
p02554
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7, N = 1e6 + 10; ll n, f[N], po[N]; ll ksm(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } ll c(int n, int m) { return po[n] * ksm(po[m], ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7, N = 1e6 + 10; ll n, f[N], po[N]; ll ksm(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } ll c(int n, int m) { return po[n] * ksm(po[m], ...
insert
20
20
20
24
TLE
p02554
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <unordered_map> #define ull unsigned long long #define int long long #define ll long long #define fr(i, n) for (int i = 0; i < n; i++) #define frf(i, j, n) for (int i = j; i <= n; i++) #define frd(i, n) for (int i = n; i >= 0; i--) #define mp(i, j) make_pair(i, j) ...
#include <algorithm> #include <bits/stdc++.h> #include <unordered_map> #define ull unsigned long long #define int long long #define ll long long #define fr(i, n) for (int i = 0; i < n; i++) #define frf(i, j, n) for (int i = j; i <= n; i++) #define frd(i, n) for (int i = n; i >= 0; i--) #define mp(i, j) make_pair(i, j) ...
replace
76
83
76
79
TLE
p02554
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #include <unordered_map> #include <unordered_set> #define pb push_back #define mpr make_pair #define pii pair<int, int> #define pll pair<ll, ll> #define ll long long #define ld long double #define fi first #define se second #define all(arr) arr.begin(), arr.end() #define rep...
#include <bits/stdc++.h> #include <iostream> #include <unordered_map> #include <unordered_set> #define pb push_back #define mpr make_pair #define pii pair<int, int> #define pll pair<ll, ll> #define ll long long #define ld long double #define fi first #define se second #define all(arr) arr.begin(), arr.end() #define rep...
replace
41
42
41
42
0
p02554
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>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { ...
replace
80
81
80
81
0
p02554
Python
Runtime Error
import sys sys.setrecursionlimit(10**9) n = int(input()) mod = 10**9 + 7 # 再帰だとなんか通らん # dp = {} # def rec(i, zero, nine): # if (i, zero, nine) in dp: # return dp[(i, zero, nine)] # if i == n: # return 1 if (zero and nine) else 0 # ret = 0 # for j in range(10): # if j == 0: # ...
import sys sys.setrecursionlimit(10**9) n = int(input()) mod = 10**9 + 7 # 再帰だとなんか通らん # dp = {} # def rec(i, zero, nine): # if (i, zero, nine) in dp: # return dp[(i, zero, nine)] # if i == n: # return 1 if (zero and nine) else 0 # ret = 0 # for j in range(10): # if j == 0: # ...
replace
28
29
28
29
1
MemoryError During handling of the above exception, another exception occurred: MemoryError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02554/Python/s282524946.py", line 28, in <module> ...
p02554
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iostream> #include <math.h> #define ll long long int #define hell 1000000007LL using namespace std; ll power(ll x, ll y, ll z) { if (y == 0) return 1; else { ll p = power(x, y / 2, z); ll w = (p * p) % z; if (y % 2 == 0) return w; else return (x * w...
#include <bits/stdc++.h> #include <iostream> #include <math.h> #define ll long long int #define hell 1000000007LL using namespace std; ll power(ll x, ll y, ll z) { if (y == 0) return 1; else { ll p = power(x, y / 2, z); ll w = (p * p) % z; if (y % 2 == 0) return w; else return (x * w...
replace
37
39
37
38
TLE
p02555
C++
Time Limit Exceeded
/* AUTHOR: Aman Raj LANG: C++ */ using namespace std; typedef long long int ll; #include <bits/stdc++.h> // setbase - cout << setbase (16); cout << 100 << endl; Prints 64 // setfill - cout << setfill ('x') << setw (5); cout << 77 << endl; prints // xxx77 setprecision - cout << setprecision (14) << f << endl; Print...
/* AUTHOR: Aman Raj LANG: C++ */ using namespace std; typedef long long int ll; #include <bits/stdc++.h> // setbase - cout << setbase (16); cout << 100 << endl; Prints 64 // setfill - cout << setfill ('x') << setw (5); cout << 77 << endl; prints // xxx77 setprecision - cout << setprecision (14) << f << endl; Print...
insert
80
80
80
88
TLE
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define INF (1LL << 50) #define MOD 1000000007 int main() { int S; cin >> S; vector<ll> ans(S + 1); // ans[i] = ans[i-3] + ans[i-4] + ... + ans[0] // ans[i-1] = ans[i-4] + ... + ans[0]...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define INF (1LL << 50) #define MOD 1000000007 int main() { int S; cin >> S; if (S < 3) { cout << 0 << endl; return 0; } vector<ll> ans(S + 1); // ans[i] = ans[i-3] + ans[i-4] + ... +...
insert
10
10
10
14
0
p02555
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define Sort(a) sort(a.begin(), a.end()) #define Rort(a) sort(a.rbegin(), a.rend()) type...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define Sort(a) sort(a.begin(), a.end()) #define Rort(a) sort(a.rbegin(), a.rend()) type...
replace
78
82
78
84
TLE
p02555
C++
Runtime Error
/*** Template Begin ***/ #pragma region template // #define USING_BOOST #define USING_NAMESPACE #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostr...
/*** Template Begin ***/ #pragma region template // #define USING_BOOST #define USING_NAMESPACE #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostr...
insert
220
220
220
225
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MAX = 670; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MO...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MAX = 2000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % M...
replace
4
5
4
5
0
p02555
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; typedef long double ld; #define S 8005 #define M 1000000007 #define nl cout << "\n"; #define er cout << ...
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; typedef long double ld; #define S 8005 #define M 1000000007 #define nl cout << "\n"; #define er cout << ...
replace
60
66
60
64
TLE
p02555
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; const long long mod = (long long)1e9 + 7; long long binpow(long long a, long long b, long long m) { a %= m; long long res = 1; while (b > 0) { if (b & 1) res = res * a % m; a = a * a % m; b >>= 1; } return res; } // const lo...
#include <bits/stdc++.h> #include <iostream> using namespace std; const long long mod = (long long)1e9 + 7; long long binpow(long long a, long long b, long long m) { a %= m; long long res = 1; while (b > 0) { if (b & 1) res = res * a % m; a = a * a % m; b >>= 1; } return res; } // const lo...
replace
22
23
22
23
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back const int mod = 1e9 + 7; int main() { int n; cin >> n; vector<ll> dp(n + 1); dp[0] = 1; dp[1] = 0; dp[2] = 0; dp[3] = 1; for (int i = 4; i <= n; i++) { for (int j = 3; j <= i; j++) { dp[i] = (dp[i] + dp[i -...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back const int mod = 1e9 + 7; int main() { int n; cin >> n; vector<ll> dp(n + 1); if (n < 3) { cout << "0"; return 0; } dp[0] = 1; dp[1] = 0; dp[2] = 0; dp[3] = 1; for (int i = 4; i <= n; i++) { for (int j...
insert
9
9
9
13
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef pair<int, int> p; typedef long long ll; const int inf = 1000000007; int main() { int s; cin >> s; vector<ll> dp(s + 1, 0); rep(i, 3) { dp[i] = 0; dp[i + 3] = 1; } rep(i, s + 1) { if (0 <= i &...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef pair<int, int> p; typedef long long ll; const int inf = 1000000007; int main() { int s; cin >> s; if (s >= 0 && s <= 2) { cout << 0 << endl; return 0; } if (s >= 3 && s <= 5) { cout << 1 << end...
insert
12
12
12
20
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define ALL(x) (x).begin(), (x).end() #defi...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define ALL(x) (x).begin(), (x).end() #defi...
replace
32
33
32
33
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 2e2 + 2, Mod = 1e9 + 7; long long int dp[N]; int s; long long calc(long long sum) { // cout<<1; if (sum == s) return 1; if (sum > s) return 0; long long &ret = dp[sum]; if (ret != -1) return ret; ret = 0; bool z = 0, n = 0; for (int...
#include <bits/stdc++.h> using namespace std; const int N = 2e3 + 2, Mod = 1e9 + 7; long long int dp[N]; int s; long long calc(long long sum) { // cout<<1; if (sum == s) return 1; if (sum > s) return 0; long long &ret = dp[sum]; if (ret != -1) return ret; ret = 0; bool z = 0, n = 0; for (int...
replace
2
3
2
3
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0, xxx_rep_end = (n); i < xxx_rep_end; ++i) #define all(x) (x).begin(), (x).end() template <class T1, class T2> inline bool chmax(T1 &a, const T2 &b) { if (a < b) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0, xxx_rep_end = (n); i < xxx_rep_end; ++i) #define all(x) (x).begin(), (x).end() template <class T1, class T2> inline bool chmax(T1 &a, const T2 &b) { if (a < b) { ...
replace
31
32
31
32
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define mp make_pair #define ll long long #define pb push_back void solve() { long long s; cin >> s; vector<long long> dp(s + 1, 0LL); int i, j; long long hell = 1e9 + 7; dp[3] = 1; dp[4] = 1; dp[5] = 1; for (i = 6; i <...
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define mp make_pair #define ll long long #define pb push_back void solve() { long long s; cin >> s; vector<long long> dp(s + 1, 0LL); int i, j; long long hell = 1e9 + 7; if (s <= 2) { cout << 0 << endl; return; } ...
insert
16
16
16
25
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll s = 0; cin >> s; vector<ll> dp(s + 1, 0); dp[3] = 1; for (int i = 4; i <= s; i++) dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007; cout << dp[s] << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll s = 0; cin >> s; vector<ll> dp(2001, 0); dp[3] = 1; for (int i = 4; i <= s; i++) dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007; cout << dp[s] << endl; return 0; }
replace
7
8
7
8
0
p02555
C++
Runtime Error
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> // #include <atcoder/all> // using namespace atcoder; using namespace std; #define all(v) v.begin(), v.end() using in = int64_t; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define Yes cout << "Yes...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> // #include <atcoder/all> // using namespace atcoder; using namespace std; #define all(v) v.begin(), v.end() using in = int64_t; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define Yes cout << "Yes...
replace
30
31
30
31
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> #ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG #endif using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = s; i < (int)(n); i++) typedef long long ll; template <ll mod> struct Fp { ll x; constexpr Fp(ll x = 0) noexcept : x((x % mod + mod...
#include <bits/stdc++.h> #ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG #endif using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = s; i < (int)(n); i++) typedef long long ll; template <ll mod> struct Fp { ll x; constexpr Fp(ll x = 0) noexcept : x((x % mod + mod...
insert
200
200
200
204
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<long> dp(N + 1, 0); dp.at(1) = 0; dp.at(2) = 0; dp.at(3) = 1; dp.at(4) = 1; dp.at(5) = 1; for (int i = 6; i <= N; i++) { // int l=i/2; for (int j = 3; j <= i - 3; j++) { dp.at(i) += dp.at(i - j); dp...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<long> dp(N + 1, 0); for (int i = 3; i <= N; i++) { // int l=i/2; for (int j = 3; j <= i - 3; j++) { dp.at(i) += dp.at(i - j); dp.at(i) %= 1000000007; } dp.at(i)++; } cout << dp.at(N) << endl; }
replace
7
13
7
8
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long calc(long n, vector<long> &dp, long mod) { if (n < 3) return 0; if (dp[n] != 0) return dp[n]; for (int i = 3; i <= n; i++) { if (n != i) dp[n] += calc(n - i, dp, mod); else dp[n]++; dp[n] %= mod; } dp[n] %= mod; return dp[...
#include <bits/stdc++.h> using namespace std; long calc(long n, vector<long> &dp, long mod) { if (n < 3) return 0; if (dp[n] != 0) return dp[n]; for (int i = 3; i <= n; i++) { if (n != i) dp[n] += calc(n - i, dp, mod); else dp[n]++; dp[n] %= mod; } dp[n] %= mod; return dp[...
replace
26
27
26
28
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* ll gcds(ll a,ll b){ if(a<b){ swap(a,b); } ll r=a%b; if(r==0){ return b; } while(r>0){ r=a%b; a=b; b=r; } return a; } ll lcms(ll a,ll b){ ll mmr=gcds(a,b); a=a/mmr; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* ll gcds(ll a,ll b){ if(a<b){ swap(a,b); } ll r=a%b; if(r==0){ return b; } while(r>0){ r=a%b; a=b; b=r; } return a; } ll lcms(ll a,ll b){ ll mmr=gcds(a,b); a=a/mmr; ...
replace
85
92
85
96
0
p02555
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define sz(v) (int)v.size() #define all(v) v.begin(), v.end() #define dbg(x) cerr << #x << " is " << x << "\n"; using ll = long long; using ii = pair<ll, ll>; const int S = 2005; const int N = 670; const int MOD = 1...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define sz(v) (int)v.size() #define all(v) v.begin(), v.end() #define dbg(x) cerr << #x << " is " << x << "\n"; using ll = long long; using ii = pair<ll, ll>; const int S = 2005; const int N = 670; const int MOD = 1...
replace
24
29
24
36
TLE
p02555
C++
Runtime Error
#include <iostream> using namespace std; int dp(int n, int m[]) { if (m[n - 3] == 0) dp(n - 3, m); if (m[n - 1] == 0) dp(n - 1, m); m[n] = (m[n - 3] + m[n - 1]) % 1000000007; } int main() { int nom[2000] = { 0, }; nom[3] = nom[4] = nom[5] = 1; int n; cin >> n; if (n < 6) cout << no...
#include <iostream> using namespace std; int dp(int n, int m[]) { if (m[n - 3] == 0) dp(n - 3, m); if (m[n - 1] == 0) dp(n - 1, m); m[n] = (m[n - 3] + m[n - 1]) % 1000000007; return 0; } int main() { int nom[2000] = { 0, }; nom[3] = nom[4] = nom[5] = 1; int n; cin >> n; if (n < 6) ...
insert
9
9
9
10
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define INF 999999999 #define rep(i, n) for (int i = 0; i < n; i++) const ll MOD = 1000000007; ll cnt = 0, ans = 0; const int MAX = 510000; ll move(ll n) { ll a[n + 1]; a[0] = 1; a[1] = 0; a[2] = 0; a[3] = 1; for (int i = 4; i <= n; i++) {...
#include <bits/stdc++.h> using namespace std; #define ll long long #define INF 999999999 #define rep(i, n) for (int i = 0; i < n; i++) const ll MOD = 1000000007; ll cnt = 0, ans = 0; const int MAX = 510000; ll move(ll n) { ll a[n + 10]; a[0] = 1; a[1] = 0; a[2] = 0; a[3] = 1; for (int i = 4; i <= n; i++) ...
replace
10
11
10
11
0
p02555
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; using ll = long long; int main() { ll MOD = 1e9 + 7; int S; cin >> S; vector<ll> ans(S + 1, 0); ans[3] = 1; for (int i = 4; i <= S; i++) { ans[i] = (ans[i - 1] + ans[i - 3]) % MOD; } cout << ans[S] << endl; return 0; }
#include <iostream> #include <vector> using namespace std; using ll = long long; int main() { ll MOD = 1e9 + 7; int S; cin >> S; vector<ll> ans(S + 1, 0); ans[0] = 1; for (int i = 3; i <= S; i++) { ans[i] = (ans[i - 1] + ans[i - 3]) % MOD; } cout << ans[S] << endl; return 0; }
replace
10
12
10
12
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int N; cin >> N; vector<long long> S(N); S.at(2) = 1; if (N >= 4) { for (int i = 3; i < N; i++) { S.at(i) = S.at(i - 1) + S.at(i - 3); S.at(i) %= 1000000007; } } cout << S.at(N - 1...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int N; cin >> N; vector<long long> S(N); if (N >= 3) { S.at(2) = 1; if (N >= 4) { for (int i = 3; i < N; i++) { S.at(i) = S.at(i - 1) + S.at(i - 3); S.at(i) %= 1000000007; ...
replace
8
13
8
15
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int inf = 1000000000; const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; const ll mod = 1e9 + 7; ll solve(ll a) { if (a == 0) { return 1; } else if (a == 1 || a == 2) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int inf = 1000000000; const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; const ll mod = 1e9 + 7; ll solve(ll a) { if (a == 0) { return 1; } else if (a == 1 || a == 2) { ...
replace
28
30
28
30
0
p02555
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll int int const MOD = 1e9 + 7; #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(N...
#include <bits/stdc++.h> #define ll int int const MOD = 1e9 + 7; #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(N...
replace
19
20
19
20
TLE
p02555
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; const int mod = 1000000007; int main() { int s; cin >> s; vector<ll> dp(s + 1); dp[0] = 1; dp[1] = 0; dp[2] = 0; for (int i = 3; i <= s; i++) { dp[i] = dp[i - 1...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; const int mod = 1000000007; int main() { int s; cin >> s; vector<ll> dp(s + 1); dp[0] = 1; for (int i = 3; i <= s; i++) { dp[i] = dp[i - 1] + dp[i - 3]; dp[i] %...
delete
14
16
14
14
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; #define F(i, a, n) for (int i = a; i < n; i++) #define mod 1000000007 #define pb push_back int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #e...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; #define F(i, a, n) for (int i = a; i < n; i++) #define mod 1000000007 #define pb push_back int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #e...
replace
18
19
18
19
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02555
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #include <string> #define ll long long int #define ld long double #define pb push_back #define endl "\n" #define mp make_pair #define sz(v) (int)(v.size()) #define len(s) (int)(s.length()) #define M (ll)(1e9 + 7) #define all(v) v.begin(), v.end() #define fr(a, b, c) for (ll ...
#include <bits/stdc++.h> #include <iostream> #include <string> #define ll long long int #define ld long double #define pb push_back #define endl "\n" #define mp make_pair #define sz(v) (int)(v.size()) #define len(s) (int)(s.length()) #define M (ll)(1e9 + 7) #define all(v) v.begin(), v.end() #define fr(a, b, c) for (ll ...
replace
60
61
60
61
-6
double free or corruption (!prev)
p02555
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define MOD 1000000007 using namespace std; int main() { ll n; cin >> n; ll dp[n + 1]; dp[0] = 0; dp[1] = 0; dp[2] = 0; dp[3] = 1; for (ll i = 4; i <= n; i++) { dp[i] = 1; for (ll j = 3; j <= i - 3; j++) { dp[i] += dp[j]; dp[i] %= MOD; ...
#include <bits/stdc++.h> #define ll long long #define MOD 1000000007 using namespace std; int main() { ll n; cin >> n; ll dp[2001]; dp[0] = 0; dp[1] = 0; dp[2] = 0; dp[3] = 1; for (ll i = 4; i <= n; i++) { dp[i] = 1; for (ll j = 3; j <= i - 3; j++) { dp[i] += dp[j]; dp[i] %= MOD; ...
replace
7
8
7
8
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> #define rep(X, N) for (ll X = 0LL; X < (N); X++) #define ALL(V) (V).begin(), (V).end() #define endl "\n" using namespace std; typedef unsigned int uint; typedef long long ll; typedef unsigned long long ull; const double PI = 3.1415926535897932384626; const ll MODN = 1000000007; const ll MODN...
#include <bits/stdc++.h> #define rep(X, N) for (ll X = 0LL; X < (N); X++) #define ALL(V) (V).begin(), (V).end() #define endl "\n" using namespace std; typedef unsigned int uint; typedef long long ll; typedef unsigned long long ull; const double PI = 3.1415926535897932384626; const ll MODN = 1000000007; const ll MODN...
replace
147
148
147
148
-6
malloc(): corrupted top size
p02555
C++
Runtime Error
#include <iostream> #include <vector> typedef long long ll; const ll m = 1e9 + 7; int main(int argc, char **argv) { int S; std::cin >> S; std::vector<ll> A(S + 1, 0); A[3] = 1; for (int i = 4; i < S + 1; i++) { A[i] = A[i - 3] + A[i - 1]; A[i] %= m; } std::cout << A[S] << std::endl; }
#include <iostream> #include <vector> typedef long long ll; const ll m = 1e9 + 7; int main(int argc, char **argv) { int S; std::cin >> S; std::vector<ll> A(2001, 0); A[3] = 1; for (int i = 4; i < S + 1; i++) { A[i] = A[i - 3] + A[i - 1]; A[i] %= m; } std::cout << A[S] << std::endl; }
replace
10
11
10
11
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long int dp[2005]; int main() { int s; scanf("%d", &s); dp[0] = 1; dp[1] = dp[2] = 0; for (int a = 0; a <= s; a++) { for (int b = 3; b <= s; b++) { (dp[a + b] += dp[a]) %= mod; } } printf("%lld ", dp[s]); }
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long int dp[2005]; int main() { int s; scanf("%d", &s); dp[0] = 1; dp[1] = dp[2] = 0; for (int a = 0; a <= s; a++) { for (int b = 3; b <= s; b++) { if (a + b <= s) (dp[a + b] += dp[a]) %= mod; } } printf("%...
replace
13
14
13
15
0
p02555
C++
Runtime Error
/*/ Author: KaySeeKay /*/ #include <bits/stdc++.h> using namespace std; /*/---------------------------Defines-----------------------------------------/*/ #pragma GCC optimize("Ofast") #define int long long #define IOS \ ios_base::sync_with_stdio(fa...
/*/ Author: KaySeeKay /*/ #include <bits/stdc++.h> using namespace std; /*/---------------------------Defines-----------------------------------------/*/ #pragma GCC optimize("Ofast") #define int long long #define IOS \ ios_base::sync_with_stdio(fa...
replace
98
99
98
100
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02555
C++
Time Limit Exceeded
#pragma GCC optimize("O3") #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <list> #include <map> #include <numeric> #...
#pragma GCC optimize("O3") #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <istream> #include <iterator> #include <list> #include <map> #include <numeric> #...
replace
97
100
97
99
TLE
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int s; const int MOD = 1e9 + 7; cin >> s; vector<int> dp(s, 0); dp[0] = 1; for (int i = 3; i <= s; i++) for (int j = 3; j <= i; j++) dp[i] = (dp[i] + dp[i - j]) % MOD; cout << dp[...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int s; const int MOD = 1e9 + 7; cin >> s; vector<int> dp(s + 1, 0); dp[0] = 1; for (int i = 3; i <= s; i++) for (int j = 3; j <= i; j++) dp[i] = (dp[i] + dp[i - j]) % MOD; cout <<...
replace
11
12
11
12
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int ll mod = 1000000007; int main() { ios::sync_with_stdio(false); cin.tie(NULL); ll s; cin >> s; ll dp[s + 1], cum[s + 1]; dp[0] = 0; dp[1] = 0; dp[2] = 0; dp[3] = 1; cum[0] = 0; cum[1] = 0; cum[2] = 0; cum[3] = 1; for (...
#include <bits/stdc++.h> using namespace std; #define ll long long int ll mod = 1000000007; int main() { ios::sync_with_stdio(false); cin.tie(NULL); ll s; cin >> s; ll dp[s + 2], cum[s + 2]; dp[0] = 0; dp[1] = 0; dp[2] = 0; dp[3] = 1; cum[0] = 0; cum[1] = 0; cum[2] = 0; cum[3] = 1; for (...
replace
13
14
13
14
0
p02555
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #pragma region // {{{ #define all(x) std::begin(x), std::end(x) #define rall(x) std::rbegin(x), std::rend(x) #define rep(i, begin, end) \ for (int64_t i{begin}, i##_end{end}; i < i##_end; ++i) #define repc(i, begin, la...
#include <bits/stdc++.h> using namespace std; #pragma region // {{{ #define all(x) std::begin(x), std::end(x) #define rall(x) std::rbegin(x), std::rend(x) #define rep(i, begin, end) \ for (int64_t i{begin}, i##_end{end}; i < i##_end; ++i) #define repc(i, begin, la...
replace
74
75
74
78
0