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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02918 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
string s;
cin >> s;
int score = 0;
for (int i = 0; i < n; i++) {
if (s.at(i) == s.at(i + 1))
score++;
}
int ans = min(score + 2 * k, n - 1);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
string s;
cin >> s;
int score = 0;
for (int i = 0; i < n - 1; i++) {
if (s.at(i) == s.at(i + 1))
score++;
}
int ans = min(score + 2 * k, n - 1);
cout << ans << endl;
} | replace | 9 | 10 | 9 | 10 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 6) >= this->size() (which is 6)
|
p02918 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int n, k;
cin >> n >> k;
string s;
int ans = 0;
for (int i = 0; i < n - 1; i++) {
if (s[i] == s[i + 1]) {
ans++;
}
}
cout << min(ans + 2 * k, ... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main(void) {
int n, k;
cin >> n >> k;
string s;
cin >> s;
int ans = 0;
for (int i = 0; i < n - 1; i++) {
if (s[i] == s[i + 1]) {
ans++;
}
}
cout << min(a... | insert | 13 | 13 | 13 | 14 | 0 | |
p02918 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI pair<int, int>
const int maxm = 1e6 + 5;
char s[maxm];
int n, k;
signed main() {
cin >> n >> k;
scanf("%s", s + 1);
int ans = 0;
vector<int> rl, lr;
for (int i = 2; i <= n; i++) {
if (s[i] == s[i - 1]) {
ans++;
} else... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI pair<int, int>
const int maxm = 1e6 + 5;
char s[maxm];
int n, k;
signed main() {
cin >> n >> k;
scanf("%s", s + 1);
int ans = 0;
vector<int> rl, lr;
for (int i = 2; i <= n; i++) {
if (s[i] == s[i - 1]) {
ans++;
} else... | replace | 32 | 38 | 32 | 37 | 0 | |
p02918 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)x.size())
template <class T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)x.size())
template <class T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> ... | replace | 74 | 76 | 74 | 76 | 0 | |
p02918 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n, k;
string s;
cin >> n >> k;
cin >> s;
char x = s.at(0);
int st = 1;
int en = 0;
for (int i = 0; i < k; i++) {
en = s.length();
for (int j = st - 1; j < s.length(); j++) {
if (s.at(j) == x)
cont... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n, k;
string s;
cin >> n >> k;
cin >> s;
char x = s.at(0);
int st = 1;
int en = 0;
for (int i = 0; i < k; i++) {
en = s.length();
for (int j = st - 1; j < s.length(); j++) {
if (s.at(j) == x)
cont... | insert | 30 | 30 | 30 | 31 | TLE | |
p02918 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll N, K;
string S;
cin >> N >> K >> S;
ll t = 0;
for (ll i = 0; i < K; i++) {
for (ll j = t; j < N; j++) {
if (S[0] != S[j] && S[j] == S[j + 1]) {
S[j] = S[0];
} else if (S[0] != S[j]) {
S[j] = S... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll N, K;
string S;
cin >> N >> K >> S;
ll t = 0;
for (ll i = 0; i < K; i++) {
for (ll j = t; j < N; j++) {
if (S[0] != S[j] && S[j] == S[j + 1]) {
S[j] = S[0];
} else if (S[0] != S[j]) {
S[j] = S... | insert | 18 | 18 | 18 | 20 | TLE | |
p02918 | C++ | Runtime Error | #include <bits/stdc++.h>
#define f first
#define s second
#define inf 999999999999
#define N 500009
#define M (L + R) / 2
#define ll long long
#define pb push_back
using namespace std;
ll n, k, ans, len, KL, KR;
string A, L, R;
ll check(string x) {
ll pas = 0;
ll nn = x.size();
for (int i = 0; i < nn - 1; i++) ... | #include <bits/stdc++.h>
#define f first
#define s second
#define inf 999999999999
#define N 500009
#define M (L + R) / 2
#define ll long long
#define pb push_back
using namespace std;
ll n, k, ans, len, KL, KR;
string A, L, R;
ll check(string x) {
ll pas = 0;
ll nn = x.size();
for (int i = 0; i < nn - 1; i++) ... | replace | 37 | 109 | 37 | 38 | 0 | |
p02918 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
using namespace std;
int min(int a, int b);
int main() {
char queue[10000];
int happy_num = 0;
int len, time;
scanf("%d%d", &len, &time);
scanf("%s", queue);
for (int i = 0; i < strlen(queue); i++) {
if ((i != strlen(queue) - 1) && (queue[i + 1] == 'R') && (queue[i] ... | #include <cstdio>
#include <cstring>
using namespace std;
int min(int a, int b);
int main() {
char queue[100000];
int happy_num = 0;
int len, time;
scanf("%d%d", &len, &time);
scanf("%s", queue);
for (int i = 0; i < strlen(queue); i++) {
if ((i != strlen(queue) - 1) && (queue[i + 1] == 'R') && (queue[i]... | replace | 5 | 6 | 5 | 6 | 0 | |
p02918 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N, K;
cin >> N >> K;
string S;
cin >> S;
vector<int> pos;
char cur = 'a';
for (int i = 0; i < N; i++) {
if (cur != S[i]) {
cur = S[i];
pos.emplace_back(i);
}
}
pos.emplace_... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N, K;
cin >> N >> K;
string S;
cin >> S;
vector<int> pos;
char cur = 'a';
for (int i = 0; i < N; i++) {
if (cur != S[i]) {
cur = S[i];
pos.emplace_back(i);
}
}
pos.emplace_... | replace | 21 | 22 | 21 | 22 | 0 | |
p02918 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define ll long long
using namespace std;
const int N = 110;
const int mod = 10007;
inline int read() {
int jg = 0, jk = getchar() - '0', f = 1;
while (jk < 0 || jk > 9) {
if (jk == '-' - '0')
f = -1;
jk = getchar() - '0... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define ll long long
using namespace std;
const int N = 100010;
const int mod = 10007;
inline int read() {
int jg = 0, jk = getchar() - '0', f = 1;
while (jk < 0 || jk > 9) {
if (jk == '-' - '0')
f = -1;
jk = getchar() -... | replace | 9 | 10 | 9 | 10 | 0 | |
p02918 | C++ | Runtime Error | // From Naruto to Hokage
// #include <RJ>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl '\n'
#define mii map<ll, ll>
#define pii pair<ll, ll>
#define vi vector<ll>
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define sz(x) (ll) x.size()
#... | // From Naruto to Hokage
// #include <RJ>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl '\n'
#define mii map<ll, ll>
#define pii pair<ll, ll>
#define vi vector<ll>
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define sz(x) (ll) x.size()
#... | replace | 49 | 97 | 49 | 54 | 0 |
Time elapsed: 31ms
|
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <set>
#include <utility>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<int, int>> p(n);
for (int i = 0; i < n; ++i)
cin >> p[i].first, p[i].second = i;
sort(p.begin(), p.end(), greater<>());
set<int> se;
se.insert(-... | #include <algorithm>
#include <iostream>
#include <set>
#include <utility>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<int, int>> p(n);
for (int i = 0; i < n; ++i)
cin >> p[i].first, p[i].second = i;
sort(p.begin(), p.end(), greater<>());
set<int> se;
se.insert(-... | replace | 22 | 23 | 22 | 23 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr << " " << (hoge) << endl;
#define DBG ce... | #include <bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr << " " << (hoge) << endl;
#define DBG ce... | replace | 38 | 39 | 38 | 39 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
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++)
#define all(obj) obj.begin(), obj.end()
#define debug(x) cerr << #x << ":" << x << "\n"
#define vdebug(vec) \... | #include <bits/stdc++.h>
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++)
#define all(obj) obj.begin(), obj.end()
#define debug(x) cerr << #x << ":" << x << "\n"
#define vdebug(vec) \... | replace | 38 | 40 | 38 | 40 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
class Timer {
std::chrono::high_resolution_clock::time_point m_start;
public:
Timer() : m_start(std::chrono::high_resolution_clock::now()) {}
~Timer() {
auto end = std::chrono::high_resolution_clock::now();
auto duration_s = std::chrono::duration<double>(en... | #include "bits/stdc++.h"
using namespace std;
class Timer {
std::chrono::high_resolution_clock::time_point m_start;
public:
Timer() : m_start(std::chrono::high_resolution_clock::now()) {}
~Timer() {
auto end = std::chrono::high_resolution_clock::now();
auto duration_s = std::chrono::duration<double>(en... | replace | 72 | 73 | 72 | 73 | TLE | |
p02919 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define per(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define ... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define per(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define ... | replace | 31 | 32 | 31 | 32 | 0 | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <float.h>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#inclu... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <deque>
#include <float.h>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#inclu... | replace | 227 | 228 | 227 | 228 | TLE | |
p02919 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | replace | 38 | 40 | 38 | 39 | 0 | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using Cache = pair<long long, pair<long long, long long>>;
const bool DEBUG = false;
Cache cache = make_pair(-1, make_pair(-1, 1));
tuple<long long, long long, long long, long long>
get_anchors(long long i, const vector<long long> &P) {
long long outer_left_anchor, inn... | #include <bits/stdc++.h>
using namespace std;
using Cache = pair<long long, pair<long long, long long>>;
const bool DEBUG = false;
Cache cache = make_pair(-1, make_pair(-1, 1));
tuple<long long, long long, long long, long long>
get_anchors(long long i, const vector<long long> &P) {
long long outer_left_anchor, inn... | insert | 60 | 60 | 60 | 64 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <str... | #include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <str... | replace | 142 | 143 | 142 | 143 | TLE | |
p02919 | C++ | Time Limit Exceeded | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <fstream>
#include <iostream>
#include "bits/stdc++.h"
#define REP(i, x, y) for (int i = (x); i < (y); i++)
#define RREP(i, x, y) for (int i = (y)-1; i >= (x); i--)
#define all(x) (x).begin(), (x).end()
/... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <fstream>
#include <iostream>
#include "bits/stdc++.h"
#define REP(i, x, y) for (int i = (x); i < (y); i++)
#define RREP(i, x, y) for (int i = (y)-1; i >= (x); i--)
#define all(x) (x).begin(), (x).end()
/... | replace | 57 | 58 | 57 | 58 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define MOD 1000000007
#... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define MOD 1000000007
#... | replace | 121 | 122 | 121 | 122 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define PI 3.14159265358979
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, s, e) for (int i = (s); i <= (e); ++i)
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#de... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define PI 3.14159265358979
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, s, e) for (int i = (s); i <= (e); ++i)
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#de... | replace | 38 | 39 | 38 | 39 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
constexpr ll infl = 10000000000000007LL;
constexpr int inf... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
constexpr ll infl = 10000000000000007LL;
constexpr int inf... | replace | 33 | 34 | 33 | 34 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define rip(i, n, s) for (int i = (s); i < (int)(n); i++)
#define all(a) (a).begin(), (a).end()
typedef long long ll;
int main() {
int n;
cin >> n;
vector<int> da(n), li(n);
rip(i, n, 0) {
cin... | #include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define rip(i, n, s) for (int i = (s); i < (int)(n); i++)
#define all(a) (a).begin(), (a).end()
typedef long long ll;
int main() {
int n;
cin >> n;
vector<int> da(n), li(n);
rip(i, n, 0) {
cin... | replace | 28 | 29 | 28 | 29 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
usi... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
usi... | replace | 93 | 94 | 93 | 94 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 2100000000
#define MOD 1000000007
int main() {
ll N;
cin >> N;
vector<pair<ll, ll>> P(N);
for (ll i = 0; i < N; i++) {
cin >> P.at(i).first;
P.at(i).second = i;
}
sort(P.begin(), P.end());
reverse(P.begin(), P.end());... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 2100000000
#define MOD 1000000007
int main() {
ll N;
cin >> N;
vector<pair<ll, ll>> P(N);
for (ll i = 0; i < N; i++) {
cin >> P.at(i).first;
P.at(i).second = i;
}
sort(P.begin(), P.end());
reverse(P.begin(), P.end());... | replace | 24 | 25 | 24 | 25 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vb = vector<bool>;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vpll = vector<pll>;
const ll LINF = 1ll << 55;
const ll INF = 0x3f3f3f3f;
const ll MOD = 1e... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vb = vector<bool>;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vpll = vector<pll>;
const ll LINF = 1ll << 55;
const ll INF = 0x3f3f3f3f;
const ll MOD = 1e... | replace | 426 | 444 | 426 | 454 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; i++)
const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;
int main() {
int N;
cin >> N;
int P[N];
rep(i, N) {
cin >> P[i];
P[i]--;
}
int pos... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; i++)
const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;
int main() {
int N;
cin >> N;
int P[N];
rep(i, N) {
cin >> P[i];
P[i]--;
}
int pos... | replace | 27 | 28 | 27 | 28 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define RITR(x, c) for (__typeof(c.rbegin()) x = c.rbegin(); x != c.rend(); x++)
#define setp(n) fixed << setprecision(n)
#define lf double
#define ll long long
#d... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define RITR(x, c) for (__typeof(c.rbegin()) x = c.rbegin(); x != c.rend(); x++)
#define setp(n) fixed << setprecision(n)
#define lf double
#define ll long long
#d... | replace | 44 | 45 | 44 | 45 | TLE | |
p02919 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep2(x, fr, to) for (int(x) = (fr); (x) < (to); (x)++)
#define rep(x, to) for (int(x) = 0; (x) < (to); (x)++)
#define repr(x, fr, to) for (int(x) = (fr); (x) >= (to); (x)--)
#define all(c) (c).begin(), (c).end()
#define sz(v) (int)(v).size()
using namespace std;
typedef long long ll;
... | #include <bits/stdc++.h>
#define rep2(x, fr, to) for (int(x) = (fr); (x) < (to); (x)++)
#define rep(x, to) for (int(x) = 0; (x) < (to); (x)++)
#define repr(x, fr, to) for (int(x) = (fr); (x) >= (to); (x)--)
#define all(c) (c).begin(), (c).end()
#define sz(v) (int)(v).size()
using namespace std;
typedef long long ll;
... | replace | 21 | 22 | 21 | 22 | 0 | |
p02919 | C++ | Time Limit Exceeded | /* while(!success_achieved())
work_hard();
code by:aman_ayush
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll n;
cin >> n;
ll arr[n], pos[n + 1];
for (ll i = 0; i < n; i++) {
cin >> arr[i];
pos[arr[i]] = i;
}
multiset<ll> ms;
ms.insert(-1);
ms.... | /* while(!success_achieved())
work_hard();
code by:aman_ayush
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll n;
cin >> n;
ll arr[n], pos[n + 1];
for (ll i = 0; i < n; i++) {
cin >> arr[i];
pos[arr[i]] = i;
}
multiset<ll> ms;
ms.insert(-1);
ms.... | replace | 26 | 27 | 26 | 27 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n)-1; i >= 0; --i)
#define ln '\n'
#define pb push_back
#define eb emplace_back
#define prique priority_queue
#define umap unordered_map
#define BIG... | #include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n)-1; i >= 0; --i)
#define ln '\n'
#define pb push_back
#define eb emplace_back
#define prique priority_queue
#define umap unordered_map
#define BIG... | replace | 68 | 69 | 68 | 69 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <vector>
// output
#define SPBR(w, n) std::cout << (w... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <vector>
// output
#define SPBR(w, n) std::cout << (w... | replace | 66 | 67 | 66 | 67 | TLE | |
p02919 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <un... | #include <algorithm>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <un... | replace | 50 | 51 | 50 | 51 | 0 | |
p02919 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#def... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#def... | replace | 36 | 37 | 36 | 37 | 0 | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> o(n);
for (int i = 1; i <= n; i++) {
int p;
cin >> p;
o.at(p - 1) = i;
}
set<int> s;
s.insert(0);
s.insert(n + 1);
int64_t a = 0;
for (int i = n - 1; i >= 0; i--) {
auto l = prev(lower_bound(s.beg... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> o(n);
for (int i = 1; i <= n; i++) {
int p;
cin >> p;
o.at(p - 1) = i;
}
set<int> s;
s.insert(0);
s.insert(n + 1);
int64_t a = 0;
for (int i = n - 1; i >= 0; i--) {
auto l = prev(s.lower_bound(o.a... | replace | 16 | 18 | 16 | 18 | TLE | |
p02919 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define initdp(a, b) \
for (int i = 0; i <= a; i++) ... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define initdp(a, b) \
for (int i = 0; i <= a; i++) ... | replace | 42 | 43 | 42 | 43 | 0 | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define exists(s, x) (s).find(x) != (s).end()
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, k, n) for (int i = (k); i < (n); ++i)
#define fi first
#define se second
typedef long long ll;
const ll INF = 1LL << 60;
const ... | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define exists(s, x) (s).find(x) != (s).end()
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, k, n) for (int i = (k); i < (n); ++i)
#define fi first
#define se second
typedef long long ll;
const ll INF = 1LL << 60;
const ... | replace | 48 | 49 | 48 | 49 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int, int> P;
signed main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int N;
cin >> N;
P p[N... | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int, int> P;
signed main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int N;
cin >> N;
P p[N... | replace | 30 | 31 | 30 | 31 | TLE | |
p02919 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define endl '\n'
static const int maxn = 2e5 + 5;
struct Seg {
int fmax, smax;
Seg(int fmax = 0, int smax = 0) : fmax(fmax), smax(smax) {}
void assignLeaf(int num) {
fmax = num;
smax = 0;
}
void marge(const Seg &lchild, const... | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define endl '\n'
static const int maxn = 2e5 + 5;
struct Seg {
int fmax, smax;
Seg(int fmax = 0, int smax = 0) : fmax(fmax), smax(smax) {}
void assignLeaf(int num) {
fmax = num;
smax = 0;
}
void marge(const Seg &lchild, const... | delete | 102 | 106 | 102 | 102 | -6 | terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
|
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using _loop_int = int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); i++)
#define FOR(i, a, b) for (_loop_int i = (_loop_int)(a); i < ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using _loop_int = int;
#define REP(i, n) for (_loop_int i = 0; i < (_loop_int)(n); i++)
#define FOR(i, a, b) for (_loop_int i = (_loop_int)(a); i < ... | replace | 36 | 39 | 36 | 41 | TLE | |
p02919 | 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 drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)), x.end()... | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)), x.end()... | replace | 52 | 53 | 52 | 53 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | replace | 333 | 334 | 333 | 334 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for (ll i{s}; i < (N); i++)
#define rem(i, N, s) for (ll i{N}; i > (s); i--)
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugp(i) cerr << "(" << i.first << ", " << i.second << ")\n"
#define... | #include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for (ll i{s}; i < (N); i++)
#define rem(i, N, s) for (ll i{N}; i > (s); i--)
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugp(i) cerr << "(" << i.first << ", " << i.second << ")\n"
#define... | replace | 440 | 441 | 440 | 441 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string.h>
#include <unordered_map>
#include <vector>
using namespace std;
#define COUT(x) cout << #x << " = " << (x) << " (L"... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string.h>
#include <unordered_map>
#include <vector>
using namespace std;
#define COUT(x) cout << #x << " = " << (x) << " (L"... | replace | 53 | 54 | 53 | 54 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const ll MOD = 1e9 + 7;
const double EPS = 1e-9;
in... | #include <algorithm>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const ll MOD = 1e9 + 7;
const double EPS = 1e-9;
in... | replace | 36 | 37 | 36 | 37 | TLE | |
p02919 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long int
#define rep(i, x, y) for (int i = x; i < y; i++)
#define rel(i, x, y) for (int i = x - 1; i >= y; i--)
#define a... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long int
#define rep(i, x, y) for (int i = x; i < y; i++)
#define rel(i, x, y) for (int i = x - 1; i >= y; i--)
#define a... | replace | 21 | 22 | 21 | 22 | 0 | |
p02919 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unorde... | #pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unorde... | replace | 202 | 203 | 202 | 203 | 0 | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll BIG = 1e15;
int main() {
int N;
cin >> N;
vector<int> d(N + 1);
for (int i = 1; i <= N; i++) {
int x;
cin >> x;
d.at(x) = i;
}
ll ans = 0;
multiset<int> S;
S.insert(N... | #include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll BIG = 1e15;
int main() {
int N;
cin >> N;
vector<int> d(N + 1);
for (int i = 1; i <= N; i++) {
int x;
cin >> x;
d.at(x) = i;
}
ll ans = 0;
multiset<int> S;
S.insert(N... | replace | 25 | 26 | 25 | 26 | TLE | |
p02919 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int M = 1e3 + 5;
int seg[M * 4], arr[M], o[M], n;
int build(int l, int r, int i) {
if (l == r)
seg[i] = arr[l];
else
seg[i] = max(build(l, (l + r) / 2, i * 2 + 1),
build((l + r) / 2 + 1, r, i * 2 + 2));
return seg[i];
}
int q(int l, ... | #include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 5;
int seg[M * 4], arr[M], o[M], n;
int build(int l, int r, int i) {
if (l == r)
seg[i] = arr[l];
else
seg[i] = max(build(l, (l + r) / 2, i * 2 + 1),
build((l + r) / 2 + 1, r, i * 2 + 2));
return seg[i];
}
int q(int l, ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02919 | C++ | Runtime Error |
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <float.h>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <... |
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <float.h>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <... | replace | 84 | 85 | 84 | 85 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p02919 | Python | Runtime Error | import os
import sys
import numpy as np
# Global variables
# N is large enough size to store nodes at one time.
# children: ndarray(N, 2) current [left / right] child node index
# values: ndarray(N) -1 is represents EOT
# colors: ndarray(N) 0:black 1:red
# counts: ndarray(N) number of nodes in sub... | import os
import sys
import numpy as np
# Global variables
# N is large enough size to store nodes at one time.
# children: ndarray(N, 2) current [left / right] child node index
# values: ndarray(N) -1 is represents EOT
# colors: ndarray(N) 0:black 1:red
# counts: ndarray(N) number of nodes in sub... | replace | 17 | 18 | 17 | 18 | TLE | |
p02919 | C++ | Time Limit Exceeded | /*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i, m, n) for (ll i = (m); i < (n); i++)
#define rrep(i, m, n) for (ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define ... | /*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i, m, n) for (ll i = (m); i < (n); i++)
#define rrep(i, m, n) for (ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define ... | replace | 32 | 33 | 32 | 33 | TLE | |
p02919 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int a[100001], ST[(1 << 17) + 1];
long long ans = 0;
void build(int l, int r, int p) {
if (l == r) {
ST[p] = r;
return;
}
int mid = (l + r) / 2;
build(l, mid, p * 2);
build(mid + 1, r, p * 2 + 1);
ST[p] = (a[ST[p * 2]] > a[ST[p * 2 + 1]]) ? ST[p * 2] : S... | #include <bits/stdc++.h>
using namespace std;
int a[100001], ST[(1 << 18)];
long long ans = 0;
void build(int l, int r, int p) {
if (l == r) {
ST[p] = r;
return;
}
int mid = (l + r) / 2;
build(l, mid, p * 2);
build(mid + 1, r, p * 2 + 1);
ST[p] = (a[ST[p * 2]] > a[ST[p * 2 + 1]]) ? ST[p * 2] : ST[p ... | replace | 2 | 3 | 2 | 3 | 0 | |
p02919 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int a[100001], ST[(1 << 17)];
long long ans = 0;
void build(int l, int r, int p) {
if (l == r) {
ST[p] = r;
return;
}
int mid = (l + r) / 2;
build(l, mid, p * 2);
build(mid + 1, r, p * 2 + 1);
ST[p] = (a[ST[p * 2]] > a[ST[p * 2 + 1]]) ? ST[p * 2] : ST[p ... | #include <bits/stdc++.h>
using namespace std;
int a[100001], ST[(1 << 18)];
long long ans = 0;
void build(int l, int r, int p) {
if (l == r) {
ST[p] = r;
return;
}
int mid = (l + r) / 2;
build(l, mid, p * 2);
build(mid + 1, r, p * 2 + 1);
ST[p] = (a[ST[p * 2]] > a[ST[p * 2 + 1]]) ? ST[p * 2] : ST[p ... | replace | 2 | 3 | 2 | 3 | 0 | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, t;
cin >> n;
vector<ii> ar;
for (int ctr1 = 0; ctr1 < n; ++ctr1)
cin >> t, ar.push_back(make_pair(t, ctr1));
sort(ar.begin(), ar.end());
rev... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, t;
cin >> n;
vector<ii> ar;
for (int ctr1 = 0; ctr1 < n; ++ctr1)
cin >> t, ar.push_back(make_pair(t, ctr1));
sort(ar.begin(), ar.end());
rev... | replace | 22 | 24 | 22 | 24 | TLE | |
p02919 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INCANT \
cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), \
cout << fixed << setprecision(20);
#define int long long
#define gcd __gcd
#define all(x) (x).begin(), (x)... | #include <bits/stdc++.h>
using namespace std;
#define INCANT \
cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), \
cout << fixed << setprecision(20);
#define int long long
#define gcd __gcd
#define all(x) (x).begin(), (x)... | replace | 34 | 35 | 34 | 35 | TLE | |
p02920 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int m = 1 << n;
multiset<int> st;
for (int... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int m = 1 << n;
multiset<int> st;
for (int... | replace | 27 | 28 | 27 | 28 | 0 | |
p02920 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#define N 30005
using namespace std;
int n, s[N];
bool v[N];
priority_queue<int> pq[2];
int main() {
int i, j;
cin >> n;
for (i = 0; i < 1 << n; i++) {
scanf("%d", &s[i]);
}
sort(s, s + (1 << n), greater<int>());
pq[0].push(s[0... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#define N 300005
using namespace std;
int n, s[N];
bool v[N];
priority_queue<int> pq[2];
int main() {
int i, j;
cin >> n;
for (i = 0; i < 1 << n; i++) {
scanf("%d", &s[i]);
}
sort(s, s + (1 << n), greater<int>());
pq[0].push(s[... | replace | 4 | 5 | 4 | 5 | 0 | |
p02920 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, val;
multiset<int> m1, m2;
int main() {
cin >> n;
for (int i = 1; i <= (1 << n); i++) {
cin >> val;
m1.insert(val);
}
auto it = m1.end();
it--;
int nr = *it;
m2.insert(nr);
m1.erase(it);
for (int i = 1; i <= n; i++) {
for (auto it = m2.... | #include <bits/stdc++.h>
using namespace std;
int n, val;
multiset<int> m1, m2;
int main() {
cin >> n;
for (int i = 1; i <= (1 << n); i++) {
cin >> val;
m1.insert(val);
}
auto it = m1.end();
it--;
int nr = *it;
m2.insert(nr);
m1.erase(it);
for (int i = 1; i <= n; i++) {
for (auto it = m2.... | insert | 20 | 20 | 20 | 24 | 0 | |
p02920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define de(x) cout << #x << "=" << x << endl
#define dd(x) cout << #x << "=" << x << " "
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define repd(i, a, b) for (int i = a; i >= (b); --i)
#define repp(i, a, b, t) for (int i = a; i < (b); i += t)
#define mt(a, b) memset(a, b, sizeof(a))
#de... | #include <bits/stdc++.h>
#define de(x) cout << #x << "=" << x << endl
#define dd(x) cout << #x << "=" << x << " "
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define repd(i, a, b) for (int i = a; i >= (b); --i)
#define repp(i, a, b, t) for (int i = a; i < (b); i += t)
#define mt(a, b) memset(a, b, sizeof(a))
#de... | replace | 75 | 76 | 75 | 76 | TLE | |
p02920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = int_fast64_t;
using ld = long double;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
const ll INF = 1LL << 60;
void solve();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
solve();
}
#define SELECTOR(_1, _2, ... | #include <bits/stdc++.h>
using namespace std;
using ll = int_fast64_t;
using ld = long double;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
const ll INF = 1LL << 60;
void solve();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
solve();
}
#define SELECTOR(_1, _2, ... | replace | 56 | 62 | 56 | 57 | TLE | |
p02920 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
int n;
int m;
vector<int> ve;
multiset<int> se;
int main() {
// freopen("input.txt", "r", stdin);
scanf("%d", &n);
m = (1 << n);
for (int i = 0; i < m; i++) {
int t;
scanf("%d", &t);
se.insert(t);
}
au... | #include <cstdio>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
int n;
int m;
vector<int> ve;
multiset<int> se;
int main() {
// freopen("input.txt", "r", stdin);
scanf("%d", &n);
m = (1 << n);
for (int i = 0; i < m; i++) {
int t;
scanf("%d", &t);
se.insert(t);
}
au... | replace | 28 | 29 | 28 | 29 | -6 | free(): invalid pointer
|
p02920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i, N) for (int i = 0; i < (N); i++)
#define repr(i, N) for (int i = (N)-1; i >= 0; i--)
#define rep1(i, N) for (int i = 1; i <= (N); i++)
#define repr1(i, N) for (int i = (N); i > 0; ... | #include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i, N) for (int i = 0; i < (N); i++)
#define repr(i, N) for (int i = (N)-1; i >= 0; i--)
#define rep1(i, N) for (int i = 1; i <= (N); i++)
#define repr1(i, N) for (int i = (N); i > 0; ... | delete | 117 | 122 | 117 | 117 | TLE | |
p02920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1;
}... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1;
}... | replace | 45 | 46 | 45 | 46 | TLE | |
p02920 | C++ | Runtime Error | #include <algorithm> // minmax, sort, swap
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <cstdio> // printf, scanf
#include <deque> // deque
#include <functional> // std::function<void(int)>
#include <iomanip> // cout<<setprecision(n)
#in... | #include <algorithm> // minmax, sort, swap
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <cstdio> // printf, scanf
#include <deque> // deque
#include <functional> // std::function<void(int)>
#include <iomanip> // cout<<setprecision(n)
#in... | replace | 58 | 60 | 58 | 60 | 0 | |
p02920 | 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 rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_... | replace | 17 | 18 | 17 | 18 | 0 | |
p02920 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include... | replace | 58 | 59 | 58 | 59 | TLE | |
p02920 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define CLR(t, v) memset(t, (v), sizeof(t))
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
return os << "(" ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define CLR(t, v) memset(t, (v), sizeof(t))
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
return os << "(" ... | replace | 31 | 32 | 31 | 32 | 0 | |
p02920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) reps(i, 0, n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
ll N, M, H, W, K, Q, A, B, C, L, R;
string S,... | #include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) reps(i, 0, n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
ll N, M, H, W, K, Q, A, B, C, L, R;
string S,... | replace | 38 | 39 | 38 | 39 | TLE | |
p02920 | C++ | Runtime Error | #include <bits/stdc++.h>
int main() {
using namespace std;
unsigned long N;
cin >> N;
vector<unsigned long> S(1UL << N);
copy_n(istream_iterator<unsigned long>(cin), 1UL << N, S.begin());
sort(S.rbegin(), S.rend());
for (unsigned long i = 1; i < 1UL << N; ++i)
if (S[i] == S[i - (1UL << (63 - __builti... | #include <bits/stdc++.h>
int main() {
using namespace std;
unsigned long N;
cin >> N;
vector<unsigned long> S(1UL << N);
copy_n(istream_iterator<unsigned long>(cin), 1UL << N, S.begin());
sort(S.rbegin(), S.rend());
vector<unsigned long> T{S[0]};
list<unsigned long> l(S.begin() + 1, S.end());
for (un... | replace | 9 | 12 | 9 | 27 | 0 | |
p02920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename A> string to_string(multiset<A> v) {
bool first = true;
string result = "[";
for (A i : v) {
if (!first)
result += ", ";
first = false;
result += to_string(i);
}
return result + "]";
}
int main() {
int... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename A> string to_string(multiset<A> v) {
bool first = true;
string result = "[";
for (A i : v) {
if (!first)
result += ", ";
first = false;
result += to_string(i);
}
return result + "]";
}
int main() {
int... | replace | 43 | 44 | 43 | 44 | TLE | |
p02920 | C++ | Time Limit Exceeded | #define rep(i, m, n) for (int i = m; i < n; i++)
#define repM(i, m, n) for (int i = n - 1; i >= m; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
// typedef pair<int,int> pii;
// d = distance(lower_bound(all(x)), upper_bound(all(x)));
int INF = 1e9;
int M = 1e9 + 7;
#include <alg... | #define rep(i, m, n) for (int i = m; i < n; i++)
#define repM(i, m, n) for (int i = n - 1; i >= m; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
// typedef pair<int,int> pii;
// d = distance(lower_bound(all(x)), upper_bound(all(x)));
int INF = 1e9;
int M = 1e9 + 7;
#include <alg... | replace | 35 | 36 | 35 | 36 | TLE | |
p02920 | Python | Runtime Error | n = int(input())
s = [int(i) for i in input().split()]
used = [0] * (2**n)
used[0] = 1
s.sort(reverse=True)
a = 1
b = [s[0]]
for _ in range(n):
c = b.copy()
j = 0
for i in b:
while j < 2**n:
if used[j] == 0 and s[j] < i:
c.append(s[j])
used[j] = 1
... | n = int(input())
s = [int(i) for i in input().split()]
used = [0] * (2**n)
used[0] = 1
s.sort(reverse=True)
a = 1
b = [s[0]]
for _ in range(n):
c = b[:]
j = 0
for i in b:
while j < 2**n:
if used[j] == 0 and s[j] < i:
c.append(s[j])
used[j] = 1
... | replace | 8 | 9 | 8 | 9 | 0 | |
p02920 | C++ | Runtime Error | #pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define P pair
#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define V vector
#define RE return
#define ALL(a) a.begin(), a.end()
#define MP make... | #pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define P pair
#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define V vector
#define RE return
#define ALL(a) a.begin(), a.end()
#define MP make... | insert | 31 | 31 | 31 | 35 | 0 | |
p02920 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x... | replace | 22 | 23 | 22 | 23 | 0 | |
p02920 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
const int N = 1 << n;
multiset<int> st1;
for (int i = 0; i < N; ++i) {
int s;
cin >> s;
st1.insert(s);
}
int maxi = *st1.rbegin();
st1.erase(st1.find(maxi));
multiset<int> st2;
st2.insert(maxi);
while (st1.siz... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
const int N = 1 << n;
multiset<int> st1;
for (int i = 0; i < N; ++i) {
int s;
cin >> s;
st1.insert(s);
}
int maxi = *st1.rbegin();
st1.erase(st1.find(maxi));
multiset<int> st2;
st2.insert(maxi);
while (st1.siz... | replace | 21 | 22 | 21 | 22 | TLE | |
p02920 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int sz = pow(2, n);
vecto... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int sz = pow(2, n);
vecto... | replace | 62 | 63 | 62 | 63 | 0 | |
p02920 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <set>
using namespace std;
#define N 1000010
multiset<int> s;
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
f = -1;
c = getchar();
}
while (c >= '0' && c ... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <set>
using namespace std;
#define N 1000010
multiset<int> s;
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
f = -1;
c = getchar();
}
while (c >= '0' && c ... | replace | 35 | 36 | 35 | 36 | 0 | |
p02920 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma g++ optimize(2)
using namespace std;
int n, sum = 1;
int tot, root;
struct node {
int l, r;
int dat, val;
int size;
} f[200010];
void update(int p) { f[p].size = f[f[p].l].size + f[f[p].r].size + 1; }
int New(int val) {
f[++tot].val = val;
f[tot].dat = rand();
f[tot].size = ... | #include <bits/stdc++.h>
#pragma g++ optimize(2)
using namespace std;
int n, sum = 1;
int tot, root;
struct node {
int l, r;
int dat, val;
int size;
} f[2000010];
void update(int p) { f[p].size = f[f[p].l].size + f[f[p].r].size + 1; }
int New(int val) {
f[++tot].val = val;
f[tot].dat = rand();
f[tot].size =... | replace | 9 | 10 | 9 | 10 | 0 | |
p02921 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
// #pragma GCC optimize("Ofast","no-stack-protector","unroll-loops")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx,tune=naive")
// #pragma GCC diagnostic ignored "-W"
// #include<bits/extc++.h>
// using namespace __gnu_pbds;
using namespace std;
#define F(i, L, R)... | #include <bits/stdc++.h>
// #pragma GCC optimize("Ofast","no-stack-protector","unroll-loops")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx,tune=naive")
// #pragma GCC diagnostic ignored "-W"
// #include<bits/extc++.h>
// using namespace __gnu_pbds;
using namespace std;
#define F(i, L, R)... | replace | 30 | 35 | 30 | 34 | TLE | |
p02921 | C++ | Runtime Error | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int main() {
string S;
string T;
cin >> S;
cin >> T;
int ans = 0;
for (int i = 0; S.size(); i++) {
if (S[i] == T[i]) {
ans += 1;
}
}
... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
int main() {
string S;
string T;
cin >> S;
cin >> T;
int ans = 0;
for (int i = 0; i < S.size(); i++) {
if (S[i] == T[i]) {
ans += 1;
}
... | replace | 19 | 20 | 19 | 20 | -11 | |
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int ctoi(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
return 0;
}
int main() {
string s, t;
int count = 0;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i)) {
count++;
}
}
cout << count;
} | #include <bits/stdc++.h>
using namespace std;
int ctoi(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
return 0;
}
int main() {
string s, t;
cin >> s >> t;
int count = 0;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i)) {
count++;
}
}
cout << count;
} | insert | 10 | 10 | 10 | 11 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
int count = 0;
cin >> S >> T;
for (int i = 1; i <= 3; i++) {
if (S.at(i) == T.at(i)) {
count++;
}
}
cout << count << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
int count = 0;
cin >> S >> T;
for (int i = 0; i < 3; i++) {
if (S.at(i) == T.at(i)) {
count++;
}
}
cout << count << endl;
return 0;
} | replace | 7 | 8 | 7 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 3) >= this->size() (which is 3)
|
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <stdlib.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main() {
string s;
string t;
int ans = 0;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i)) {
ans++;
}
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
#include <stdlib.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main() {
string s;
string t;
cin >> s >> t;
int ans = 0;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i)) {
ans++;
}
}
cout << ans << endl;
}
| insert | 9 | 9 | 9 | 10 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02921 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
string s, t;
int ans = 0;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i)) {
ans++;
}
}
cout << ans << endl;
} | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i)) {
ans++;
}
}
cout << ans << endl;
} | insert | 9 | 9 | 9 | 10 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02921 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
for (int i = 0; i, 3; i++) {
if (s[i] == t[i])
ans++;
}
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
for (int i = 0; i < 3; i++) {
if (s[i] == t[i])
ans++;
}
cout << ans << endl;
return 0;
}
| replace | 11 | 12 | 11 | 12 | TLE | |
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define gc getchar_unlocked
#define cases \
int t; \
cin >> ... | #include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define gc getchar_unlocked
#define cases \
int t; \
cin >> ... | delete | 31 | 35 | 31 | 31 | 0 | |
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int cnt = 0;
string s, t;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i))
cnt++;
}
cout << cnt << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int cnt = 0;
string s, t;
cin >> s >> t;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i))
cnt++;
}
cout << cnt << endl;
return 0;
} | insert | 7 | 7 | 7 | 8 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(nullptr);
cout.tie(nullptr);
string s, t;
cin >> s >> t;
int count = 0;
if (s[0] == t[0])
count++;
if (s[1] == t[1])
count++;
if (s[2] == t[2])
count++;
return count;
cout << '\n';
retu... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(nullptr);
cout.tie(nullptr);
string s, t;
cin >> s >> t;
int count = 0;
if (s[0] == t[0])
count++;
if (s[1] == t[1])
count++;
if (s[2] == t[2])
count++;
cout << count;
cout << '\n';
ret... | replace | 20 | 21 | 20 | 21 | 2 | |
p02921 | Python | Runtime Error | s = input().split()
t = input().split()
ans = 0
for i in range(3):
if s[i] == t[i]:
ans += 1
print(ans)
| s = list(input())
t = list(input())
ans = 0
for i in range(3):
if s[i] == t[i]:
ans += 1
print(ans)
| replace | 0 | 2 | 0 | 2 | IndexError: list index out of range | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02921/Python/s694576581.py", line 6, in <module>
if s[i] == t[i]:
IndexError: list index out of range
|
p02921 | Python | Runtime Error | s, t = input()
print(sum(s[i] == t[i] for i in range(3)))
| s = input()
t = input()
print(sum(s[i] == t[i] for i in range(3)))
| replace | 0 | 1 | 0 | 2 | ValueError: too many values to unpack (expected 2) | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02921/Python/s393555435.py", line 1, in <module>
s, t = input()
ValueError: too many values to unpack (expected 2)
|
p02921 | Python | Runtime Error | def main(S, T):
count = 0
for i in range(len(S)):
if T[i] == S[i]:
count += 1
return count
if __name__ == "__main__":
S, T = map(str, input().split())
print(main(S, T))
| def main(S, T):
count = 0
for i in range(len(S)):
if T[i] == S[i]:
count += 1
return count
if __name__ == "__main__":
S = input()
T = input()
print(main(S, T))
| replace | 11 | 12 | 11 | 13 | ValueError: not enough values to unpack (expected 2, got 1) | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02921/Python/s746445364.py", line 12, in <module>
S, T = map(str, input().split())
ValueError: not enough values to unpack (expected 2, got 1)
|
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s, t;
int c = 0;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i)) {
c++;
}
}
cout << c << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int c = 0;
for (int i = 0; i < 3; i++) {
if (s.at(i) == t.at(i)) {
c++;
}
}
cout << c << endl;
}
| replace | 5 | 6 | 5 | 6 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02921 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define mod 1000000007
#define fst first
#define pb push_back
int main() {
string ... | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define mod 1000000007
#define fst first
#define pb push_back
int main() {
string ... | replace | 19 | 24 | 19 | 22 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 3) >= this->size() (which is 3)
|
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
#define N 100005
#define task "t"
#define mu(x) x *x
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using piii = pair<int, pii>;
const int inf = 1e9 + 7;
string s, t;
int main() {
ios::sync_with_stdio(false);
cin.tie();
cout.tie();
#ifndef ONLINE_JUDGE
freopen... | #include <bits/stdc++.h>
#define N 100005
#define task "t"
#define mu(x) x *x
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using piii = pair<int, pii>;
const int inf = 1e9 + 7;
string s, t;
int main() {
ios::sync_with_stdio(false);
cin.tie();
cout.tie();
#ifndef ONLINE_JUDGE
// fre... | replace | 18 | 20 | 18 | 20 | 0 | |
p02921 | C++ | Runtime Error | // ###### ###### ###### ######
// ###### ###### ###### ######
// ###### ###### ###### ######
// ###### ###### ###### ######
// ############ ############
// ############ ############
// ###### ###### ###### ######
// ###### ###### ... | // ###### ###### ###### ######
// ###### ###### ###### ######
// ###### ###### ###### ######
// ###### ###### ###### ######
// ############ ############
// ############ ############
// ###### ###### ###### ######
// ###### ###### ... | replace | 47 | 49 | 47 | 49 | 0 | |
p02921 | C++ | Runtime Error | /* while(!cin.eof()) */
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod (int)(1e9 + 7)
#define MAXI (int)(1e18 + 100)
#define N 1000200
int fre[N];
// Driver code to test above functions
int32_t main() {
#ifndef ONLINE_JUDGE
// for getting input from inpu.txt
freopen("input.txt",... | /* while(!cin.eof()) */
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod (int)(1e9 + 7)
#define MAXI (int)(1e18 + 100)
#define N 1000200
int fre[N];
// Driver code to test above functions
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
string s, ... | delete | 13 | 20 | 13 | 13 | 0 | |
p02921 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
string s, t;
int main() {
int cnt = 0;
rep(i, 3) {
if (s.at(i) == t.at(i)) {
cnt++;
}
}
cout << cnt << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
string s, t;
int main() {
cin >> s >> t;
int cnt = 0;
rep(i, 3) {
if (s.at(i) == t.at(i)) {
cnt++;
}
}
cout << cnt << endl;
return 0;
}
| insert | 8 | 8 | 8 | 9 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.