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
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; const ld PI = acos(-1); const ld EPS = 0.0000000001; const ll LINF = 1001002003004005006ll; const int INF = 1001001001; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define repd(i, n) for (ll i =...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; const ld PI = acos(-1); const ld EPS = 0.0000000001; const ll LINF = 1001002003004005006ll; const int INF = 1001001001; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define repd(i, n) for (ll i =...
replace
43
44
43
45
TLE
p02580
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { using coord = pair<int, int>; int H, W, M; cin >> H >> W >> M; set<coord> targets; int x, y; for (int i = 0; i < M; i++) { cin >> x >> y; x--; y--; // 1-indexed -> 0-indexed targets.insert(make_pair(x, y)); } vector<int> Nrow(...
#include <bits/stdc++.h> using namespace std; int main() { using coord = pair<int, int>; int H, W, M; cin >> H >> W >> M; set<coord> targets; int x, y; for (int i = 0; i < M; i++) { cin >> x >> y; x--; y--; // 1-indexed -> 0-indexed targets.insert(make_pair(x, y)); } vector<int> Nrow(...
replace
52
53
52
53
0
p02580
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #include <cmath> #include <complex> #include <cstdint> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #include <cmath> #include <complex> #include <cstdint> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include...
insert
140
140
140
145
TLE
p02580
C++
Time Limit Exceeded
// AtCoder template #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) int main() { cin.tie(0); ios::sync_with_stdio(false); map<pair<int, int>, int> mp; int h, w, m; cin >> h >> w >> m; vector<pair<int, int>> row(h), col(w); rep(i, h) row[...
// AtCoder template #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) int main() { cin.tie(0); ios::sync_with_stdio(false); map<pair<int, int>, int> mp; int h, w, m; cin >> h >> w >> m; vector<pair<int, int>> row(h), col(w); rep(i, h) row[...
replace
41
43
41
42
TLE
p02580
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set \ tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> using namespace std; using namespace __gnu_pbds; typedef...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set \ tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> using namespace std; using namespace __gnu_pbds; typedef...
replace
116
119
116
121
0
p02580
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; ll H, W, M; ll Y[1005]; ll X[1005]; int main() { cin >> H >> W >> M; vector<P> A(M); for (ll i = 0; i < M; i++) { ll y, x; cin >> y >> x; P p(y, x); A[i] = p; Y[y]++; X[x]++; } ll ymax = 0; ll...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; ll H, W, M; ll Y[300005]; ll X[300005]; int main() { cin >> H >> W >> M; vector<P> A(M); for (ll i = 0; i < M; i++) { ll y, x; cin >> y >> x; P p(y, x); A[i] = p; Y[y]++; X[x]++; } ll ymax = 0; ...
replace
5
7
5
7
0
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9 + 7; const long long LINF = 1e18; #define dump(x) cout << 'x' << ' = ' << (x) << ` `; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREACH(x, ...
#include <bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9 + 7; const long long LINF = 1e18; #define dump(x) cout << 'x' << ' = ' << (x) << ` `; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREACH(x, ...
insert
104
104
104
106
TLE
p02580
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 MAXX 2...
#include <bits/stdc++.h> using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define MAXX 5...
replace
8
9
8
9
0
p02580
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #def...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #def...
replace
54
55
54
55
0
p02580
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1000000007 using namespace std; int main() { long H, W, m; cin >> H >> W >> m; vector<pair<long, long>> hw; vector<long> hi(H), wi(W); rep(i, int(hi.size())) { hi[i] = 0; wi[i] = 0; } long h1, w1; rep(i, m) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1000000007 using namespace std; int main() { long H, W, m; cin >> H >> W >> m; vector<pair<long, long>> hw; vector<long> hi(H), wi(W); rep(i, int(hi.size())) hi[i] = 0; rep(i, int(wi.size())) wi[i] = 0; long h1, w1; rep(...
replace
10
14
10
12
0
p02580
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define INF 1e12 #define PB push_back #define PF push_front #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vpi vector<pii> #define vll vector<ll> #define vp...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define INF 1e12 #define PB push_back #define PF push_front #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vpi vector<pii> #define vll vector<ll> #define vp...
replace
71
72
71
72
0
p02580
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define MOD (1000000000 + 7) using namespace std; typedef long long ll; const int MAX = 3000000; long...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define MOD (1000000000 + 7) using namespace std; typedef long long ll; const int MAX = 3000000; long...
replace
269
279
269
280
TLE
p02580
C++
Runtime Error
#include <bits/stdc++.h> // ver2.7.1 #define int long long // #define endl "\n" // fflush(stdout); #define ALL(v) (v).begin(), (v).end() #define Vi vector<int> #define VVi vector<Vi> #define VVVi vector<VVi> #define Vm vector<mint> #define Vs vector<string> #define Vd vector<double> #define Vc vector<char> #define Pii ...
#include <bits/stdc++.h> // ver2.7.1 #define int long long // #define endl "\n" // fflush(stdout); #define ALL(v) (v).begin(), (v).end() #define Vi vector<int> #define VVi vector<Vi> #define VVVi vector<VVi> #define Vm vector<mint> #define Vs vector<string> #define Vd vector<double> #define Vc vector<char> #define Pii ...
replace
249
250
249
250
0
p02580
C++
Runtime Error
#include <cmath> #include <iostream> using namespace std; typedef long long ll; int main() { const int SIZE = 30010; int H, W, M, h[SIZE], w[SIZE], x[SIZE], y[SIZE]; cin >> H >> W >> M; for (int i = 1; i <= H; ++i) { x[i] = 0; } for (int i = 1; i <= W; ++i) { y[i] = 0; } for (int i = 0; i < M; ...
#include <cmath> #include <iostream> using namespace std; typedef long long ll; int main() { const int SIZE = 300010; int H, W, M, h[SIZE], w[SIZE], x[SIZE], y[SIZE]; cin >> H >> W >> M; for (int i = 1; i <= H; ++i) { x[i] = 0; } for (int i = 1; i <= W; ++i) { y[i] = 0; } for (int i = 0; i < M;...
replace
6
7
6
7
0
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
insert
49
49
49
51
TLE
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--) const int dx[4] = {1, 0, -1, 0...
insert
60
60
60
62
TLE
p02580
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int h, w, m, sz; vector<int> ob[300005]; int dat[400005]; void upd(int pos, int val) { pos += sz - 1; dat[pos] += val; while (pos > 1) { pos >>= 1; dat[pos] = max(dat[pos << 1], dat[pos << 1 | 1]); } } int qry(int bk, int l, int r, int ql, int qr) { if...
#include <bits/stdc++.h> using namespace std; int h, w, m, sz; vector<int> ob[300005]; int dat[1200005]; void upd(int pos, int val) { pos += sz - 1; dat[pos] += val; while (pos > 1) { pos >>= 1; dat[pos] = max(dat[pos << 1], dat[pos << 1 | 1]); } } int qry(int bk, int l, int r, int ql, int qr) { i...
replace
6
7
6
7
0
p02580
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { #define int long long int H, W, M; cin >> H >> W >> M; vector<vector<int>> G(H, vector<int>(W, 0)); vector<int> hh(H); vector<int> ww(W); vector<pair<int, int>> memo(M); for (int i = 0; i < M; i++) { int a, b; cin >> a >> b; a--; b...
#include <bits/stdc++.h> using namespace std; int main() { #define int long long int H, W, M; cin >> H >> W >> M; vector<int> hh(H); vector<int> ww(W); vector<pair<int, int>> memo(M); for (int i = 0; i < M; i++) { int a, b; cin >> a >> b; a--; b--; memo.at(i) = make_pair(a, b); hh.at...
delete
6
7
6
6
0
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; int main() { int h, w, m; cin >> h >> w >> m; // vector<vi> masu(h,vi(w,0)); map<pair<int, int>, int> mp; vi tate_count(h, 0); vi yoko_count(w, 0); for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; int main() { int h, w, m; cin >> h >> w >> m; // vector<vi> masu(h,vi(w,0)); map<pair<int, int>, int> mp; vi tate_count(h, 0); vi yoko_count(w, 0); for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; ...
insert
41
41
41
45
TLE
p02580
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; int main() { int h, w, n; cin >> h >> w >> n; vector<int> hs(h), ws(w); set<P> s; rep(i, n) { int r, c; cin >> r >> c; r--; c--; hs[r]++; ws[c]...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; int main() { int h, w, n; cin >> h >> w >> n; vector<int> hs(h), ws(w); set<P> s; rep(i, n) { int r, c; cin >> r >> c; r--; c--; hs[r]++; ws[c]...
replace
26
27
26
27
0
p02580
C++
Time Limit Exceeded
#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
47
49
47
53
TLE
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } else { return false; } } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } else { return false; } } #define ll long long #define double lon...
#include <bits/stdc++.h> template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } else { return false; } } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } else { return false; } } #define ll long long #define double lon...
replace
46
49
46
52
TLE
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define fi first #define se second #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep2(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define rev(i, n) for (int(i) = (n)-1; (i) >= 0; (i)--) #define rev2(i, a, b) for (int(i) = (a)-1; (i) >= (b); (i)--) #define rng(a) a.begin(), a.en...
#include <bits/stdc++.h> #define fi first #define se second #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep2(i, a, b) for (int(i) = (a); (i) < (b); (i)++) #define rev(i, n) for (int(i) = (n)-1; (i) >= 0; (i)--) #define rev2(i, a, b) for (int(i) = (a)-1; (i) >= (b); (i)--) #define rng(a) a.begin(), a.en...
replace
76
77
76
77
TLE
p02580
C++
Runtime Error
//*************************************JAI SAI //RAM*************************************// #include <bits/stdc++.h> using namespace std; typedef long long int ll; #define endl '\n' ll mat[3000001], vis[3000001], parent[1000001], ranks[1000001]; ll P = 998244353; vector<pair<ll, ll>> path = {{1, 0}, {0, 1}, {-1, 0}, {0...
//*************************************JAI SAI //RAM*************************************// #include <bits/stdc++.h> using namespace std; typedef long long int ll; #define endl '\n' ll mat[3000001], vis[3000001], parent[1000001], ranks[1000001]; ll P = 998244353; vector<pair<ll, ll>> path = {{1, 0}, {0, 1}, {-1, 0}, {0...
delete
36
37
36
36
0
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, nu...
#include <bits/stdc++.h> using namespace std; #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<int, nu...
insert
53
53
53
67
TLE
p02580
C++
Time Limit Exceeded
// #define _GLIBCXX_DEBUG #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 rep(i, n) for (int...
// #define _GLIBCXX_DEBUG #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 rep(i, n) for (int...
insert
67
67
67
71
TLE
p02580
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define f first #define se second #define pb push_back #define ms memset #define MOD 1000000007 #define MOD2 1000000009 #define sp fixed << setprecision #define sz(x) (int)(x).size() #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend()...
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define f first #define se second #define pb push_back #define ms memset #define MOD 1000000007 #define MOD2 1000000009 #define sp fixed << setprecision #define sz(x) (int)(x).size() #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend()...
replace
91
98
91
120
TLE
p02580
C++
Runtime Error
#include <algorithm> #include <iostream> #include <set> #include <string> #include <vector> #define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i) #define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long;...
#include <algorithm> #include <iostream> #include <set> #include <string> #include <vector> #define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i) #define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long;...
replace
67
68
67
73
0
p02581
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, x[6005], y[2005][2005], add, ans, mx[2005], mxx; int main() { scanf("%d", &n); for (int i = 0; i < n * 3; i++) scanf("%d", x + i); for (int i = 1; i <= n; i++) { mx[i] = INT_MIN; for (int j = 1; j <= n; j++) y[i][j] = INT_MIN; } mx[x[0]...
#include <bits/stdc++.h> using namespace std; int n, x[6005], y[2005][2005], add, ans, mx[2005], mxx; int main() { scanf("%d", &n); for (int i = 0; i < n * 3; i++) scanf("%d", x + i); for (int i = 1; i <= n; i++) { mx[i] = INT_MIN; for (int j = 1; j <= n; j++) y[i][j] = INT_MIN; } mx[x[0]...
replace
37
39
37
39
0
p02581
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; using VI = vector<int>; using VVI = vector<VI>; inline int getBlockStart(int npos, int bakPos) { int n...
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; using VI = vector<int>; using VVI = vector<VI>; inline int getBlockStart(int npos, int bakPos) { int n...
replace
85
87
85
87
0
p02581
C++
Time Limit Exceeded
#line 2 "header.hpp" //%snippet.set('header')% //%snippet.fold()% #ifndef HEADER_H #define HEADER_H // template version 2.0 using namespace std; #include <bits/stdc++.h> // varibable settings const long long INF = 1e18; template <class T> constexpr T inf = numeric_limits<T>::max() / 2.1; #define _overload3(_1, _2, ...
#line 2 "header.hpp" //%snippet.set('header')% //%snippet.fold()% #ifndef HEADER_H #define HEADER_H // template version 2.0 using namespace std; #include <bits/stdc++.h> // varibable settings const long long INF = 1e18; template <class T> constexpr T inf = numeric_limits<T>::max() / 2.1; #define _overload3(_1, _2, ...
insert
138
138
138
139
TLE
p02581
C++
Runtime Error
#include <bits/stdc++.h> #define ln '\n' #define all(dat) dat.begin(), dat.end() #define loop(i, to) for (int i = 0; i < to; ++i) #define cont(i, to) for (int i = 1; i <= to; ++i) #define circ(i, fm, to) for (int i = fm; i <= to; ++i) #define foreach(i, dat) \ ...
#include <bits/stdc++.h> #define ln '\n' #define all(dat) dat.begin(), dat.end() #define loop(i, to) for (int i = 0; i < to; ++i) #define cont(i, to) for (int i = 1; i <= to; ++i) #define circ(i, fm, to) for (int i = fm; i <= to; ++i) #define foreach(i, dat) \ ...
replace
17
18
17
18
0
p02582
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <iomanip> using namespace std; #define ll long long int #define mod 1000000007 #define vec vector<long long int> #define fi first #define se second #define pb push_back int main() { string a; cin >> a; int count = 0; int i = 0; while (i < 3) { if (a[i] == 'R') { co...
#include <bits/stdc++.h> #include <iomanip> using namespace std; #define ll long long int #define mod 1000000007 #define vec vector<long long int> #define fi first #define se second #define pb push_back int main() { string a; cin >> a; int count = 0; int i = 0; while (i < 3) { if (a[i] == 'R') { co...
insert
19
19
19
20
TLE
p02582
C++
Runtime Error
#include <iostream> using namespace std; int main() { string a; cin >> a; int i, k = 0; for (i = 0; i < 3; i++) { if (a.at(i) == 'R') { k++; if (a.at(i + 1) != 'R') { break; } } } cout << k; return 0; }
#include <iostream> using namespace std; int main() { string a; cin >> a; int i, k = 0; for (i = 0; i < 3; i++) { if (a.at(i) == 'R') { k++; if (i != 2 && a.at(i + 1) != 'R') { break; } } } cout << k; return 0; }
replace
11
12
11
12
0
p02582
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define uu unsigned #define io \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define uu unsigned #define io \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
replace
45
46
45
46
TLE
p02582
C++
Time Limit Exceeded
// #include<bits/stdc++.h> #include <cstdio> #include <cstring> #include <iostream> #include <string> #define pb emplace_back #define LOCAL using namespace std; const int inf = 0x3f3f3f3f; const int maxn = 1e5 + 5; typedef long long ll; typedef pair<int, int> Pii; template <typename T> inline void read(T &t) { cha...
// #include<bits/stdc++.h> #include <cstdio> #include <cstring> #include <iostream> #include <string> #define pb emplace_back #define LOCAL using namespace std; const int inf = 0x3f3f3f3f; const int maxn = 1e5 + 5; typedef long long ll; typedef pair<int, int> Pii; template <typename T> inline void read(T &t) { cha...
replace
38
39
38
39
TLE
p02582
C++
Runtime Error
#include <iostream> #include <string> int main() { std::string S; std::cin >> S; if ("RRS" == S || "SRR" == S) { std::cout << "2"; } if ("SSS" == S) { std::cout << "0"; } if ("RSR" == S || "RSS" == S || "SSR" == S || "SRS" == S) { std::cout << "1"; } return 1; }
#include <iostream> #include <string> int main() { std::string S; std::cin >> S; if ("RRS" == S || "SRR" == S) { std::cout << "2"; } if ("SSS" == S) { std::cout << "0"; } if ("RSR" == S || "RSS" == S || "SSR" == S || "SRS" == S) { std::cout << "1"; } if ("RRR" == S) { std::cout << "3...
replace
16
17
16
20
1
p02582
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { string s; getline(cin, s); vector<int> count; int c = 0; ; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { c++; } else { count.push_back(c); c = 0; } } sort(count.begin(), coun...
#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { string s; getline(cin, s); vector<int> count; int c = 0; ; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { c++; } else { count.push_back(c); c = 0; } count.push_back(c); } ...
insert
17
17
17
18
0
p02582
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <vector> using namespace std; int main(void) { char S[3]; cin >> S; int ans = 0; for (int i = 0; i < 3; ++i) { if (S[i] == 'R') ++ans; } if (ans == 2 && S[1] == 'S') ans = 1; ...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <vector> using namespace std; int main(void) { string S; cin >> S; int ans = 0; for (int i = 0; i < 3; ++i) { if (S[i] == 'R') ++ans; } if (ans == 2 && S[1] == 'S') ans = 1; ...
replace
10
11
10
11
0
p02582
C++
Time Limit Exceeded
#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
27
28
27
28
TLE
p02582
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define SZ(x) (long long)x.size() #define endl '\n' #define FAST \ ios_base::sync_with_stdio(false); \ c...
#include <bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define SZ(x) (long long)x.size() #define endl '\n' #define FAST \ ios_base::sync_with_stdio(false); \ c...
replace
52
57
52
60
TLE
p02582
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // freopen("input.txt","r",stdin); string s; cin >> s; int c[3], cnt = 0, j = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == 'R') cnt++; else c[j] = c...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // freopen("input.txt","r",stdin); string s; cin >> s; int c = 0; if (s == "SRR" || s == "RRS") c = 2; else if (s == "RRR") c = 3; else if (s == "SSR" || s == "SRS" ...
replace
12
22
12
22
0
p02582
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { string s; cin >> s; int sum = 0; bool pan = 0; for (int i = 0; i < 3; i++) { if (i = 1 && s[i] == 'R') pan = 1; if (s[i] == 'R' && pan == 1) { sum++; pan = 1; } if (s[i] != 'R') pan = 0; } cout << sum; return ...
#include <iostream> using namespace std; int main() { string s; cin >> s; if (s == "RRR") cout << 3; if (s == "RRS") cout << 2; if (s == "SRR") cout << 2; if (s == "RSS") cout << 1; if (s == "SSR") cout << 1; if (s == "SRS") cout << 1; if (s == "RSR") cout << 1; if (s ==...
replace
6
19
6
22
TLE
p02582
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int ans; string s; int main() { cin >> s; for (int i = 0, j = 0; i < 3; i = j + 1) { while (s[i] == 'R' && j + 1 < 3 && s[j + 1] == 'R') j++; if (s[i] == 'R') ans = max(ans, j - i + 1); } printf("%d\n", ans); return 0; }
#include <bits/stdc++.h> using namespace std; int ans; string s; int main() { cin >> s; for (int i = 0, j = 0; i < 3; i = j + 1) { j = i; while (s[i] == 'R' && j + 1 < 3 && s[j + 1] == 'R') j++; if (s[i] == 'R') ans = max(ans, j - i + 1); } printf("%d\n", ans); return 0; }
insert
9
9
9
10
TLE
p02582
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #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++) int main() { string B; cin >> B; int A = 0; rep(i, 3) { if (B.at(i) == 'R') { A++; if (i == 2) { break; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #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++) int main() { string B; cin >> B; int A = 0; rep(i, 3) { if (B.at(i) == 'R') { A++; if (i == 2) { break; ...
insert
31
31
31
33
0
p02582
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { string s; cin >> s; int cnt = 0; vector<int> v; for (int i = 0; i < s.length(); i++) { if (s[i] == 'R') { cnt++; } else { v.push_back(cnt); cnt = 0; } } cout << *max_element(v.begin(...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { string s; cin >> s; int cnt = 0; vector<int> v; for (int i = 0; i < s.length(); i++) { if (s[i] == 'R') { cnt++; if (i == s.length() - 1) { v.push_back(cnt); break; } } else {...
insert
12
12
12
16
0
p02582
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; int main(void) { string str; cin >> str; int c = 0; if (str == "SSS") c = 0; else if (str == "SSR") c = 1; else if (str == "SRS") c = 1; else if (str == "SRR") c = 2; else if (str == "RSS") c = 1; else ...
#include <iostream> #include <string> #include <vector> using namespace std; int main(void) { string str; cin >> str; int c = 0; if (str == "SSS") c = 0; else if (str == "SSR") c = 1; else if (str == "SRS") c = 1; else if (str == "SRR") c = 2; else if (str == "RSS") c = 1; else ...
delete
29
31
29
29
1
p02582
C++
Runtime Error
#include <iostream> int main() { char a[3]; std::cin >> a; bool _1 = a[0] == 'R'; bool _2 = a[1] == 'R'; bool _3 = a[2] == 'R'; if (_1 && _2 && _3) { std::cout << '3' << std::endl; } else if ((_1 && _2) || (_2 && _3)) { std::cout << '2' << std::endl; } else if (_1 || _2 || _3) { std::cout...
#include <iostream> int main() { char a[3]; std::cin >> a; bool _1 = a[0] == 'R'; bool _2 = a[1] == 'R'; bool _3 = a[2] == 'R'; if (_1 && _2 && _3) { std::cout << '3' << std::endl; } else if ((_1 && _2) || (_2 && _3)) { std::cout << '2' << std::endl; } else if (_1 || _2 || _3) { std::cout...
replace
19
20
19
20
1
p02582
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string str; int i, c; i = c = 0; cin >> str; while (1) { if (str[i] == 'R') { c += 1; } if (c != 0 && str[i] == 'S') { break; } i += 1; } cout << c << endl; }
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string str; int i, c; i = c = 0; cin >> str; while (1) { if (i >= 3) { break; } if (str[i] == 'R') { c += 1; } if (c != 0 && str[i] == 'S') { break; } i += 1; } cout <<...
insert
12
12
12
15
0
p02582
Python
Runtime Error
s = input() cnt = 0 L = [] for i in s: if i == "R": cnt += 1 else: L.append(cnt) cnt = 0 print(max(L))
s = input() cnt = 0 L = [] for i in s: if i == "R": cnt += 1 else: L.append(cnt) cnt = 0 L.append(cnt) print(max(L))
replace
10
11
10
11
0
p02582
C++
Runtime Error
// list index out of rangeエラー表示用 #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep1(i, n) for (int i = 0; i < (int)(n); i++) int main() { string s; cin >> s; int n = 3; int tem = 0; vector<int> lan(0); for (int l = 0; l < n;) { int r = 0; for (; l + r < n && s[l] == s...
// list index out of rangeエラー表示用 #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep1(i, n) for (int i = 0; i < (int)(n); i++) int main() { string s; cin >> s; int n = 3; int tem = 0; vector<int> lan(0); for (int l = 0; l < n;) { int r = 0; for (; l + r < n && s[l] == s...
insert
22
22
22
23
0
p02582
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define MoD 1e9 + 7 #define clear(a) memset(a, 0, sizeof(a)) #define fo(i, a, b) for (int i = a; i < b; i++) #define re(i, a, b) for (int i = b; i > a; i--) #define pb(a) push_back(a) template <typename T1, typename T2> inline void chmin(T1 &a, T2 b)...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MoD 1e9 + 7 #define clear(a) memset(a, 0, sizeof(a)) #define fo(i, a, b) for (int i = a; i < b; i++) #define re(i, a, b) for (int i = b; i > a; i--) #define pb(a) push_back(a) template <typename T1, typename T2> inline void chmin(T1 &a, T2 b)...
replace
29
30
29
30
0
p02582
Python
Runtime Error
S = int(input()) flag = False ans = 0 for i in range(len(S)): if S[i] == "R": ans += 1 flag = True elif S[i] == "S" and flag: break print(ans)
S = input() flag = False ans = 0 for i in range(len(S)): if S[i] == "R": ans += 1 flag = True elif S[i] == "S" and flag: break print(ans)
replace
0
1
0
1
ValueError: invalid literal for int() with base 10: 'RRS'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02582/Python/s302046269.py", line 1, in <module> S = int(input()) ValueError: invalid literal for int() with base 10: 'RRS'
p02582
Python
Runtime Error
S = input() rain_d = 0 for s in S: if s == "R": rain_d += 1 max_rain_d = rain_d elif s == "S": rain_d = 0 print(max_rain_d)
S = input() rain_d = 0 max_rain_d = 0 for s in S: if s == "R": rain_d += 1 max_rain_d = rain_d elif s == "S": rain_d = 0 print(max_rain_d)
insert
2
2
2
3
0
p02582
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; int i; for (i = 0; i < s.length();) { if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') count = 3; else if (s[0] == 'R' && s[1] == 'R' && s[2] == 'S') count = 2; else if (s[0] == 'R' && s[1] == ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; int i; if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') count = 3; else if (s[0] == 'R' && s[1] == 'R' && s[2] == 'S') count = 2; else if (s[0] == 'R' && s[1] == 'S' && s[2] == 'R') count = 1; else i...
replace
8
26
8
24
TLE
p02582
Python
Runtime Error
# -*- coding: utf-8 -*- s = input() maxs = 0 ans = [] for a in s: if a == "R": maxs += 1 else: ans.append(maxs) maxs = 0 print(max(ans))
# -*- coding: utf-8 -*- s = input() maxs = 0 ans = [] for a in s: if a == "R": maxs += 1 else: ans.append(maxs) maxs = 0 ans.append(maxs) print(max(ans))
insert
13
13
13
14
0
p02582
Python
Runtime Error
s = input() if "RRR" in s: ans = 3 elif "RR" in s: ans = 2 elif "R" in s: ans = 1 print(ans)
s = input() if "RRR" in s: ans = 3 elif "RR" in s: ans = 2 elif "R" in s: ans = 1 else: ans = 0 print(ans)
insert
8
8
8
10
0
p02582
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> // #include <boost/math/common_factor.hpp> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pair<int, int>> vpii; typedef vector<pair<ll, ll>> vpll; #define all(x) x.begin(), x.end() #define reg(i, x) for (ll i = 0; i...
#include <bits/stdc++.h> #include <iostream> // #include <boost/math/common_factor.hpp> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pair<int, int>> vpii; typedef vector<pair<ll, ll>> vpll; #define all(x) x.begin(), x.end() #define reg(i, x) for (ll i = 0; i...
insert
34
34
34
35
0
p02582
Python
Runtime Error
s = input() ans = s.index("S") print(ans)
s = input() if "RRR" in s: print(3) elif "RR" in s: print(2) elif "R" in s: print(1) else: print(0)
replace
2
5
2
10
0
p02582
Python
Runtime Error
S = input() R = [] r = 0 for s in S: if s == "R": r += 1 if s == "S": R.append(r) r = 0 print(max(R))
S = input() R = [] r = 0 for s in S: if s == "R": r += 1 if s == "S": R.append(r) r = 0 R.append(r) print(max(R))
insert
10
10
10
11
0
p02582
C++
Runtime Error
#include "bits/stdc++.h" // #include "ext/pb_ds/assoc_container.hpp" // #include "ext/pb_ds/tree_policy.hpp" using namespace std; // using namespace __gnu_pbds; #define ff first #define ss second #define ld long double #define ll long long int #define ull unsigned ll #define ins insert #define pb emplace_back #define v...
#include "bits/stdc++.h" // #include "ext/pb_ds/assoc_container.hpp" // #include "ext/pb_ds/tree_policy.hpp" using namespace std; // using namespace __gnu_pbds; #define ff first #define ss second #define ld long double #define ll long long int #define ull unsigned ll #define ins insert #define pb emplace_back #define v...
replace
77
78
77
81
-11
p02583
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_set> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_set> #include <...
replace
89
92
89
92
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; // using ll = long long; int main() { ios::sync_with_stdio(false); int N; cin >> N; vector<int> L(N); rep(i, N) cin >> L[i]; sort(L.begin(), L.end()); int ans = 0; for (int i = 0; i < L.size() - 2; i++) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; // using ll = long long; int main() { ios::sync_with_stdio(false); int N; cin >> N; vector<int> L(N); if (N < 3) { cout << 0 << endl; return 0; } rep(i, N) cin >> L[i]; sort(L.begin(), L.end()); in...
insert
11
11
11
15
TLE
p02583
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #define ff first #define ss second #define pb push_back typedef long long ll; #define db(x) cerr << __LINE__ << ": " << #x << " = " << (x) << '\n' const int inf = 1e9 + 7; const int N = 1e6 + 9; int main() { ios_base::sync_with_stdio(0); int a, b, n; cin >> n; // s...
#include "bits/stdc++.h" using namespace std; #define ff first #define ss second #define pb push_back typedef long long ll; #define db(x) cerr << __LINE__ << ": " << #x << " = " << (x) << '\n' const int inf = 1e9 + 7; const int N = 1e6 + 9; int main() { ios_base::sync_with_stdio(0); int a, b, n; cin >> n; // s...
replace
33
35
33
35
TLE
p02583
C++
Runtime Error
#pragma GCC optimize(2) #include <bits/stdc++.h> #define MIN -10000000 #define MAX 10000000 #define debug printf("%d", __LINE__) using namespace std; long long a[114511141]; int main() { int n; scanf("%d", &n); int cnt = 0; if (n < 3) return printf("0"); for (int i = 1; i <= n; i++) scanf("%lld", &a[i...
#pragma GCC optimize(2) #include <bits/stdc++.h> #define MIN -10000000 #define MAX 10000000 #define debug printf("%d", __LINE__) using namespace std; long long a[114511141]; int main() { int n; scanf("%d", &n); int cnt = 0; if (n < 3) return printf("0"), 0; for (int i = 1; i <= n; i++) scanf("%lld", &...
replace
12
13
12
13
-11
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; int main() { int N; cin >> N; vector<ull> L(N); for (int i = 0; i < N; i++) cin >> L.at(i); ull a = 0, b = 0, c = 0, cnt = 0; for (int i = 0; i < N - 2; i++) { for (int j = ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; int main() { int N; cin >> N; vector<ull> L(N); for (int i = 0; i < N; i++) cin >> L.at(i); ull a = 0, b = 0, c = 0, cnt = 0; for (int i = 0; i < N - 2; i++) { for (int j = ...
replace
24
27
24
28
TLE
p02583
C++
Time Limit Exceeded
// C #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #i...
// C #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #i...
insert
122
122
122
126
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int ans = 0; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; j < n; k++) { if (a[i] + a[j] >...
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int ans = 0; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++) { if (a[i] + a[j] >...
replace
14
16
14
17
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long ll; // forループ // 引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < ll(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= ll(b); i++) #d...
#include <bits/stdc++.h> typedef long long ll; // forループ // 引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < ll(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= ll(b); i++) #d...
replace
64
67
64
67
TLE
p02583
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <set> #include <stdlib.h> #include <string> #include <vector> using name...
#define _USE_MATH_DEFINES #include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <set> #include <stdlib.h> #include <string> #include <vector> using name...
replace
33
35
33
35
TLE
p02583
C++
Time Limit Exceeded
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define int long long #define ld long double #define x first #define y second #define mp make_pair #define pb push_back #define rt return #define yy cout < "Yes\n" #define nn cout << "No\n" #define er era...
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define int long long #define ld long double #define x first #define y second #define mp make_pair #define pb push_back #define rt return #define yy cout < "Yes\n" #define nn cout << "No\n" #define er era...
replace
31
34
31
36
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; long int cnt = 0; for (int i = 0; i < n; i++) for (int j = i + 1; i < n; j++) for (int k = j + 1; k < n; k++) { if (arr[i] != arr[j] && arr[i] != arr[...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; long int cnt = 0; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) for (int k = j + 1; k < n; k++) { if (arr[i] != arr[j] && arr[i] != arr[...
replace
10
11
10
11
TLE
p02583
C++
Runtime Error
#include <algorithm> #include <array> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int64_t N; cin >> N; vector<int64_t> L(N); if (N < 3) { cout << 0; return 0; } for (int64_t i = 0; i < N; i+...
#include <algorithm> #include <array> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int64_t N; cin >> N; vector<int64_t> L(N); if (N < 3) { cout << 0; return 0; } for (int64_t i = 0; i < N; i+...
replace
31
32
31
32
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } sort(L.begin(), L.end()); long long int ans = 0; for (int i = 0; i < L.size() - 2; i++) { for (int j = i + 1; j < L.size() - 1; j++) { for (int ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L(N); for (int i = 0; i < N; i++) { cin >> L.at(i); } sort(L.begin(), L.end()); long long int ans = 0; for (int i = 0; i < N - 2; i++) { for (int j = i + 1; j < N - 1; j++) { for (int k = j + 1; k <...
replace
15
18
15
18
TLE
p02583
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, count = 0; int L[n]; cin >> n; for (int i = 0; i < n; i++) { cin >> L[i]; } if (n < 3) { cout << count << endl; } else { for (int i = 0; i < n - 2; i++) { for (int j = 1; j < n - 1; j++) { for (int k = 2; k < n; k...
#include <bits/stdc++.h> using namespace std; int main() { int n, count = 0; int L[n]; cin >> n; for (int i = 0; i < n; i++) { cin >> L[i]; } if (n < 3) { cout << count << endl; } else { for (int i = 0; i < n - 2; i++) { for (int j = 1; j < n - 1; j++) { for (int k = 2; k < n; k...
replace
17
18
17
18
-11
p02583
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> L; for (int i = 0; i < N; i++) { cin >> L[i]; } int cnt = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { if (L[i] != L[j]) { for (int k = j + 1; k < N; k++) { if (L[...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int L[100]; for (int i = 0; i < N; i++) { cin >> L[i]; } int cnt = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { if (L[i] != L[j]) { for (int k = j + 1; k < N; k++) { if (L[i] ...
replace
5
6
5
6
-11
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < int(N); ++i) using ll = long long; const int INF = 2147483647; const ll MOD = 1e9 + 7; // const ll INF = 1000000000000000000LL; int main() { int n; cin >> n; vector<ll> l(n); rep(i, n) cin >> l[i]; sort(l.begin(), l.end()); ...
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < int(N); ++i) using ll = long long; const int INF = 2147483647; const ll MOD = 1e9 + 7; // const ll INF = 1000000000000000000LL; int main() { int n; cin >> n; vector<ll> l(n); rep(i, n) cin >> l[i]; sort(l.begin(), l.end()); ...
replace
15
17
15
17
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < int(N); ++i) using ll = long long; const int INF = 2147483647; const ll MOD = 1e9 + 7; // const ll INF = 1000000000000000000LL; int main() { int n; cin >> n; vector<ll> l(n); rep(i, n) cin >> l[i]; sort(l.begin(), l.end()); ...
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < int(N); ++i) using ll = long long; const int INF = 2147483647; const ll MOD = 1e9 + 7; // const ll INF = 1000000000000000000LL; int main() { int n; cin >> n; vector<ll> l(n); rep(i, n) cin >> l[i]; sort(l.begin(), l.end()); ...
replace
15
17
15
17
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; #define debug(a) cerr << #a << ": " << a << endl #define sz(a) int(a.size()) #define rep(i, n) for (int i = 0; i < n; i++) #define forr(i, st, en) for (int i = st; i <= en; i++) #define all(v) (v).begin(), (v).end() #define X first #define Y second #de...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define debug(a) cerr << #a << ": " << a << endl #define sz(a) int(a.size()) #define rep(i, n) for (int i = 0; i < n; i++) #define forr(i, st, en) for (int i = st; i <= en; i++) #define all(v) (v).begin(), (v).end() #define X first #define Y second #de...
replace
25
33
25
30
TLE
p02583
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> A(N); int cnt = 0; for (int i = 0; i < N; i++) cin >> A[i]; sort(A.begin(), A.end()); if (N < 3) { cout << 0; return -1; } else { for (int i = 0; i < N; i++) { ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> A(N); int cnt = 0; for (int i = 0; i < N; i++) cin >> A[i]; sort(A.begin(), A.end()); for (int i = 0; i < N; i++) { for (int j = 0; j < i; j++) { for (int k = 0; k < j; ...
replace
13
24
13
19
0
p02583
C++
Time Limit Exceeded
#include <algorithm> #include <assert.h> #include <climits> #include <cstring> #include <fstream> #include <iostream> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { int N; vector<int> v; cin >> N; for (int i = 0; i < N; i++) { ...
#include <algorithm> #include <assert.h> #include <climits> #include <cstring> #include <fstream> #include <iostream> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { int N; vector<int> v; cin >> N; for (int i = 0; i < N; i++) { ...
replace
27
28
27
28
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef uint64_t u64; typedef int64_t i64; typedef uint32_t u32; typedef int32_t i32; typedef uint16_t u16; typedef int16_t i16; typedef uint8_t u8; typedef int8_t i8; using namespace std; #define rep(idx, N) for (u64 idx = 0; idx < N; idx++) int main() { u32 n; cin >> n; vector<u64>...
#include <bits/stdc++.h> typedef uint64_t u64; typedef int64_t i64; typedef uint32_t u32; typedef int32_t i32; typedef uint16_t u16; typedef int16_t i16; typedef uint8_t u8; typedef int8_t i8; using namespace std; #define rep(idx, N) for (u64 idx = 0; idx < N; idx++) int main() { u32 n; cin >> n; vector<u64>...
insert
27
27
27
32
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long ll; // forループ // 引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < ll(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= ll(b); i++) #d...
#include <bits/stdc++.h> typedef long long ll; // forループ // 引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < ll(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= ll(b); i++) #d...
replace
62
65
62
65
TLE
p02583
Python
Runtime Error
N = int(input()) L = map(int, input().split()) if N < 3: print(0) exit() ans = 0 for i in range(0, N - 2): for j in range(i + 1, N - 1): for k in range(j + 1, N): arr = [L[i], L[j], L[k]] arr.sort() if arr[0] != arr[1] & arr[1] != arr[2]: if arr[...
N = int(input()) L = list(map(int, input().split())) if N < 3: print(0) exit() ans = 0 for i in range(0, N - 2): for j in range(i + 1, N - 1): for k in range(j + 1, N): arr = [L[i], L[j], L[k]] arr.sort() if arr[0] != arr[1] & arr[1] != arr[2]: i...
replace
1
2
1
2
TypeError: 'map' object is not subscriptable
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02583/Python/s182919644.py", line 12, in <module> arr = [L[i], L[j], L[k]] TypeError: 'map' object is not subscriptable
p02583
C++
Time Limit Exceeded
#include <iostream> using namespace std; #include <vector> #define re(i, n) for (int i = 0; i < n; i++) int main() { int n; cin >> n; vector<int> l(n); re(i, n) cin >> l[i]; int cnt = 0; re(i, n - 2) { for (int j = i + 1; i < n - 1; j++) { for (int k = j + 1; i < n; k++) { if (abs(l[i] ...
#include <iostream> using namespace std; #include <vector> #define re(i, n) for (int i = 0; i < n; i++) int main() { int n; cin >> n; vector<int> l(n); re(i, n) cin >> l[i]; int cnt = 0; re(i, n - 2) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++) { if (abs(l[i] ...
replace
14
17
14
18
TLE
p02583
C++
Time Limit Exceeded
#include <cstdio> int main() { unsigned N, answer = 0; scanf("%u", &N); unsigned L[N]; for (int i = 0; i < N; ++i) { scanf("%u", L + i); } for (unsigned i = 0; i < N - 2; i++) { for (unsigned j = i + 1; j < N - 1; j++) { for (unsigned k = j + 1; k < N; k++) { if (L[i] != L[j] && L[k] ...
#include <cstdio> int main() { unsigned N, answer = 0; scanf("%u", &N); unsigned L[N]; for (int i = 0; i < N; ++i) { scanf("%u", L + i); } for (unsigned i = 0; i + 2 < N; i++) { for (unsigned j = i + 1; j + 1 < N; j++) { for (unsigned k = j + 1; k < N; k++) { if (L[i] != L[j] && L[k] ...
replace
9
11
9
11
TLE
p02583
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> l(n); for (int i = 0; i < n; i++) { cin >> l[i]; } int result = 0; // for(int i=0; i<l.size(); i++){ // cout << l[i] << endl; // } for (int i = 0; i < l.size() - 2; i++) { // cout << i << "-" << l[i...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> l(n); for (int i = 0; i < n; i++) { cin >> l[i]; } int result = 0; // for(int i=0; i<l.size(); i++){ // cout << l[i] << endl; // } if (n == 1) { cout << result << endl; return 0; } for (int...
insert
16
16
16
21
TLE
p02583
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int n; vector<int> v; int main() { cin >> n; for (int i = 1; i <= n; i++) { int nr; cin >> nr; v.push_back(nr); } sort(v.begin(), v.end()); v.push_back(0); int total = 0, lastj = 0, lasti = 0; for (int i = 0; i < v.size() - ...
#include <bits/stdc++.h> using namespace std; using ll = long long; int n; vector<int> v; int main() { cin >> n; for (int i = 1; i <= n; i++) { int nr; cin >> nr; v.push_back(nr); } if (n < 3) { cout << 0; return 0; } sort(v.begin(), v.end()); v.push_back(0); int total = 0, lastj =...
insert
12
12
12
16
0
p02584
Python
Time Limit Exceeded
x, k, d = map(int, input().split()) x = abs(x) while k > 0: x = min(abs(x + d), abs(x - d)) k -= 1 print(x)
x, k, d = map(int, input().split()) x = abs(x) k_ = min(k, x // d) k = k - k_ x = x - k_ * d if k % 2 != 0: x = abs(x - d) print(x)
replace
2
5
2
9
TLE
p02584
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n); i++) typ...
#include <bits/stdc++.h> using namespace std; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n); i++) typ...
replace
19
23
19
27
TLE
p02584
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<long long, long long> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define agewari(a, b) ((ll)a + ((ll)b - 1)) / b const int MOD = 1000000007; const long long INF = 1LL << 60; int main() { ll x, k, d; cin >> x >> k >> d; x...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<long long, long long> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define agewari(a, b) ((ll)a + ((ll)b - 1)) / b const int MOD = 1000000007; const long long INF = 1LL << 60; int main() { ll x, k, d; cin >> x >> k >> d; x...
replace
16
24
16
21
TLE
p02584
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, x, n) for (int i = x; i < (n); i++) const long long INF = 1LL << 60; // 仮想的な無限大の値; 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; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, x, n) for (int i = x; i < (n); i++) const long long INF = 1LL << 60; // 仮想的な無限大の値; 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; ...
insert
31
31
31
46
TLE
p02584
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> using namespace std; typedef long long ll; int main() { ll x, k, d; scanf("%lld%lld%lld", &x, &k, &d); if (x == d || -x == d) { printf("%lld\n", (k & 1 ? 0 : d)); return 0; } if (k == 1) { printf("%lld\n", (x >= 0 ? abs(x - d) : abs(x + d))); return 0; }...
#include <cstdio> #include <iostream> using namespace std; typedef long long ll; int main() { ll x, k, d; cin >> x >> k >> d; ll a = abs(x) / d; ll ans; if (a == k) ans = abs(x) - d * a; else if (a < k) { k -= a; if (k & 1) ans = d * (a + 1) - abs(x); else ans = abs(x) - d * a; ...
replace
6
42
6
20
TLE
p02584
C++
Time Limit Exceeded
// HEADER FILES AND NAMESPACES #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <t...
// HEADER FILES AND NAMESPACES #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <t...
replace
175
182
175
184
TLE
p02584
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <limits> using namespace std; typedef unsigned long long int ull; typedef long long int ll; #define fi(i, n) for (int i = 0; i < n; i++) #define f(i, a, b) for (int i = a; i < b; i++) #define vi vector<int> #define pb push_back int gcd(int a, int b) { if (b == 0) return a; retu...
#include <bits/stdc++.h> #include <limits> using namespace std; typedef unsigned long long int ull; typedef long long int ll; #define fi(i, n) for (int i = 0; i < n; i++) #define f(i, a, b) for (int i = a; i < b; i++) #define vi vector<int> #define pb push_back int gcd(int a, int b) { if (b == 0) return a; retu...
replace
52
53
52
53
TLE
p02584
C++
Time Limit Exceeded
#include <cmath> #include <iostream> using namespace std; int main() { long long x, k, d; cin >> x >> k >> d; while (k--) { if (x > 0) x -= d; // 현재위치(x)가 양수인 경우 else x += d; // 현재위치(x)가 음수거나, 0인 경우 } cout << abs(x); return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { long long x, k, d; cin >> x >> k >> d; x = abs(x); long long n = (d ? x / d : 0), r = (d ? x % d : 0); if (n > k) cout << (x - k * d); else if ((k - n) % 2) cout << abs(d - r); else cout << r; return 0; }
replace
6
13
6
14
TLE
p02584
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <queue> #include <vector> using namespace std; using ll = long long; using P = pair<ll, ll>; using PP = pair<ll, pair<ll, ll>>; #define rep(i, n) for (ll i = 0; i < (n); ++i) ll x, k, d, ans; in...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <queue> #include <vector> using namespace std; using ll = long long; using P = pair<ll, ll>; using PP = pair<ll, pair<ll, ll>>; #define rep(i, n) for (ll i = 0; i < (n); ++i) ll x, k, d, ans; in...
replace
30
35
30
31
TLE
p02584
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long long x, k, d; cin >> x >> k >> d; x = abs(x); for (long long i = 1; i < k + 1; i++) { if (x <= 0) { if ((k - i) % 2 == 1) { cout << abs(x); return 0; } else { cout << x + d; return 0; } } ...
#include <bits/stdc++.h> using namespace std; int main() { long long x, k, d; cin >> x >> k >> d; x = abs(x); long long n = x / d + 1; long long m = min(k, n); x -= d * m; if ((k - m) % 2 == 0) cout << abs(x); else cout << x + d; }
replace
7
20
7
14
TLE
p02584
Python
Time Limit Exceeded
X, K, D = map(int, input().split()) x = abs(X) k = K while x > 0 and k > 0: x -= D k -= 1 if k % 2 == 1: x += D print(abs(x))
X, K, D = map(int, input().split()) x = abs(X) k = K xd = min(x // D + 1, K) x -= D * xd k -= xd if k % 2 == 1: x += D print(abs(x))
replace
4
7
4
8
TLE
p02584
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<int, int> #define _FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<int, int> #define _FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
replace
20
23
20
27
TLE