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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define sync ios_base::sync_with_stdio(false), cin.tie(NULL)
#define F first
#define S second
#define pb emplace_back
#define mt make_tuple
#define gcd __gcd
#define PI 3.141592653589
// Input
#define in(a) scanf("%d", &a)
#define in2(a, b) scanf("%d%d", &a, &b)
#define in3... | #include <bits/stdc++.h>
using namespace std;
#define sync ios_base::sync_with_stdio(false), cin.tie(NULL)
#define F first
#define S second
#define pb emplace_back
#define mt make_tuple
#define gcd __gcd
#define PI 3.141592653589
// Input
#define in(a) scanf("%d", &a)
#define in2(a, b) scanf("%d%d", &a, &b)
#define in3... | replace | 92 | 93 | 92 | 93 | 0 | |
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int>> mati;
typedef vector<vector<double>> matd;
type... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int>> mati;
typedef vector<vector<double>> matd;
type... | replace | 152 | 153 | 152 | 154 | 0 | |
p02851 | C++ | Time Limit Exceeded |
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <vector>
long long mod = 1e9 + 7;
class Mint {
public:
long long ... |
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <vector>
long long mod = 1e9 + 7;
class Mint {
public:
long long ... | replace | 122 | 123 | 122 | 123 | TLE | |
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 1000000007
#define LINF 100000000000000007LL
#define ll long long
using namespace std;
int a[114514], sum[114514];
signed main() {
int n, k;
cin >> n >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i]-... | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 1000000007
#define LINF 100000000000000007LL
#define ll long long
using namespace std;
int a[214514], sum[214514];
signed main() {
int n, k;
cin >> n >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i]-... | replace | 8 | 9 | 8 | 9 | 0 | |
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 1e5 + 7;
int n, k, sum[maxn], val[maxn], ans;
map<int, int> mp;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
if (fopen("test.inp", "r"))
freopen("test.inp", "r", stdin);
cin >> n >> k;
mp[0] = 1;
for (int... | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 2e5 + 7;
int n, k, sum[maxn], val[maxn], ans;
map<int, int> mp;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
if (fopen("test.inp", "r"))
freopen("test.inp", "r", stdin);
cin >> n >> k;
mp[0] = 1;
for (int... | replace | 3 | 4 | 3 | 4 | 0 | |
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define me BOSS
#define bug() cout << "AIkahne aise" << endl
#define PI acos(-1)
ll A[5000001], bin[5000001];
vector<ll> v;
map<int, int> myMap;
set<int> mySet;
vector<pair<ll, ll>> vp;
/* Precode Start Here *\
power of 2 less than or equal to N
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define me BOSS
#define bug() cout << "AIkahne aise" << endl
#define PI acos(-1)
ll A[5000001], bin[5000001];
vector<ll> v;
map<int, int> myMap;
set<int> mySet;
vector<pair<ll, ll>> vp;
/* Precode Start Here *\
power of 2 less than or equal to N
... | replace | 126 | 127 | 126 | 127 | 0 | |
p02851 | C++ | Runtime Error | // finish date: 2019/11/24
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int(i) = a; (i) < (b); (i)++)
#define rep(i, n) FOR(i, 0, n)
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vecto... | // finish date: 2019/11/24
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int(i) = a; (i) < (b); (i)++)
#define rep(i, n) FOR(i, 0, n)
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vecto... | replace | 47 | 48 | 47 | 48 | 0 | |
p02851 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#de... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#de... | replace | 29 | 30 | 29 | 30 | 0 | |
p02851 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <unor... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <unor... | replace | 612 | 619 | 612 | 618 | TLE | |
p02851 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;
Int N, K;
vector<Int> A(200010, 0), S(200010, 0);
Int id(Int i) {
Int res = S[i] - i;
while (res < 0)
res += K;
res %= K;
return re... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;
Int N, K;
vector<Int> A(200010, 0), S(200010, 0);
Int id(Int i) {
Int res = S[i] - i;
if (res >= 0) {
res %= K;
} else {
res = (K... | replace | 11 | 14 | 11 | 16 | TLE | |
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rint register int
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pr... | #include <bits/stdc++.h>
#define rint register int
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pr... | replace | 87 | 88 | 87 | 88 | -11 | |
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 100;
ll s[maxn];
ll a[maxn];
int main() {
int n, k;
cin >> n >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
s[i] = (s[i - 1] + a[i]);
}
for (int i = 1; i <= n; i++) {
s[i] = (s[i] - i) % k;
}
ma... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 100;
ll s[maxn];
ll a[maxn];
int main() {
int n, k;
cin >> n >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
s[i] = (s[i - 1] + a[i]);
}
for (int i = 1; i <= n; i++) {
s[i] = (s[i] - i) % k;
}
ma... | replace | 5 | 6 | 5 | 6 | 0 | |
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define to_s to_string
#define len(v) (ll) v.size()
#define UNIQUE(v) v.erase(uni... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define to_s to_string
#define len(v) (ll) v.size()
#define UNIQUE(v) v.erase(uni... | replace | 36 | 37 | 36 | 37 | 0 | |
p02851 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)
template <class T> void corner(bool flg, T hoge) {
if (flg) {
cout << hoge << endl;
exit(0);
}
}
#define all(v) v.begin(), v.end()
#define ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)
template <class T> void corner(bool flg, T hoge) {
if (flg) {
cout << hoge << endl;
exit(0);
}
}
#define all(v) v.begin(), v.end()
#define ... | replace | 24 | 25 | 24 | 26 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02852 | C++ | Runtime Error | #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... | replace | 35 | 36 | 35 | 36 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
u... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
u... | replace | 22 | 25 | 22 | 25 | 0 | |
p02852 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
int cnt = 0;
for (int i = 0; i < n + 1; i++) {
if (s[i] == '1') {
cnt++;
} else {
cnt = 0;
}
if (cnt > m) {
cout << -1 << endl;
return 0;
}
}
reverse(s.begi... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
int cnt = 0;
for (int i = 0; i < n + 1; i++) {
if (s[i] == '1') {
cnt++;
} else {
cnt = 0;
}
if (cnt >= m) {
cout << -1 << endl;
return 0;
}
}
reverse(s.beg... | replace | 14 | 15 | 14 | 15 | TLE | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
int n;
pair<int, int> seg[maxn], ans[maxn];
void upd(int p, int v) {
for (seg[p += n] = {v, p}; p > 1; p >>= 1)
seg[p >> 1] = min(seg[p], seg[p ^ 1]);
}
pair<int, int> qry(int l, int r) {
pair<int, int> ans = {1 << 30, 1 << 30};
for (l += ... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 300100;
int n;
pair<int, int> seg[maxn], ans[maxn];
void upd(int p, int v) {
for (seg[p += n] = {v, p}; p > 1; p >>= 1)
seg[p >> 1] = min(seg[p], seg[p ^ 1]);
}
pair<int, int> qry(int l, int r) {
pair<int, int> ans = {1 << 30, 1 << 30};
for (l += ... | replace | 2 | 3 | 2 | 3 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
#ifdef LOCAL_DEBUG
#define DEBUG 1
#define CERR \
if (DEBUG) \
cerr
#define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME
#define pr(...) ... | #include <bits/stdc++.h>
#ifdef LOCAL_DEBUG
#define DEBUG 1
#define CERR \
if (DEBUG) \
cerr
#define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME
#define pr(...) ... | replace | 183 | 184 | 183 | 184 | -6 | f41276d7-cb6b-413b-9666-5830930401c0.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02852/C++/s677913078.cpp:115: void RMQ<D, useAssert>::ifupdate(Int, Int, D) [with D = std::pair<long long int, long long int>; long long int useAssert = 1; Int = long long int]: Assertion `l >= 0 && r >= 0' failed.
|
p02852 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
// #define int long long
#define endl '\n'
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.ti... | #include <bits/stdc++.h>
// #define int long long
#define endl '\n'
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.ti... | replace | 59 | 61 | 59 | 62 | TLE | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
priority_queue<pii> Q;
int ans[100010];
int main() {
int n, m;
string s;
cin >> n >> m;
cin >> s;
// cout << n << ' ' << m << ' ' << s << endl;
fill(ans, ans + n + 1, -1);
... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
priority_queue<pii> Q;
int ans[100010];
int main() {
int n, m;
string s;
cin >> n >> m;
cin >> s;
// cout << n << ' ' << m << ' ' << s << endl;
fill(ans, ans + n + 1, -1);
... | insert | 24 | 24 | 24 | 26 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
/*
* coder :: ATUL_PANDEY_2608
* >>> INDIA <<<
*/
using namespace std;
using namespace __gn... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
/*
* coder :: ATUL_PANDEY_2608
* >>> INDIA <<<
*/
using namespace std;
using namespace __gn... | replace | 72 | 73 | 72 | 73 | -11 | |
p02852 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int n, m;
string s;
vector<int> v;
bool func(int now) {
if (now == 0) {
return true;
}
if (now < 0) {
return false;
}
for (int i = m; i >= 1; i--) {
int next = now - i;
if (s[n... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int n, m;
string s;
vector<int> v;
bool func(int now) {
if (now == 0) {
return true;
}
if (now < 0) {
return false;
}
for (int i = m; i >= 1; i--) {
int next = now - i;
if (s[n... | replace | 31 | 35 | 31 | 49 | TLE | |
p02852 | C++ | Runtime Error | #pragma GCC optimize("O3")
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using QWORD = uint64... | #pragma GCC optimize("O3")
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
using QWORD = uint64... | replace | 262 | 263 | 262 | 263 | -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)
|
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
int main() {
int n, m;
string s;
cin >> n >> m >> s;
vector<int> dp(n + 1, INF);
dp[n] = 0;
queue<int> q;
q.push(0);
for (int i = n - 1; i >= 0; --i) {
while... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
int main() {
int n, m;
string s;
cin >> n >> m >> s;
vector<int> dp(n + 1, INF);
dp[n] = 0;
queue<int> q;
q.push(0);
for (int i = n - 1; i >= 0; --i) {
while... | replace | 41 | 42 | 41 | 44 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>; template<typename T, typename L> using
gpp_map = tre... | #include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>; template<typename T, typename L> using
gpp_map = tre... | replace | 179 | 180 | 179 | 180 | 0 | |
p02852 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#define ALL(x) x.b... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#define ALL(x) x.b... | replace | 33 | 34 | 33 | 38 | TLE | |
p02852 | C++ | Time Limit Exceeded | // |. . . . . . . . . .| NEXT
// |. . . . . . . . . .| ______
// |. . . . . . . . . .| | |
// |. . . . . . . . . .| | OO |
// |. . . . . . . . . .| | OO |
// |. . . . . . . . . .| |______|
// |. . . . I . . . . .|
// |. . . . I . . . . .|
// |. . . . I . . . . .| PLAYER
... | // |. . . . . . . . . .| NEXT
// |. . . . . . . . . .| ______
// |. . . . . . . . . .| | |
// |. . . . . . . . . .| | OO |
// |. . . . . . . . . .| | OO |
// |. . . . . . . . . .| |______|
// |. . . . I . . . . .|
// |. . . . I . . . . .|
// |. . . . I . . . . .| PLAYER
... | insert | 66 | 66 | 66 | 67 | TLE | |
p02852 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#define REP(i, n) for (int i = 0; i < int(n); i++)
#define FOR(i, n, m) for (int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;
template <class Monoid> struct SegmentTree {
private:
using Fu... | #include "bits/stdc++.h"
#define REP(i, n) for (int i = 0; i < int(n); i++)
#define FOR(i, n, m) for (int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;
template <class Monoid> struct SegmentTree {
private:
using Fu... | replace | 97 | 98 | 97 | 98 | TLE | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll mod = 1e9 + 7;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
int now = n;
vector<int> ans;
while (now != 0) {
bool end = true;
for (int j = m; j >= 1; j--) {
if (s[now - j] == '0') {
now -= ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll mod = 1e9 + 7;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
int now = n;
vector<int> ans;
while (now != 0) {
bool end = true;
for (int j = m; j >= 1; j--) {
if (now < j)
continue;
if ... | insert | 15 | 15 | 15 | 17 | 0 | |
p02852 | C++ | Time Limit Exceeded | // x<<y=x*2^y,x>>y=x/2^y
// 1<<31 gives overflow
// while using ?: in add/subt use bracket
// use ll() for using an integer in self-built fn
//(x&-x) bitwise and of (x and its 2's complement) returns (last set bit)
// eg if x=1010 then it will return 0010
// careful dont print empty container(run time error)
// v.era... | // x<<y=x*2^y,x>>y=x/2^y
// 1<<31 gives overflow
// while using ?: in add/subt use bracket
// use ll() for using an integer in self-built fn
//(x&-x) bitwise and of (x and its 2's complement) returns (last set bit)
// eg if x=1010 then it will return 0010
// careful dont print empty container(run time error)
// v.era... | replace | 219 | 220 | 219 | 220 | TLE | |
p02852 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fix20 cout << fixed << setprecision(20);
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1000000007
int main() {
int n, m;
string s;
cin >> n >> m >> s;
vector<int> step(n + 1, 1e9);
step.at(n) = 0;
int pos = n;
int d = 1;
while (po... | #include <bits/stdc++.h>
using namespace std;
#define fix20 cout << fixed << setprecision(20);
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1000000007
int main() {
int n, m;
string s;
cin >> n >> m >> s;
int cnt = 0;
rep(i, n + 1) {
if (s.at(i) == '1')
cnt++;
else
cnt ... | insert | 10 | 10 | 10 | 21 | TLE | |
p02852 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define INF 1000000009
#define LINF 1000000000000000009
#define double long double
#define all(a) a.beg... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define INF 1000000009
#define LINF 1000000000000000009
#define double long double
#define all(a) a.beg... | replace | 89 | 90 | 89 | 91 | 0 | |
p02852 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
#ifdef ... | #include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
#ifdef ... | replace | 38 | 39 | 38 | 39 | TLE | |
p02852 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <bitset>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#in... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <bitset>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#in... | replace | 91 | 92 | 91 | 92 | 0 | |
p02852 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mid (l + r) / 2
#define L (x << 1)
#define R (L + 1)
pair<int, int> tree[1000000];
string s;
void build(int x, int l, int r) {
if (l == r) {
tree[x] = {1e9, l};
} else {
build(L, l, mid);
build(R, mid + 1, r);
tree[x] = min(t... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mid (l + r) / 2
#define L (x << 1)
#define R (L + 1)
pair<int, int> tree[1000000];
string s;
void build(int x, int l, int r) {
if (l == r) {
tree[x] = {1e9, l};
} else {
build(L, l, mid);
build(R, mid + 1, r);
tree[x] = min(t... | replace | 61 | 62 | 61 | 62 | TLE | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
// template {{{ 0
// using {{{ 1
using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scan... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
// template {{{ 0
// using {{{ 1
using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scan... | replace | 172 | 173 | 172 | 173 | 0 | |
p02852 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include ... | replace | 191 | 193 | 191 | 193 | 0 | |
p02852 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC target("avx")
#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... | #pragma GCC optimize("O3")
#pragma GCC target("avx")
#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... | replace | 54 | 55 | 54 | 55 | 0 | |
p02852 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <... | replace | 140 | 141 | 140 | 141 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; ++i)
#define all(a) (a).begin(), (a).end()
int N, M;
string S;
int main() {
cin >> N >> M >> S;
stack<int> m;
int i = N;
while (i != 0) {
bool found = false;
for (int j = i - M; j < i; ++... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; ++i)
#define all(a) (a).begin(), (a).end()
int N, M;
string S;
int main() {
cin >> N >> M >> S;
stack<int> m;
int i = N;
while (i != 0) {
bool found = false;
for (int j = i - M; j < i; ++... | replace | 17 | 18 | 17 | 18 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int, int>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define all(v) v.begin(), v.end()
#define pb push_back
int dx[] = {0, ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int, int>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define all(v) v.begin(), v.end()
#define pb push_back
int dx[] = {0, ... | replace | 75 | 76 | 75 | 76 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// #define int long long
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <=... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// #define int long long
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <=... | replace | 46 | 47 | 46 | 47 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;
template <class M> class segment_tree {
public:
typedef typename M::value_type value_type;
size_t n;
vector<value_type> v;
value_type e = M::unit();
segment_tree(size_t size) {
n = 1;
while (n < size)
n <<= 1;
v.resize(... | #include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;
template <class M> class segment_tree {
public:
typedef typename M::value_type value_type;
size_t n;
vector<value_type> v;
value_type e = M::unit();
segment_tree(size_t size) {
n = 1;
while (n < size)
n <<= 1;
v.resize(... | replace | 102 | 103 | 102 | 103 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <cmath>
const double PI = 3.14159265358979323846;
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
// #define rep(i, n) for (ll i = 0; i < (n); ++i)
// typedef pair<ll, ll> P;
typedef pair<ll, ll> P;
const ll INF = 10e... | #include <bits/stdc++.h>
#include <cmath>
const double PI = 3.14159265358979323846;
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
// #define rep(i, n) for (ll i = 0; i < (n); ++i)
// typedef pair<ll, ll> P;
typedef pair<ll, ll> P;
const ll INF = 10e... | replace | 110 | 111 | 110 | 111 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 100010
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
string s;
cin >> s;
int now = n;
vector<int> ans;
while (now > 0) {
bool ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 100010
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
string s;
cin >> s;
int now = n;
vector<int> ans;
while (now > 0) {
bool ... | replace | 24 | 25 | 24 | 25 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
template <typename Monoid> struct SegmentTree {
using F = function<Monoid(Monoid, Monoid)>;
int sz;
vector<Monoid> seg;
const F f;
const Monoid M1;
SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
sz = 1;
while ... | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
template <typename Monoid> struct SegmentTree {
using F = function<Monoid(Monoid, Monoid)>;
int sz;
vector<Monoid> seg;
const F f;
const Monoid M1;
SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
sz = 1;
while ... | replace | 106 | 107 | 106 | 107 | 0 | |
p02852 | Python | Time Limit Exceeded | n, m = map(int, input().split())
s = input()
s = s[::-1]
if s[0] == "1":
print(-1)
exit()
pre = [-1] * (n + 1)
stack = [0]
while stack:
now = stack.pop()
if now == n:
break
for i in range(1, m + 1):
tsugi = now + i
if tsugi > n:
continue
if s[tsugi] == "1"... | n, m = map(int, input().split())
s = input()
out_s = "1" * (m)
if out_s in s:
print(-1)
exit()
s = s[::-1]
if s[0] == "1":
print(-1)
exit()
pre = [-1] * (n + 1)
stack = [0]
while stack:
now = stack.pop()
if now == n:
break
for i in range(1, m + 1):
tsugi = now + i
if ... | insert | 2 | 2 | 2 | 6 | TLE | |
p02852 | Python | Time Limit Exceeded | import sys
sys.setrecursionlimit(10**9)
n, m = map(int, input().split())
s = input()
def solve(t):
if len(t) <= m + 1:
return [len(t) - 1]
for i in reversed(range(1, m + 1)):
if t[len(t) - 1 - i] == "0":
cand = solve(t[:-i])
if len(cand) != 0:
cand.app... | import sys
sys.setrecursionlimit(10**9)
n, m = map(int, input().split())
s = input()
def solve(t):
if len(t) <= m + 1:
return [len(t) - 1]
for i in reversed(range(1, m + 1)):
if t[len(t) - 1 - i] == "0":
cand = solve(t[:-i])
if len(cand) != 0:
cand.app... | replace | 35 | 36 | 35 | 40 | TLE | |
p02852 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
#define sz(a) int((a).size())
#define all... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
#define sz(a) int((a).size())
#define all... | replace | 64 | 65 | 64 | 65 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for (int i = x; i < y; i++)
#define range(a) (a).begin(), (a).end()
#define print(A, n) \
rep(i, 0, n) { cout << (i ? " " : "") << A[i]; } \
cout << endl;
#define... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for (int i = x; i < y; i++)
#define range(a) (a).begin(), (a).end()
#define print(A, n) \
rep(i, 0, n) { cout << (i ? " " : "") << A[i]; } \
cout << endl;
#define... | replace | 27 | 28 | 27 | 28 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define li long long int
#define rep(i, to) for (li i = 0; i < ((li)(to)); i++)
#define repp(i, start, to) for (li i = (li)(start); i < ((li)(to)); i++)
#define pb push_back
#define sz(v) ((li)(v).size())
#define bgn(v) ((v).begin())
#define eend(v) ((v).end())
#define all... | #include <bits/stdc++.h>
using namespace std;
#define li long long int
#define rep(i, to) for (li i = 0; i < ((li)(to)); i++)
#define repp(i, start, to) for (li i = (li)(start); i < ((li)(to)); i++)
#define pb push_back
#define sz(v) ((li)(v).size())
#define bgn(v) ((v).begin())
#define eend(v) ((v).end())
#define all... | replace | 149 | 150 | 149 | 150 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, M;
string S;
cin >> N >> M >> S;
if (S.front() != '0') {
cout << -1 << endl;
}
if (S.back() != '0') {
cout << -1 << endl;
}
reverse(S.begin(), S.end());
vector<bool> over(S.size());
for (int i = 0; i < over.size(); i+... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long N, M;
string S;
cin >> N >> M >> S;
if (S.front() != '0') {
cout << -1 << endl;
}
if (S.back() != '0') {
cout << -1 << endl;
}
reverse(S.begin(), S.end());
vector<bool> over(S.size());
for (int i = 0; i < over.size(); i+... | replace | 46 | 47 | 46 | 47 | 0 | |
p02852 | C++ | Runtime Error | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int n, m;
cin >> n >> m;
char s[100010];
cin >> s;
int r = 0, idx = 0;
while (idx < n) {
... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
int n, m;
cin >> n >> m;
char s[100010];
cin >> s;
int r = 0, idx = 0;
while (idx < n) {
... | replace | 25 | 26 | 25 | 26 | 0 | |
p02852 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>
using namespace std;
typedef l... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>
using namespace std;
typedef l... | replace | 116 | 117 | 116 | 117 | 0 | |
p02852 | C++ | Runtime Error | // includes {{{
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
// #include<deque>
// #include<multiset>
// #include<c... | // includes {{{
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
// #include<deque>
// #include<multiset>
// #include<c... | insert | 174 | 174 | 174 | 176 | 0 | |
p02852 | C++ | Time Limit Exceeded | #pragma target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + ... | #pragma target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + ... | replace | 50 | 51 | 50 | 51 | TLE | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
// #pragma optimization_level 3
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #... | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
// #pragma optimization_level 3
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #... | replace | 156 | 157 | 156 | 157 | 0 | |
p02852 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long int ll;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n, k;
cin >> n >> k;
string s;
cin >> s;
int now = n;
vector<int> an... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long int ll;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n, k;
cin >> n >> k;
string s;
cin >> s;
int now = n;
vector<int> an... | replace | 21 | 22 | 21 | 22 | TLE | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
vector<int> ans;
int t = n;
while (t != 0) {
int i = m;
for (i = m; i >= 0; i--) {
if (s[t - i] == '0') {
ans.push_back(i);
t -= i;
break;
}
}
if (i =... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
string s;
cin >> s;
vector<int> ans;
int t = n;
while (t != 0) {
int i = m;
for (i = min(t, m); i >= 0; i--) {
if (s[t - i] == '0') {
ans.push_back(i);
t -= i;
break;
}
}
... | replace | 11 | 12 | 11 | 12 | 0 | |
p02852 | C++ | Runtime Error | #include <deque>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main() {
int n, m;
string s;
cin >> n >> m >> s;
vector<int> ans(n);
deque<pair<int, int>> d;
for (int i = 0; i < n; i++) {
ans[i] = -1;
}
ans[n] = 0;
d.push_back({0, n});
for (i... | #include <deque>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main() {
int n, m;
string s;
cin >> n >> m >> s;
vector<int> ans(n + 1);
deque<pair<int, int>> d;
for (int i = 0; i < n; i++) {
ans[i] = -1;
}
ans[n] = 0;
d.push_back({0, n});
fo... | replace | 11 | 12 | 11 | 12 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(name) name.begin(), name.end()
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#define ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(name) name.begin(), name.end()
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#define ... | insert | 101 | 101 | 101 | 104 | 0 | |
p02852 | C++ | Runtime Error | // May this submission get accepted!
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
#include <bits/stdc++.h>
// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i, n) for (long long i = 0, i##_len = (n); i < i##_len; i++)
#define RANGE(i, is, ie) ... | // May this submission get accepted!
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
#include <bits/stdc++.h>
// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i, n) for (long long i = 0, i##_len = (n); i < i##_len; i++)
#define RANGE(i, is, ie) ... | replace | 123 | 124 | 123 | 124 | 0 | |
p02852 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define RREP(i, n) for (int i = (int)n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = s; i < (int)n; i++)
#define RFOR(i, s, n) for (int i = (int)n - 1; i >= s; i--)
#define ALL(a) a.begin(), a.... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define RREP(i, n) for (int i = (int)n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = s; i < (int)n; i++)
#define RFOR(i, s, n) for (int i = (int)n - 1; i >= s; i--)
#define ALL(a) a.begin(), a.... | insert | 35 | 35 | 35 | 37 | 0 | |
p02852 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <ve... | #include <algorithm>
#include <bitset>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <ve... | replace | 44 | 45 | 44 | 45 | 0 | |
p02852 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, cc, n) for (int i = cc; i <= n; ++i)
#define drep(i, cc, n) for (int i = cc; i >= n; --i)
#define sz(s) (int)(s.size())
#define vecprint(v) \
rep(i, 0, v.size() - 1) cout << v[i] << " "; ... | #include <bits/stdc++.h>
#define rep(i, cc, n) for (int i = cc; i <= n; ++i)
#define drep(i, cc, n) for (int i = cc; i >= n; --i)
#define sz(s) (int)(s.size())
#define vecprint(v) \
rep(i, 0, v.size() - 1) cout << v[i] << " "; ... | insert | 37 | 37 | 37 | 48 | TLE | |
p02852 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int n, m, res[100001], cnt = 0;
int book[100001], jud = 1;
string s;
void dfs(int x) {
if (x == 0) {
for (int i = cnt - 1; i >= 0; i--) {
if (i != cnt - 1)
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int n, m, res[100001], cnt = 0;
int book[100001], jud = 1;
string s;
void dfs(int x) {
if (x == 0) {
for (int i = cnt - 1; i >= 0; i--) {
if (i != cnt - 1)
... | replace | 26 | 29 | 26 | 27 | TLE | |
p02852 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 2e5 + 10, mod = 1e9 + 7;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
string s;
cin >> s;
int cur = n, lst = -1, ch = n - 1;
vector<i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 2e5 + 10, mod = 1e9 + 7;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
string s;
cin >> s;
int cur = n, lst = -1, ch = n - 1;
vector<i... | insert | 28 | 28 | 28 | 29 | TLE | |
p02852 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
string str;
set<int> canmove;
cin >> n >> m;
cin >> str;
if (str.find(string(m, '1')) != stri... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
string str;
set<int> canmove;
cin >> n >> m;
cin >> str;
if (str.find(string(m, '1')) != stri... | insert | 20 | 20 | 20 | 28 | TLE | |
p02852 | C++ | Time Limit Exceeded | #pragma GCC optimize(2)
#include <bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define eps 1e-10
using namespace std;
inline int read() {
int x = 0, w = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
w = -1;
c = getchar();
}
while (c <= '9' && c >=... | #pragma GCC optimize(2)
#include <bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define eps 1e-10
using namespace std;
inline int read() {
int x = 0, w = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
w = -1;
c = getchar();
}
while (c <= '9' && c >=... | replace | 34 | 35 | 34 | 35 | TLE | |
p02853 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<string, int>;
const double PI = acos(-1);
int main() {
int x, y;
cin >> x >> y;
vector<int> a = {300000, 200000, 100000};
int ans = 0;
ans += a.at(x - 1);
ans += a.at(y - ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<string, int>;
const double PI = acos(-1);
int main() {
int x, y;
cin >> x >> y;
vector<int> a = {300000, 200000, 100000};
int ans = 0;
if (x <= 3)
ans += a.at(x - 1);
... | replace | 12 | 14 | 12 | 16 | 0 | |
p02853 | C++ | Runtime Error | #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen... | #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// #ifndef ONLINE_JUDGE
/... | replace | 10 | 14 | 10 | 14 | -11 | |
p02853 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define MAX 1000000007
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ub upper_bound
#define lb lower_bound
#define zoom ... | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define MAX 1000000007
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ub upper_bound
#define lb lower_bound
#define zoom ... | delete | 19 | 24 | 19 | 19 | 0 | |
p02853 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int x, y;
cin >> x >> y;
long long ans = 0;
int a[3] = {300000, 200000, 100000};
if (x <= 3)
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
long long ans = 0;
int a[3] = {300000, 200000, 100000};
if (x <= 3)
ans += a[x - 1];
if (y <= 3)
ans += a[y - 1];
if (x == 1 && y == 1)
ans += 400000;
cout << ans;
return 0;
} | replace | 4 | 10 | 4 | 5 | 0 | |
p02853 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define endl "\n"
#define ll long long
#define oo 0x3f3f3f3fLL
#define sz(s) (int)(s.size())
#define RT(s) return cout << s, 0
#define INF 0x3f3f3f3f3f3f3f3fLL
#define all(v) v.begin(), v.end()
#define watch(x) cout << (#x) ... | #include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define endl "\n"
#define ll long long
#define oo 0x3f3f3f3fLL
#define sz(s) (int)(s.size())
#define RT(s) return cout << s, 0
#define INF 0x3f3f3f3f3f3f3f3fLL
#define all(v) v.begin(), v.end()
#define watch(x) cout << (#x) ... | delete | 18 | 23 | 18 | 18 | -11 | |
p02854 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main() {
size_t N;
cin >> N;
vector<size_t> A;
for (size_t i = 0; i < N; i++) {
size_t a;
cin >> a;
A.emplace_back(a);
}
size_t sumA = A[0];
size_t idxA = 1;
size_t sumB = 0;
size_t idxB = N - 1;
while (true) {
if (s... | #include <iostream>
#include <vector>
using namespace std;
int main() {
size_t N;
cin >> N;
vector<size_t> A;
for (size_t i = 0; i < N; i++) {
size_t a;
cin >> a;
A.emplace_back(a);
}
if (A.size() == 2) {
if (A[0] < A[1]) {
cout << A[1] - A[0] << endl;
} else {
cout << A[... | insert | 14 | 14 | 14 | 23 | 0 | |
p02854 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
using ll = long long;
int main() {
ll N;
cin >> N;
ll L = 0; // 全長
vector<ll> A(N);
for (int i = 0; i < N; i++) {
ll a;
cin >> a;
L += a;
A[i] = a;
}
vector<vector<ll>> B(2, vector<ll>(N - 1));
priority_queue<ll, vector<ll>... | #include <bits/stdc++.h>
#include <chrono>
using namespace std;
using ll = long long;
int main() {
ll N;
cin >> N;
ll L = 0; // 全長
vector<ll> A(N);
for (int i = 0; i < N; i++) {
ll a;
cin >> a;
L += a;
A[i] = a;
}
vector<vector<ll>> B(2, vector<ll>(N - 1));
priority_queue<ll, vector<ll>... | replace | 21 | 22 | 21 | 22 | 0 | |
p02854 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>
using namespace std;
typedef l... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>
using namespace std;
typedef l... | replace | 75 | 81 | 75 | 83 | TLE | |
p02854 | C++ | Runtime Error | /* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>
// algorithm library
#include <algorithm>
#include <cmath>
#include <cstring>
#include <numeric>
#include <random>
// container library
#include <array>
#include <bitset... | /* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>
// algorithm library
#include <algorithm>
#include <cmath>
#include <cstring>
#include <numeric>
#include <random>
// container library
#include <array>
#include <bitset... | replace | 51 | 52 | 51 | 52 | -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)
|
p02854 | C++ | Runtime Error | #include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
ll a[100010];
int main() {
int n;
while (cin >> n) {
ll ans = 0, tmp = 0, sm = 0, tmp1;
for (int i = 0; i < n; ++i) {
scanf("%lld", a + i);
sm += a[... | #include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
ll a[2020010];
int main() {
int n;
while (cin >> n) {
ll ans = 0, tmp = 0, sm = 0, tmp1;
for (int i = 0; i < n; ++i) {
scanf("%lld", a + i);
sm += a... | replace | 7 | 8 | 7 | 8 | 0 | |
p02854 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, n) for (int i = 1; i <= n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rreps(i, n) for (int i = n; i >= 1; i--)
#define mrep(i, from, n) for (int i = from; i < n; i++)
#define mreps(i, from, ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, n) for (int i = 1; i <= n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rreps(i, n) for (int i = n; i >= 1; i--)
#define mrep(i, from, n) for (int i = from; i < n; i++)
#define mreps(i, from, ... | replace | 34 | 36 | 34 | 36 | 0 | |
p02854 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define endl "\n"
typedef long long ll;
typedef string str;
const double pi = 3.14159265358979323846;
const long long inf = 1LL << 60;
int ctoi(const char c) {
if ('0' <= c && c <= '9')
return (c - '0');
ret... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define endl "\n"
typedef long long ll;
typedef string str;
const double pi = 3.14159265358979323846;
const long long inf = 1LL << 60;
int ctoi(const char c) {
if ('0' <= c && c <= '9')
return (c - '0');
ret... | replace | 271 | 273 | 271 | 273 | TLE | |
p02854 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;
int main() {
i... | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;
int main() {
i... | replace | 19 | 20 | 19 | 20 | 0 | |
p02854 | 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() {
// 制約見て!!!デカかったらlong longにすること!
int n;
cin >> n;
vector<long> a(n);
rep(i, n) cin >> a[i];
long m = INT64_MAX;
rep(i, n) {
long left = 0;
rep(j, i + 1) { left += a[j]; ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
int main() {
// 制約見て!!!デカかったらlong longにすること!
int n;
cin >> n;
vector<long> a(n);
rep(i, n) cin >> a[i];
long m = INT64_MAX;
long sum = 0;
rep(i, n) sum += a[i];
long left = a[0];
long... | replace | 12 | 20 | 12 | 21 | TLE | |
p02854 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int test[123456];
int main() {
long long n, k, sum = 0, num = 1234567891230, a = 0;
cin >> n;
for (int h = 0; h < n; h++) {
cin >> k;
sum += k;
test[h] = k;
}
for (int h = 0; h < n; h++) {
num = min(abs(a - (sum - ... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int test[213456];
int main() {
long long n, k, sum = 0, num = 1234567891230, a = 0;
cin >> n;
for (int h = 0; h < n; h++) {
cin >> k;
sum += k;
test[h] = k;
}
for (int h = 0; h < n; h++) {
num = min(abs(a - (sum - ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02854 | Python | Time Limit Exceeded | N = int(input())
arr = list(map(int, input().split()))
min_delta = sum(arr)
for i in range(1, N):
min_delta = min(abs(sum(arr[:i]) - sum(arr[i:])), min_delta)
print(min_delta)
| N = int(input())
arr = list(map(int, input().split()))
first = 0
second = sum(arr)
min_delta = second - first
for i in range(N):
first += arr[i]
second -= arr[i]
min_delta = min(abs(second - first), min_delta)
print(min_delta)
| replace | 2 | 5 | 2 | 9 | TLE | |
p02854 | Python | Runtime Error | N = int(input())
A = list(map(int, input().split()))
L, R, df = 0, N - 1, A[0] - A[N - 1]
while R - L > 1:
if df < 0:
L += (1,)
df += A[L]
else:
R -= 1
df -= A[R]
print(abs(df))
| N = int(input())
A = list(map(int, input().split()))
L, R, df = 0, N - 1, A[0] - A[N - 1]
while R - L > 1:
if df < 0:
L += 1
df += A[L]
else:
R -= 1
df -= A[R]
print(abs(df))
| replace | 6 | 7 | 6 | 7 | TypeError: unsupported operand type(s) for +=: 'int' and 'tuple' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02854/Python/s340152642.py", line 7, in <module>
L += 1,
TypeError: unsupported operand type(s) for +=: 'int' and 'tuple'
|
p02854 | Python | Time Limit Exceeded | n = int(input())
a = list(map(int, input().split()))
ans = 10**10
for i in range(1, len(a)):
ans = min(ans, abs(sum(a[:i]) - sum(a[i:])))
print(ans)
| n = int(input())
a = list(map(int, input().split()))
L = sum(a)
l = 0
i = 0
while l < L / 2:
l += a[i]
i += 1
print(min(abs(sum(a[: i - 1]) - sum(a[i - 1 :])), abs(sum(a[:i]) - sum(a[i:]))))
| replace | 2 | 6 | 2 | 9 | TLE | |
p02854 | Python | Time Limit Exceeded | #!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
s = sum(a)
r = [sum(a[: i + 1]) for i in range(n)]
print(min(abs(2 * i - s) for i in r))
| #!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
s = sum(a)
r = [a[0]]
for i in range(1, n):
r.append(r[i - 1] + a[i])
print(min(abs(2 * i - s) for i in r))
| replace | 3 | 4 | 3 | 6 | TLE | |
p02854 | Python | Time Limit Exceeded | n = int(input())
a = list(map(int, input().split()))
x = 2020202020
for i in range(1, n):
x = min(x, abs(sum(a[:i]) - sum(a[i:])))
print(x)
| n = int(input())
a = list(map(int, input().split()))
x = 0
y = sum(a)
ans = 2020202020
for i in range(n - 1):
x += a[i]
y -= a[i]
ans = min(ans, abs(x - y))
print(ans)
| replace | 2 | 6 | 2 | 10 | TLE | |
p02854 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n, mid, i, a[100], sum = 0, l = 0, ta, ans;
cin >> n;
for (i = 0; i < n; i++) {
cin >> a[i... | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n, mid, i, a[500000], sum = 0, l = 0, ta, ans;
cin >> n;
for (i = 0; i < n; i++) {
cin >> ... | replace | 12 | 13 | 12 | 13 | 0 | |
p02854 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
int main() {
int N;
cin >> N;
vec<ll> A(N), S(N, 0);
for (int i = 0; i < N; i++) {
cin >> A[i];
S[i + 1] = S[i] + A... | #include <cmath>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
int main() {
int N;
cin >> N;
vec<ll> A(N), S(N + 1, 0);
for (int i = 0; i < N; i++) {
cin >> A[i];
S[i + 1] = S[i]... | replace | 11 | 12 | 11 | 12 | -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)
|
p02854 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
#define INF (1e9)
ll N;
int main() {
cin >> N;
vi A(N - 1);
ll S = 0;
for (int i = 0; i < N; i++) {
... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
#define INF (1e9)
ll N;
int main() {
cin >> N;
vi A(N);
ll S = 0;
for (int i = 0; i < N; i++) {
ci... | replace | 19 | 20 | 19 | 20 | 0 | |
p02854 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF 9223372036854775807LL
#define inf 1000000007
#define lol long long
#define abs(x, y) (max(x, y) - min(x, y))
#define mp make_pair
#define fi first
#define se second
using namespace std;
int i[100005];
lol sum[100005];
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
lo... | #include <bits/stdc++.h>
#define INF 9223372036854775807LL
#define inf 1000000007
#define lol long long
#define abs(x, y) (max(x, y) - min(x, y))
#define mp make_pair
#define fi first
#define se second
using namespace std;
int i[100005];
lol sum[200005];
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
lo... | replace | 10 | 11 | 10 | 11 | 0 | |
p02854 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
long long int a[20005], sum = 0;
int main(void) {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
long long b = sum / 2, c = 0, ans = 1e18;
for (int i = 0; i < n; i++) {
c... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
long long int a[200005], sum = 0;
int main(void) {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += a[i];
}
long long b = sum / 2, c = 0, ans = 1e18;
for (int i = 0; i < n; i++) {
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02854 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
int n;
ll ans = 404040404000000, dif;
ll sum = 0;
cin >> n;
vector<int> a(n);
rep(i, n) {
cin >> a.at(i);
sum += a.at(i);
}
for (int i = 1; i < n; ++i) {
ll left ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
int n;
ll ans = 404040404000000, dif;
ll sum = 0;
cin >> n;
vector<int> a(n);
rep(i, n) {
cin >> a.at(i);
sum += a.at(i);
}
ll left = 0, right;
for (int i = 0; i < ... | replace | 15 | 21 | 15 | 18 | TLE | |
p02854 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (... | #include <algorithm>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (... | replace | 115 | 116 | 115 | 116 | 0 | |
p02854 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < ((ll)(n)); i++)
#define reg(i, a, b) for (ll i = ((ll)(a)); i <= ((ll)(b)); i++)
#define irep(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define ireg(i, a, b) for (ll i = ((ll)(b)); i >= ((ll)(a)); i--)
template <c... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < ((ll)(n)); i++)
#define reg(i, a, b) for (ll i = ((ll)(a)); i <= ((ll)(b)); i++)
#define irep(i, n) for (ll i = ((ll)(n)-1); i >= 0; i--)
#define ireg(i, a, b) for (ll i = ((ll)(b)); i >= ((ll)(a)); i--)
template <c... | replace | 14 | 16 | 14 | 15 | 0 | |
p02854 | C++ | Time Limit Exceeded | #include <iostream>
#include <math.h>
#include <stdlib.h>
#include <vector>
using namespace std;
long long int Sum(vector<int> A, int i, int j) {
long long int sum = 0;
for (int k = i; k < j; k++) {
sum += A[k];
}
return sum;
}
long long int FIND(vector<int> A, long long int sum) {
double inf = INFINITY... | #include <iostream>
#include <math.h>
#include <stdlib.h>
#include <vector>
using namespace std;
long long int Sum(vector<int> A, int i, int j) {
long long int sum = 0;
for (int k = i; k < j; k++) {
sum += A[k];
}
return sum;
}
long long int FIND(vector<int> A, long long int sum) {
double inf = INFINITY... | replace | 18 | 20 | 18 | 20 | TLE | |
p02854 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; (i) < (n); i++)
#define rep1(i, n) ... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; (i) < (n); i++)
#define rep1(i, n) ... | replace | 38 | 39 | 38 | 39 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.