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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02664 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
string t;
cin >> t;
long num = t.size() - 1;
rep(i, t.size()) {
if (t.at(i) == '?') {
if (i == 0) {
if (t.at(i + 1) == 'P') {
t.at(i) = 'D';
} else {
t.... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
string t;
cin >> t;
long num = t.size() - 1;
rep(i, t.size()) {
if (t.at(i) == '?') {
if (i == 0) {
t.at(i) = 'D';
} else if (i == num) {
t.at(i) = 'D';
} else ... | replace | 12 | 17 | 12 | 13 | 0 | |
p02664 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define N 233
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 <= '9') {
x = (x << 1) + (x << 3) + c - '0';
c = ... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define N 200020
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 <= '9') {
x = (x << 1) + (x << 3) + c - '0';
c... | replace | 4 | 5 | 4 | 5 | 0 | |
p02664 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ll t = 1;
// cin >> t;
while (t--) {
string s;
cin >> s;
string ans = "";
for (int i = 0; i <... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ll t = 1;
// cin >> t;
while (t--) {
string s;
cin >> s;
std::replace(s.begin(), s.end(), '?', 'D... | replace | 17 | 25 | 17 | 19 | TLE | |
p02664 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
int main... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
int main... | replace | 18 | 24 | 18 | 24 | -11 | |
p02664 | C++ | Time Limit Exceeded | #include <iostream>
#include <string.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.find("?") == string::npos) {
cout << s;
// cout << "? ga naiyo\n";
return 0;
}
size_t position_Phatena = 0;
size_t position_2hatena = 0;
size_t position_hatenaD = 0;
size_t position_hatena ... | #include <iostream>
#include <string.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.find("?") == string::npos) {
cout << s;
// cout << "? ga naiyo\n";
return 0;
}
size_t position_Phatena = 0;
size_t position_2hatena = 0;
size_t position_hatenaD = 0;
size_t position_hatena ... | replace | 20 | 27 | 20 | 27 | TLE | |
p02664 | C++ | Time Limit Exceeded | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define MOOD 1000000007
const double PI = 3.14159265358979323846;
using namespace std;
using ll = long long;
using P = pair<int, int>;
int cmpnum(const v... | #include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define MOOD 1000000007
const double PI = 3.14159265358979323846;
using namespace std;
using ll = long long;
using P = pair<int, int>;
int cmpnum(const v... | replace | 282 | 283 | 282 | 284 | TLE | |
p02664 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
char arr[200000 + 10];
int main() {
scanf("%s", arr);
for (int i = 0; i < strlen(arr); i++) {
if (arr[i] != '?')
printf("%c", arr[i]);
else
printf("D");
}
printf("\n");
ret... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;
char arr[200000 + 10];
int main() {
scanf("%s", arr);
int len = strlen(arr);
for (int i = 0; i < len; i++) {
if (arr[i] != '?')
printf("%c", arr[i]);
else
printf("D");
}
pr... | replace | 11 | 12 | 11 | 13 | TLE | |
p02664 | C++ | Runtime Error | // Postdocs
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i, x, y) for (ll i = x; i < y; i++)
#define irep(i, a) for (auto i = a.begin(); i != a.end(); ++i)
#define nvarep(n, a) \
ll n; ... | // Postdocs
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i, x, y) for (ll i = x; i < y; i++)
#define irep(i, a) for (auto i = a.begin(); i != a.end(); ++i)
#define nvarep(n, a) \
ll n; ... | replace | 48 | 61 | 48 | 51 | 0 | |
p02664 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
namespace HABIT {
#define f(a, b, c, d) for (register int a = b, c = d; a <= c; a++)
#define g(a, b, c, d) for (register int a = b, c = d; a >= c; a--)
#define LOCAL
typedef int i32;
typedef unsigned int u32;
typedef long long int i64;
typedef unsigned long long int u64;
t... | #include <bits/stdc++.h>
using namespace std;
namespace HABIT {
#define f(a, b, c, d) for (register int a = b, c = d; a <= c; a++)
#define g(a, b, c, d) for (register int a = b, c = d; a >= c; a--)
#define LOCAL
typedef int i32;
typedef unsigned int u32;
typedef long long int i64;
typedef unsigned long long int u64;
t... | replace | 87 | 92 | 87 | 90 | TLE | |
p02664 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iostream>
#define mod 1000000007
#define int long long
#define pb(x) push_back(x)
#define gcd(a, b) __gcd(a, b)
#define all(v) v.begin(), v.end()
#define lcm(a, b) (a * b) / gcd(a, b)
#define bits(x) __builtin_popcountll(x)
#define fast ... | #include <bits/stdc++.h>
#include <iostream>
#define mod 1000000007
#define int long long
#define pb(x) push_back(x)
#define gcd(a, b) __gcd(a, b)
#define all(v) v.begin(), v.end()
#define lcm(a, b) (a * b) / gcd(a, b)
#define bits(x) __builtin_popcountll(x)
#define fast ... | replace | 23 | 24 | 23 | 24 | TLE | |
p02664 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 100;
int main() {
char s[M];
while (scanf("%s", s) == 1) {
int n = strlen(s);
for (int i = 0; i < n; i++)
if (s[i] == '?')
s[i] = 'D';
printf("%s\n", s);
}
}
| #include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 100;
int main() {
char s[M];
while (scanf("%s", s) == 1) {
int n = strlen(s);
for (int i = 0; i < n; i++)
if (s[i] == '?')
s[i] = 'D';
printf("%s\n", s);
}
}
| replace | 3 | 4 | 3 | 4 | 0 | |
p02664 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
string T;
cin >> T;
if (T.at(0) == '?') {
if (T.at(1) != 'P')
T.at(0) = 'P';
}
for (int i = 1; i < T.size() - 1; i++) {
if (T.at(i) == '?') {
if (T.... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
string T;
cin >> T;
rep(i, T.size()) {
if (T.at(i) == '?')
T.at(i) = 'D';
}
cout << T << endl;
return 0;
} | replace | 8 | 23 | 8 | 11 | 0 | |
p02664 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define X first
#define Y second
#define PB push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e5 + 500;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
char s[N];
int n... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define X first
#define Y second
#define PB push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e6 + 500;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
char s[N];
int n... | replace | 15 | 16 | 15 | 16 | 0 | |
p02664 | C++ | Runtime Error | #include <bits/stdc++.h>
#define LL long long
#define pb push_back
#define SZ(x) ((int)x.size() - 1)
#define ms(a, b) memset(a, b, sizeof a)
#define F(i, a, b) for (int i = (a); i <= (b); ++i)
#define DF(i, a, b) for (int i = (a); i >= (b); --i)
using namespace std;
inline int read() {
char ch = getchar();
int w = ... | #include <bits/stdc++.h>
#define LL long long
#define pb push_back
#define SZ(x) ((int)x.size() - 1)
#define ms(a, b) memset(a, b, sizeof a)
#define F(i, a, b) for (int i = (a); i <= (b); ++i)
#define DF(i, a, b) for (int i = (a); i >= (b); --i)
using namespace std;
inline int read() {
char ch = getchar();
int w = ... | replace | 18 | 19 | 18 | 19 | 0 | |
p02664 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string T;
cin >> T;
if (T.at(0) == '?') {
T.at(0) = 'D';
}
for (int i = 1; i < T.size(); i++) {
if (T.at(i) == '?') {
if ((T.at(i - 1)) == 'P') {
T.at(i) = 'D';
}
if ((T.at(i - 1)) == 'D') {
if (T.at(i + 1) =... | #include <bits/stdc++.h>
using namespace std;
int main() {
string T;
cin >> T;
if (T.at(0) == '?') {
T.at(0) = 'D';
}
if (T.at(T.size() - 1) == '?') {
T.at(T.size() - 1) = 'D';
}
for (int i = 1; i < T.size() - 1; i++) {
if (T.at(i) == '?') {
if ((T.at(i - 1)) == 'P') {
T.at(i) =... | replace | 9 | 10 | 9 | 13 | 0 | |
p02664 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T> inline void chkmax(T &x, T y)... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T> inline void chkmax(T &x, T y)... | replace | 31 | 32 | 31 | 32 | 0 | |
p02664 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string t;
cin >> t;
for (int i = 0; i < t.size(); i++) {
if (t.at(i) == '?') {
if (i < t.size() - 1) {
if (t.at(i + 1) == 'D') {
t.at(i) = 'P';
}
if (i > 0) {
if (t.at(i - 1) == 'P') {
t.a... | #include <bits/stdc++.h>
using namespace std;
int main() {
string t;
cin >> t;
for (int i = 0; i < t.size(); i++) {
if (t.at(i) == '?') {
t.at(i) = 'D';
}
}
cout << t << endl;
} | replace | 8 | 26 | 8 | 9 | 0 | |
p02664 | C++ | Runtime Error | #include "algorithm"
#include "bitset"
#include "cassert"
#include "climits"
#include "cmath"
#include "cstdio"
#include "ctime"
#include "functional"
#include "iomanip"
#include "iostream"
#include "list"
#include "map"
#include "numeric"
#include "queue"
#include "random"
#include "set"
#include "stack"
#include "str... | #include "algorithm"
#include "bitset"
#include "cassert"
#include "climits"
#include "cmath"
#include "cstdio"
#include "ctime"
#include "functional"
#include "iomanip"
#include "iostream"
#include "list"
#include "map"
#include "numeric"
#include "queue"
#include "random"
#include "set"
#include "stack"
#include "str... | replace | 34 | 48 | 34 | 35 | 0 | |
p02664 | C++ | Runtime Error | #include <stdio.h>
#include <string.h>
char x[100010];
int main() {
scanf("%s", x + 1);
int a = strlen(x + 1);
for (int i = 1; i <= a; i++)
if (x[i] == '?')
x[i] = 'D';
for (int i = 1; i <= a; i++)
printf("%c", x[i]);
} | #include <stdio.h>
#include <string.h>
char x[200010];
int main() {
scanf("%s", x + 1);
int a = strlen(x + 1);
for (int i = 1; i <= a; i++)
if (x[i] == '?')
x[i] = 'D';
for (int i = 1; i <= a; i++)
printf("%c", x[i]);
} | replace | 3 | 4 | 3 | 4 | 0 | |
p02664 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string T;
cin >> T;
for (long long i = 0; i < 200001; i++) {
if (T[i] == '?') {
T[i] = 'D';
}
}
cout << T << endl;
} | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string T;
cin >> T;
for (long long i = 0; i < T.length(); i++) {
if (T[i] == '?') {
T[i] = 'D';
}
}
cout << T << endl;
} | replace | 8 | 9 | 8 | 9 | -11 | |
p02664 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <cstring>
using namespace std;
int main() {
char T[20000];
cin >> T;
int i, n = strlen(T);
for (i = 0; i < n; i++) {
if (T[i] == '?') {
T[i] = 'D';
}
cout << T[i];
}
}
| #include <bits/stdc++.h>
#include <cstring>
using namespace std;
int main() {
char T[200000];
cin >> T;
int i, n = strlen(T);
for (i = 0; i < n; i++) {
if (T[i] == '?') {
T[i] = 'D';
}
cout << T[i];
}
}
| replace | 4 | 5 | 4 | 5 | 0 | |
p02664 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int len = s.size();
for (int i = 0; i < len;) {
if (s[i] == '?') {
s[i] = 'D';
}
}
cout << s << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int len = s.size();
for (int i = 0; i < len; i++) {
if (s[i] == '?') {
s[i] = 'D';
}
}
cout << s << endl;
}
| replace | 6 | 7 | 6 | 7 | TLE | |
p02664 | C++ | Runtime Error |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define ALL(a) a.begin(), a.end()
#define ALLN(a, n) (a, a + n)
#define MAX 10000007
#define MIN -10000007
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("input... |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define ALL(a) a.begin(), a.end()
#define ALLN(a, n) (a, a + n)
#define MAX 10000007
#define MIN -10000007
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("input... | replace | 30 | 38 | 30 | 32 | 0 | |
p02664 | 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;
using P = pair<int, int>;
int find(string str, string word) {
int count = 0;
for (string::size_type pos = 0; (pos = str.find(word, pos)) != string::npos;
pos += word.size()) {
++count;
}
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int find(string str, string word) {
int count = 0;
for (string::size_type pos = 0; (pos = str.find(word, pos)) != string::npos;
pos += word.size()) {
++count;
}
... | replace | 18 | 35 | 18 | 21 | TLE | |
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;
const ll mod = 1e9 + 7;
#define ALL(x) (x).begin(), (x).end()
#define pow(x, y) modpow(x, y)
#define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define REPS(i, n) for (ll(i) = 1; (i) <= (n); (i)++)
#define RREP(i, n) for (ll(i)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;
const ll mod = 1e9 + 7;
#define ALL(x) (x).begin(), (x).end()
#define pow(x, y) modpow(x, y)
#define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define REPS(i, n) for (ll(i) = 1; (i) <= (n); (i)++)
#define RREP(i, n) for (ll(i)... | replace | 59 | 60 | 59 | 80 | 255 | |
p02665 | C++ | Runtime Error | #include <cstdio>
typedef long long LL;
const int MN = 200005;
int N;
LL A[MN], B[MN], C[MN];
int main() {
scanf("%d", &N);
for (int i = 0; i <= N; ++i)
scanf("%lld", &A[i]);
if (!N)
return puts(A[0] == 1 ? "1" : "-1");
for (int i = N; i >= 0; --i)
B[i] = B[i + 1] + A[i];
C[0] = 1 - A[0];
for... | #include <cstdio>
typedef long long LL;
const int MN = 200005;
int N;
LL A[MN], B[MN], C[MN];
int main() {
scanf("%d", &N);
for (int i = 0; i <= N; ++i)
scanf("%lld", &A[i]);
if (!N)
return puts(A[0] == 1 ? "1" : "-1"), 0;
for (int i = N; i >= 0; --i)
B[i] = B[i + 1] + A[i];
C[0] = 1 - A[0];
... | replace | 13 | 14 | 13 | 14 | 0 | |
p02665 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define prtd(var, i) cout << fixed << setprecision(i) << var << endl;
#define ll long long
#define maxn 100005
using namespace std;
#define INF 1000000000000000LL
ll A[maxn];
ll lim[maxn];
int main() {
int n;
cin >> n;
rep(i, n + 1) cin >>... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define prtd(var, i) cout << fixed << setprecision(i) << var << endl;
#define ll long long
#define maxn 100005
using namespace std;
#define INF 1000000000000000LL
ll A[maxn];
ll lim[maxn];
int main() {
int n;
cin >> n;
rep(i, n + 1) cin >>... | replace | 30 | 31 | 30 | 31 | TLE | |
p02665 | 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 | 81 | 83 | 81 | 85 | 0 | |
p02665 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <queue>
#include <vector>
#define DB cerr << "D" << endl
#define pb push_back
using namespace std;
using ll = long long;
using ld = long double;
const int INF = 1e9;
const ll LINF = 1e18;
const double dINF = 1e18;... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <queue>
#include <vector>
#define DB cerr << "D" << endl
#define pb push_back
using namespace std;
using ll = long long;
using ld = long double;
const int INF = 1e9;
const ll LINF = 1e18;
const double dINF = 1e18;... | replace | 41 | 42 | 41 | 42 | 0 | |
p02665 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
unsigned int n;
unsigned long ans = 0;
unsigned long now;
double check;
bool solved = true;
int i, j, k;
cin >> n;
unsigned int *a = new unsigned int[n + 1];
unsigned long *top = new unsigned long[n + 1];
cin >> a[0];
if ... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
unsigned int n;
unsigned long ans = 0;
unsigned long now;
double check;
bool solved = true;
int i, j, k;
cin >> n;
unsigned int *a = new unsigned int[n + 1];
unsigned long *top = new unsigned long[n + 1];
cin >> a[0];
if ... | replace | 39 | 44 | 39 | 44 | 0 | |
p02665 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <assert.h>
#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>
#inclu... | #include <algorithm>
#include <array>
#include <assert.h>
#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>
#inclu... | replace | 83 | 84 | 83 | 84 | 0 | |
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int uli;
typedef long double Lf;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define fastIO \
std::ios::sync_with_stdio(false); ... | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int uli;
typedef long double Lf;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define fastIO \
std::ios::sync_with_stdio(false); ... | replace | 12 | 13 | 12 | 13 | 0 | |
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100000];
long long ruia[100001];
long long ans = 0;
long long nowleef = 1;
int main() {
cin >> n;
for (long long i = 0; i < n + 1; i++) {
cin >> a[i];
}
for (long long i = 0; i < n + 1; i++) {
ruia[n - i] = ruia[n - i + 1] + a[n - i]... | #include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100005];
long long ruia[100006];
long long ans = 0;
long long nowleef = 1;
int main() {
cin >> n;
for (long long i = 0; i < n + 1; i++) {
cin >> a[i];
}
for (long long i = 0; i < n + 1; i++) {
ruia[n - i] = ruia[n - i + 1] + a[n - i]... | replace | 3 | 5 | 3 | 5 | 0 | |
p02665 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <queue>
#include <set>
#include <vector>
// #include <bits/stdc++.h>
template <typename T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typenam... | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <queue>
#include <set>
#include <vector>
// #include <bits/stdc++.h>
template <typename T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typenam... | replace | 94 | 95 | 94 | 96 | -6 | munmap_chunk(): invalid pointer
|
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<ll, ll>;
#define debug(var) cerr << "[" << #var << ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<ll, ll>;
#define debug(var) cerr << "[" << #var << ... | replace | 21 | 23 | 21 | 29 | 0 | |
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e15;
// __uint128_t
int main() {
ll N;
cin >> N;
ll SUM = 0;
vector<ll> C(N + 1);
for (int i = 0; i < N + 1; i++)
cin >> C[i];
if (C[N] == 0) {
cout << -1 << endl;
return 0;
}
vector<ll> P(N + 1);
P... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e15;
// __uint128_t
int main() {
ll N;
cin >> N;
ll SUM = 0;
vector<ll> C(N + 1);
for (int i = 0; i < N + 1; i++)
cin >> C[i];
if (C[N] == 0) {
cout << -1 << endl;
return 0;
}
vector<ll> P(N + 1);
P... | replace | 18 | 19 | 18 | 19 | 0 | |
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template <typename T> using pq = priority_queue<T>;
template <typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, ty... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template <typename T> using pq = priority_queue<T>;
template <typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, ty... | replace | 67 | 68 | 67 | 74 | 0 | |
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
constexpr long long int mod = 1000000007, MOD = 998244353;
constexpr double PI = 3.14159265358979323846;
int main() {
long long N;
cin >> N;
vector<long long> U(N + 1), Usum(N + 2);
for (long long i = 0; i <= N; i++) {
cin >> U.at(i);
}
for (long long i = ... | #include <bits/stdc++.h>
using namespace std;
constexpr long long int mod = 1000000007, MOD = 998244353;
constexpr double PI = 3.14159265358979323846;
int main() {
long long N;
cin >> N;
vector<long long> U(N + 1), Usum(N + 2);
for (long long i = 0; i <= N; i++) {
cin >> U.at(i);
}
for (long long i = ... | replace | 48 | 49 | 48 | 49 | 0 | |
p02665 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define mem(x, y) \
memset(x, y, ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define mem(x, y) \
memset(x, y, ... | replace | 75 | 77 | 75 | 77 | TLE | |
p02665 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define mkp make_pair
#define mkt make_tuple
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const l... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define mkp make_pair
#define mkt make_tuple
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const l... | replace | 39 | 40 | 39 | 40 | -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)
|
p02665 | Python | Runtime Error | N = int(input())
A = list(map(int, input().split()))
B = []
if N == 0:
if A[0] != 1:
print(-1)
exit()
else:
print(1)
exit()
else:
if A[0] != 0:
print(-1)
exit()
else:
B.append(1)
for i in range(1, N + 1):
B.append((B[i - 1] -... | N = int(input())
A = list(map(int, input().split()))
B = []
if N == 0:
if A[0] != 1:
print(-1)
exit()
else:
print(1)
exit()
else:
if A[0] != 0:
print(-1)
exit()
else:
B.append(1)
for i in range(1, N + 1):
B.append((B[i - 1] -... | replace | 28 | 29 | 28 | 29 | IndexError: list index out of range | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02665/Python/s441466077.py", line 30, in <module>
ans += min(B[i], B[i + 1] + A[i])
IndexError: list index out of range
|
p02665 | Python | Runtime Error | n = int(input())
a = list(map(int, input().split()))
a_min = [0] * (n + 1)
a_min[n] = a[n]
for i in range(n - 1, -1, -1):
a_min[i] = a[i] + a_min[i + 1]
b = [1]
for i in range(n):
tmp = b[i] - a[i]
if tmp < 1 or tmp * 2 < a[i + 1]:
print(-1)
break
else:
if n == 0:
ans = 1 if a[0... | n = int(input())
a = list(map(int, input().split()))
a_min = [0] * (n + 1)
a_min[n] = a[n]
for i in range(n - 1, -1, -1):
a_min[i] = a[i] + a_min[i + 1]
b = [1]
for i in range(n):
tmp = b[i] - a[i]
b.append(min(tmp * 2, a_min[i + 1]))
if tmp < 1 or tmp * 2 < a[i + 1]:
print(-1)
break
el... | insert | 10 | 10 | 10 | 11 | IndexError: list index out of range | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02665/Python/s101181043.py", line 10, in <module>
tmp = b[i] - a[i]
IndexError: list index out of range
|
p02665 | C++ | Time Limit Exceeded | #include <iostream>
#define MAX 100000
#define ll unsigned long long
using namespace std;
int main() {
ll n, a[MAX + 100], node[MAX + 100], res = 0;
cin >> n;
for (ll i = 0; i <= n; ++i) {
cin >> a[i];
}
if (n == 0) {
cout << (a[0] == 1 ? 1 : -1) << endl;
return 0;
}
if (a[0] != 0) {
c... | #include <iostream>
#define MAX 100000
#define ll unsigned long long
using namespace std;
int main() {
ll n, a[MAX + 100], node[MAX + 100], res = 0;
cin >> n;
for (ll i = 0; i <= n; ++i) {
cin >> a[i];
}
if (n == 0) {
cout << (a[0] == 1 ? 1 : -1) << endl;
return 0;
}
if (a[0] != 0) {
c... | replace | 34 | 35 | 34 | 35 | TLE | |
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;... | replace | 41 | 44 | 41 | 46 | 0 | |
p02665 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;
const int N = (int)1e5 + 7;
int n;
ll a[N];
ll b[N];
ll suf[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for (int i... | #include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;
const int N = (int)1e5 + 7;
int n;
ll a[N];
ll b[N];
ll suf[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for (int i... | replace | 25 | 26 | 25 | 29 | TLE | |
p02665 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <... | replace | 57 | 58 | 57 | 58 | 0 | |
p02665 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
if (N == 0)
exit(1);
vector<long long> A(N + 1), B(N + 1);
for (int i = 0; i <= N; i++) {
cin >> A[i];
}
long long nodes = 1;
long long sum = A[N];
B[N] = 0ll;
for (int i = N - 1; i >= 0; i--) {
B[i] = sum;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
if (N == 0) {
int a;
cin >> a;
if (a == 1)
puts("1");
else
puts("-1");
return 0;
}
vector<long long> A(N + 1), B(N + 1);
for (int i = 0; i <= N; i++) {
cin >> A[i];
}
long long nodes = 1;
... | replace | 7 | 9 | 7 | 16 | 0 | |
p02665 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
const ll MOD = 1000000007;
int main() {
int N;
cin >> N;
vector<ll> A(N + 1);
for (int i = 0; i < N + 1; i++) {
cin >> A[i];
}
if (N == 0) {
if (A[0] == 1) {
cout << 1 << endl;
} else {
cout << -1 << endl;
}
... | #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
const ll MOD = 1000000007;
int main() {
int N;
cin >> N;
vector<ll> A(N + 1);
for (int i = 0; i < N + 1; i++) {
cin >> A[i];
}
if (N == 0) {
if (A[0] == 1) {
cout << 1 << endl;
} else {
cout << -1 << endl;
}
... | replace | 37 | 38 | 37 | 38 | TLE | |
p02665 | C++ | Runtime Error | // clang-format off
#include <bits/stdc++.h>
#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
... | // clang-format off
#include <bits/stdc++.h>
#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
... | replace | 39 | 41 | 39 | 41 | 0 | |
p02666 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const int N = 5003, M = 1000000007;
... | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const int N = 5003, M = 1000000007;
... | replace | 26 | 27 | 26 | 28 | 127 | /tmp/a716a81f-5f76-4e0d-953e-f6aa9ec400fa.out: error while loading shared libraries: libc.so.6: failed to map segment from shared object
|
p02666 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:526000000")
#include "bits/stdc++.h"
#define int ll
using namespace std;
typedef string::const_iterator State;
#define eps 1e-8L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define pb push_bac... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:526000000")
#include "bits/stdc++.h"
#define int ll
using namespace std;
typedef string::const_iterator State;
#define eps 1e-8L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define pb push_bac... | replace | 1,089 | 1,091 | 1,089 | 1,092 | 0 | |
p02666 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair<ll, ll>
#define F first
#define S second
#define endl '\n'
#define int long long
#define sync \
ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair<ll, ll>
#define F first
#define S second
#define endl '\n'
#define int long long
#define sync \
ios_base::sync_with_stdio(false); ... | replace | 22 | 23 | 22 | 23 | -11 | |
p02666 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> p2;
ll p[5005], tr[5005], fac[5005], par[5005], dp[5005][5005],
hell = pow(10, 9) + 7;
ll find(ll i) {
if (par[i] == i)
return i;
return par[i] = find(par[i]);
}
void merge(ll a, ll b) {
a ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> p2;
ll p[5005], tr[5005], fac[5005], par[5005], dp[5005][5005],
hell = pow(10, 9) + 7;
ll find(ll i) {
if (par[i] == i)
return i;
return par[i] = find(par[i]);
}
void merge(ll a, ll b) {
a ... | replace | 13 | 14 | 13 | 14 | -11 | |
p02667 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
typedef long long LL;
const int MN = 100005;
int N, C0, C1, K;
char T[MN];
int stk[MN], cnt[MN], tp;
LL Ans;
int main() {
scanf("%s", T + 1), N = strlen(T + 1);
for (int i = 1; i <= N; ++i)
++(T[i] & 1 ? C1 : C0);
Ans = (LL)(C1 + 1) * (C1 + 1) / 4;
T[0] = T[N + 1] = '... | #include <cstdio>
#include <cstring>
typedef long long LL;
const int MN = 200005;
int N, C0, C1, K;
char T[MN];
int stk[MN], cnt[MN], tp;
LL Ans;
int main() {
scanf("%s", T + 1), N = strlen(T + 1);
for (int i = 1; i <= N; ++i)
++(T[i] & 1 ? C1 : C0);
Ans = (LL)(C1 + 1) * (C1 + 1) / 4;
T[0] = T[N + 1] = '... | replace | 4 | 5 | 4 | 5 | 0 | |
p02667 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include ... | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include ... | insert | 505 | 505 | 505 | 509 | 0 | |
p02667 | C++ | Runtime Error | #include <bits/stdc++.h>
#define clr(x) memset(x, 0, sizeof(x))
#define For(i, a, b) for (int i = (a); i <= (b); i++)
#define Fod(i, b, a) for (int i = (b); i >= (a); i--)
#define fi first
#define se second
#define kill _z_kill
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define outval(x) cerr << #x " =... | #include <bits/stdc++.h>
#define clr(x) memset(x, 0, sizeof(x))
#define For(i, a, b) for (int i = (a); i <= (b); i++)
#define Fod(i, b, a) for (int i = (b); i >= (a); i--)
#define fi first
#define se second
#define kill _z_kill
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define outval(x) cerr << #x " =... | replace | 105 | 106 | 105 | 106 | 2 | |
p02669 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <typename T> void chmin(T &a, T b) {
if (a > b)
a = b;
}
using ll = long long;
const long long LINF = 1e18;
ll v[3] = {2, 3, 5}, w[3], d, n, t;
map<ll, ll> m;
ll f(ll x) {
if (!x)
return LINF;
if (x == 1)
return d;
if (m[x])
return m[x];
... | #include <bits/stdc++.h>
using namespace std;
template <typename T> void chmin(T &a, T b) {
if (a > b)
a = b;
}
using ll = long long;
const long long LINF = 1e18;
ll v[3] = {2, 3, 5}, w[3], d, n, t;
map<ll, ll> m;
ll f(ll x) {
if (!x)
return LINF;
if (x == 1)
return d;
if (m[x])
return m[x];
... | replace | 23 | 24 | 23 | 24 | -11 | |
p02669 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ios std::ios::sync_with_stdio(false)
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", (n))
#define pdd(n, m) printf("%d %d\n", n, m)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) ... | #include <bits/stdc++.h>
#define ios std::ios::sync_with_stdio(false)
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", (n))
#define pdd(n, m) printf("%d %d\n", n, m)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) ... | replace | 271 | 274 | 271 | 273 | TLE | |
p02669 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define... | #include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define... | replace | 64 | 65 | 64 | 65 | TLE | |
p02669 | C++ | Time Limit Exceeded | // #include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
... | // #include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
... | replace | 55 | 56 | 55 | 56 | TLE | |
p02669 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\... | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\... | replace | 26 | 27 | 26 | 27 | TLE | |
p02669 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> P1;
typedef pair<P, P> P2;
#define pu ... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> P1;
typedef pair<P, P> P2;
#define pu ... | replace | 40 | 41 | 40 | 42 | -11 | |
p02669 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include ... | replace | 88 | 89 | 88 | 89 | 0 | |
p02669 | C++ | Time Limit Exceeded | #pragma GCC target("avx2,avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#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;
using i128 = __int128_t;
using ll = long long;
using ull = unsig... | #pragma GCC target("avx2,avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#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;
using i128 = __int128_t;
using ll = long long;
using ull = unsig... | delete | 114 | 119 | 114 | 114 | TLE | |
p02669 | C++ | Runtime Error | #include "bits/stdc++.h"
#define FI first.first
#define SE first.second
#define TH second
#define fi first
#define se second
#define th second
using namespace std;
template <typename T> string to_string(const vector<T> &vc, int w) {
if (vc.empty())
return "";
if (w + 1 == vc.size())
return to_string(vc[w]... | #include "bits/stdc++.h"
#define FI first.first
#define SE first.second
#define TH second
#define fi first
#define se second
#define th second
using namespace std;
template <typename T> string to_string(const vector<T> &vc, int w) {
if (vc.empty())
return "";
if (w + 1 == vc.size())
return to_string(vc[w]... | replace | 109 | 110 | 109 | 110 | -8 | |
p02669 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define INF 1e11
using namespace std;
unordered_map<ll, ll> s;
set<ll> p;
ll n, A, B, C, D;
int t;
ll tr(ll x, ll y) {
if (INF / (x - y) >= D)
return D * (x - y);
return INF;
}
void get(ll x, ll y) {
if (s[x] == 0) {
s[x] = y;
p.insert(x);
} else
s[x... | #include <bits/stdc++.h>
#define ll long long
#define INF 1e11
using namespace std;
unordered_map<ll, ll> s;
set<ll> p;
ll n, A, B, C, D;
int t;
ll tr(ll x, ll y) {
if (INF / (x - y) >= D)
return D * (x - y);
return INF;
}
void get(ll x, ll y) {
if (s[x] == 0) {
s[x] = y;
p.insert(x);
} else
s[x... | insert | 27 | 27 | 27 | 31 | TLE | |
p02669 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <thread>
#include <tuple>
#include <... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <thread>
#include <tuple>
#include <... | replace | 47 | 48 | 47 | 48 | TLE | |
p02669 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
// #define int long long // intで書いたけど心配なときにlong longに変換する
struct Fast {
Fast() {
std::cin.tie(0);
ios::sync_with_stdio(false);
}
} fast;
/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define AL... | #include <bits/stdc++.h>
using namespace std;
// #define int long long // intで書いたけど心配なときにlong longに変換する
struct Fast {
Fast() {
std::cin.tie(0);
ios::sync_with_stdio(false);
}
} fast;
/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define AL... | insert | 110 | 110 | 110 | 114 | TLE | |
p02670 | C++ | Runtime Error | /*
No matter how long a night, dawn will always break.
Simular saying ... The darkest hour is just before the dawn.
*************************************** ************************8
**********************************
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
... | /*
No matter how long a night, dawn will always break.
Simular saying ... The darkest hour is just before the dawn.
*************************************** ************************8
**********************************
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
... | replace | 41 | 42 | 41 | 42 | 0 | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll mod = 998244353;
ll mul(ll a, ll b) { return ((a % mod) * (b % mod)) % mod; }
ll add(ll a, ll b) { return ((a % mod) + (b % mod)) % mod; }
ll sub(ll a, ll b) { return ((a % mod) - (b % mod) + mod) % mod; }
int dx[4] = {0, 1, 0, -1};
int dy[4] = {... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll mod = 998244353;
ll mul(ll a, ll b) { return ((a % mod) * (b % mod)) % mod; }
ll add(ll a, ll b) { return ((a % mod) + (b % mod)) % mod; }
ll sub(ll a, ll b) { return ((a % mod) - (b % mod) + mod) % mod; }
int dx[4] = {0, 1, 0, -1};
int dy[4] = {... | replace | 12 | 13 | 12 | 13 | 0 | |
p02670 | C++ | Time Limit Exceeded | /*input
6
11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10
29 28 33 12 6 5 30
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typede... | /*input
6
11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10
29 28 33 12 6 5 30
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typede... | replace | 136 | 140 | 136 | 137 | TLE | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
#define mo 100000007
using namespace std;
long long read() {
long long xx = 0, flagg = 1;
char ch = getchar();
while ((ch < '0' || ch > '9') && ch != '-')
ch = getchar();
if (ch == '-') {
flagg = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
xx = xx * 10 + c... | #include <bits/stdc++.h>
#define mo 100000007
using namespace std;
long long read() {
long long xx = 0, flagg = 1;
char ch = getchar();
while ((ch < '0' || ch > '9') && ch != '-')
ch = getchar();
if (ch == '-') {
flagg = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
xx = xx * 10 + c... | replace | 32 | 33 | 32 | 33 | 0 | |
p02670 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
int cost[500][500];
bool valid[500][500];
int N;
const int INF_COST = 500;
int get(int x, int y) {
if (x >= N || x < 0 || y >= N || y < 0)
return INF_COST;
else
return cost[x][y];
}
// calculate cost
int cc(int min, int x, int ... | #include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
int cost[500][500];
bool valid[500][500];
int N;
const int INF_COST = 500;
int get(int x, int y) {
if (x >= N || x < 0 || y >= N || y < 0)
return INF_COST;
else
return cost[x][y];
}
// calculate cost
int cc(int min, int x, int ... | insert | 20 | 20 | 20 | 22 | 0 | |
p02670 | C++ | Runtime Error | /*
读题不规范,爆零两行泪。
数据不清空,爆零两行泪。
多测不读完,爆零两行泪。
边界不特判,爆零两行泪。
贪心不证明,爆零两行泪。
D P 顺序错,爆零两行泪。
大小少等号,爆零两行泪。
变量不统一,爆零两行泪。
越界不判断,爆零两行泪。
调试不注释,爆零两行泪。
溢出不 l l,爆零两行泪。
*/
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define X first
#define Y second
const int N = 500;
int n;
bool hav[N + 1][N... | /*
读题不规范,爆零两行泪。
数据不清空,爆零两行泪。
多测不读完,爆零两行泪。
边界不特判,爆零两行泪。
贪心不证明,爆零两行泪。
D P 顺序错,爆零两行泪。
大小少等号,爆零两行泪。
变量不统一,爆零两行泪。
越界不判断,爆零两行泪。
调试不注释,爆零两行泪。
溢出不 l l,爆零两行泪。
*/
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define X first
#define Y second
const int N = 500;
int n;
bool hav[N + 1][N... | replace | 41 | 42 | 41 | 42 | 0 | |
p02670 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC target("avx2")
#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) << "\... | #pragma GCC optimize("O3")
#pragma GCC target("avx2")
#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) << "\... | replace | 27 | 28 | 27 | 28 | 0 | |
p02670 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC target("avx2")
#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) << "\... | #pragma GCC optimize("O3")
#pragma GCC target("avx2")
#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) << "\... | replace | 21 | 22 | 21 | 22 | 0 | |
p02670 | C++ | Runtime Error | // In the Name of Allah
// Ya Ali
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
const int maxn = 510;
const int INF = 1e18;
int n, p[maxn * maxn], dis[maxn * maxn], rr, ans = 0;
vector... | // In the Name of Allah
// Ya Ali
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
const int maxn = 510;
const int INF = 1e18;
int n, p[maxn * maxn], dis[maxn * maxn], rr, ans = 0;
vector... | replace | 19 | 20 | 19 | 20 | 0 | |
p02670 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n;
cin >> n;
int ans = 0;
vector<vector<int>> dist(n, vector<int>(n));
vector<vector<bool>> occupied(n, vector<bool>(n, true));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
dist[i]... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n;
cin >> n;
int ans = 0;
vector<vector<int>> dist(n, vector<int>(n));
vector<vector<bool>> occupied(n, vector<bool>(n, true));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
dist[i]... | insert | 27 | 27 | 27 | 28 | TLE | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return tr... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return tr... | replace | 25 | 26 | 25 | 26 | 0 | |
p02670 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i, a, b) for (ll i = (a); i < (b); ++i)
#define rep(i, a) repi(i, 0, ... | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i, a, b) for (ll i = (a); i < (b); ++i)
#define rep(i, a) repi(i, 0, ... | insert | 73 | 73 | 73 | 76 | 0 | |
p02670 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define rrep(i, n) for (ll i = n - 1; i > -1; i--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define fi first
#define se sec... | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define rrep(i, n) for (ll i = n - 1; i > -1; i--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define fi first
#define se second
co... | replace | 3 | 4 | 3 | 4 | TLE | |
p02670 | C++ | Runtime Error | #include <algorithm> //sort,二分探索,など
#include <bitset> //固定長bit集合
#include <cmath> //pow,logなど
#include <complex> //複素数
#include <deque> //両端アクセスのキュー
#include <functional> //sortのgreater
#include <iomanip> //setprecision(浮動小数点の出力の誤差)
#include <iostream> //入出力
#include <iter... | #include <algorithm> //sort,二分探索,など
#include <bitset> //固定長bit集合
#include <cmath> //pow,logなど
#include <complex> //複素数
#include <deque> //両端アクセスのキュー
#include <functional> //sortのgreater
#include <iomanip> //setprecision(浮動小数点の出力の誤差)
#include <iostream> //入出力
#include <iter... | replace | 31 | 32 | 31 | 32 | 0 | |
p02670 | C++ | Runtime Error | // AtCoder.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
// AtCoder.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#define _USE_MATH_DEFINES
#include <math.h>
// #include<cmath>
#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <chrono>
#include <c... | // AtCoder.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
// AtCoder.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#define _USE_MATH_DEFINES
#include <math.h>
// #include<cmath>
#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <chrono>
#include <c... | replace | 320 | 323 | 320 | 325 | -11 | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define FOR0(i, n) for (i = 0; i < n; i++)
#define FOR(i, j, n) for (i = j; i < n; i++)
#define FORD(i, j, k) for (i = j; i >= k; i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#defi... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define FOR0(i, n) for (i = 0; i < n; i++)
#define FOR(i, j, n) for (i = j; i < n; i++)
#define FORD(i, j, k) for (i = j; i >= k; i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#defi... | replace | 50 | 51 | 50 | 51 | 0 |
Time elapsed : 27.225 ms
|
p02670 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << (x) << endl
#define debugArray(x, n) ... | #include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << "(" << p.first << "," << p.second << ")";
return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << (x) << endl
#define debugArray(x, n) ... | replace | 60 | 61 | 60 | 61 | TLE | |
p02670 | C++ | Runtime Error |
#include <bits/stdc++.h>
#define ln '\n'
#define all(dat) dat.begin(), dat.end()
#define loop(i, to) for (int i = 0; i < to; ++i)
#define cont(i, to) for (int i = 1; i <= to; ++i)
#define circ(i, fm, to) for (int i = fm; i <= to; ++i)
#define foreach(i, dat) \
... |
#include <bits/stdc++.h>
#define ln '\n'
#define all(dat) dat.begin(), dat.end()
#define loop(i, to) for (int i = 0; i < to; ++i)
#define cont(i, to) for (int i = 1; i <= to; ++i)
#define circ(i, fm, to) for (int i = fm; i <= to; ++i)
#define foreach(i, dat) \
... | replace | 15 | 16 | 15 | 16 | 0 | |
p02670 | C++ | Runtime Error | #include <stdio.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define rep(i, N) for (int i = 0; i < (int)N; i++)
static inline char CH() {
static char buf[100000], *ptr1 = buf, *ptr2 = buf;
return ptr1 == ptr2 && (ptr2 = (ptr1 = buf) + fread(buf, 1, 1000... | #include <stdio.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define rep(i, N) for (int i = 0; i < (int)N; i++)
static inline char CH() {
static char buf[100000], *ptr1 = buf, *ptr2 = buf;
return ptr1 == ptr2 && (ptr2 = (ptr1 = buf) + fread(buf, 1, 1000... | replace | 30 | 31 | 30 | 31 | 0 | |
p02670 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) \
fo... | #include "bits/stdc++.h"
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) \
fo... | replace | 70 | 71 | 70 | 71 | TLE | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int N;
vector<int> P(505);
bool a[505][505];
int d[505][505];
void dfs(int i, int j, int dst) {
if (dst >= d[i][j])
return;
d[i][j] = dst;
if (i > 0)
dfs(i - 1, j, dst + (1 - a[i - 1][j]));
if (i < N - 1)
dfs(i + 1, j, dst + (1 - a[i + 1][j]));
if (... | #include <bits/stdc++.h>
using namespace std;
int N;
vector<int> P(500 * 500 + 5);
bool a[505][505];
int d[505][505];
void dfs(int i, int j, int dst) {
if (dst >= d[i][j])
return;
d[i][j] = dst;
if (i > 0)
dfs(i - 1, j, dst + (1 - a[i - 1][j]));
if (i < N - 1)
dfs(i + 1, j, dst + (1 - a[i + 1][j]... | replace | 5 | 6 | 5 | 6 | 0 | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define rrep(i, a, b) for (int i = (a); i >= (b); --i)
#define PB push_back
#define ar2 array<int, 2>
typedef long long LL;
const LL P = 998244353;
const int N = 505;
mt19937 rng(time(0));
int n, x, y, a[N], dp[N][N], v... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define rrep(i, a, b) for (int i = (a); i >= (b); --i)
#define PB push_back
#define ar2 array<int, 2>
typedef long long LL;
const LL P = 998244353;
const int N = 505;
mt19937 rng(time(0));
int n, x, y, a[N * N], dp[N][N... | replace | 11 | 12 | 11 | 12 | 0 | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define llinf (1ll << 60)
#define BG(x) ((x).begin())
#define ED(x) ((x).end())
#define rBG(x) ((x).rbegin())
#define rED(x) ((x).rend())
#define mp(a, b) make_pair((a), (b))
ll t;
ll n;
ll p[505];
ll dist[505][505];
ll occ[505][505];
struct cmp {
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define llinf (1ll << 60)
#define BG(x) ((x).begin())
#define ED(x) ((x).end())
#define rBG(x) ((x).rbegin())
#define rED(x) ((x).rend())
#define mp(a, b) make_pair((a), (b))
ll t;
ll n;
ll p[300000];
ll dist[505][505];
ll occ[505][505];
struct cmp {... | replace | 13 | 14 | 13 | 14 | 0 | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
#define clr(x) memset(x, 0, sizeof(x))
#define For(i, a, b) for (int i = (a); i <= (b); i++)
#define Fod(i, b, a) for (int i = (b); i >= (a); i--)
#define fi first
#define se second
#define kill _z_kill
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define outval(x) cerr << #x " =... | #include <bits/stdc++.h>
#define clr(x) memset(x, 0, sizeof(x))
#define For(i, a, b) for (int i = (a); i <= (b); i++)
#define Fod(i, b, a) for (int i = (b); i >= (a); i--)
#define fi first
#define se second
#define kill _z_kill
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define outval(x) cerr << #x " =... | replace | 57 | 58 | 57 | 58 | 0 | |
p02670 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define repn(i, n) for (int i = 1; i <= n; i++)
#define repr(e, x) f... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stdio.h>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
#define repn(i, n) for (int i = 1; i <= n; i++)
#define repr(e, x) f... | replace | 21 | 22 | 21 | 22 | 0 | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MX 100005
#define mod 1000000007
#define ll long long
#define ld long double
#define mem(a, b) memset(a, b, sizeof(a))
#define fast() \
ios_base::sync_with_stdio(0); ... | #include <bits/stdc++.h>
using namespace std;
#define MX 100005
#define mod 1000000007
#define ll long long
#define ld long double
#define mem(a, b) memset(a, b, sizeof(a))
#define fast() \
ios_base::sync_with_stdio(0); ... | replace | 22 | 23 | 22 | 23 | 0 | |
p02670 | C++ | Runtime Error | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int N;
const int INF = 1000;
int ans[505][505];
bool used[505][505];
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
b... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int N;
const int INF = 1000;
int ans[505][505];
bool used[505][505];
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
b... | replace | 19 | 20 | 19 | 20 | 0 | |
p02670 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define N 505
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 <= '9') {
x = (x << 3) + (x << 1) + c - '0';
c = ... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define N 505
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 <= '9') {
x = (x << 3) + (x << 1) + c - '0';
c = ... | replace | 19 | 20 | 19 | 20 | 0 | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock() / CLOCKS_PER_SEC
const int N = 50... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock() / CLOCKS_PER_SEC
const int N = 50... | replace | 56 | 57 | 56 | 58 | -11 | |
p02670 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef pair<ld, ld> id;
typedef tuple<ll, ll, ll> tl;
typedef tuple<ll, ll, ll, ll> ql;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define ROF(i, a, b) for (ll i = (a); i >= (b); i--)
#defin... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef pair<ld, ld> id;
typedef tuple<ll, ll, ll> tl;
typedef tuple<ll, ll, ll, ll> ql;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define ROF(i, a, b) for (ll i = (a); i >= (b); i--)
#defin... | replace | 42 | 43 | 42 | 43 | 0 | |
p02670 | C++ | Time Limit Exceeded | #line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define... | #line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define... | replace | 86 | 88 | 86 | 87 | TLE | |
p02670 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int n, i, j, k, x, y, gg;
long long dis[505][505], ans;
int bz[505][505];
int p[250005];
int list[2500005][3], head, tail, B[505][505];
int fx1[5], fx2[5];
void update(int x, int y) {
int xx, yy, t;
head = 0;
tail = 1;
memset(B, 0,... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
int n, i, j, k, x, y, gg;
long long dis[505][505], ans;
int bz[505][505];
int p[250005];
int list[2500005][3], head, tail, B[505][505];
int fx1[5], fx2[5];
void update(int x, int y) {
int xx, yy, t;
head = 0;
tail = 1;
list[1][1] =... | delete | 16 | 17 | 16 | 16 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.