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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
// #define MOD 1000000007
const int INF = 1LL << 30;
char fi[1010][1010];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int dist[1010][1010];
int main() {
int... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
// #define MOD 1000000007
const int INF = 1LL << 30;
char fi[1010][1010];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int dist[1010][1010];
int main() {
int... | insert | 41 | 41 | 41 | 43 | 0 | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<vector<bool>> field(H, vector<bool>(W, false));
string A;
int count = 0;
queue<pair<int, int>> q_new;
queue<pair<int, int>> q_old;
for (int i = 0; i < H; i++) {
cin >> A;
for (int j = 0; j < W; j++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<vector<bool>> field(H, vector<bool>(W, false));
string A;
int count = 0;
queue<pair<int, int>> q_new;
queue<pair<int, int>> q_old;
for (int i = 0; i < H; i++) {
cin >> A;
for (int j = 0; j < W; j++) {
... | insert | 36 | 36 | 36 | 37 | TLE | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i, m, n) for (lli i = m; i < n; i++)
#define rrep(i, m, n) for (lli i = m; i > n; i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(), N.end()), N.end());
#de... | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i, m, n) for (lli i = m; i < n; i++)
#define rrep(i, m, n) for (lli i = m; i > n; i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(), N.end()), N.end());
#de... | replace | 45 | 46 | 45 | 46 | 0 | |
p03053 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define INF 1000000000
#define MOD 1000000007
#define ll long long int
using namespace std;
int main() {
int H, W;
ci... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define INF 1000000000
#define MOD 1000000007
#define ll long long int
using namespace std;
int main() {
int H, W;
ci... | replace | 54 | 59 | 54 | 63 | TLE | |
p03053 | C++ | Runtime Error | #pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for (int i = (int)(n); i > 0; i--)
#define pb... | #pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for (int i = (int)(n); i > 0; i--)
#define pb... | insert | 96 | 96 | 96 | 97 | 0 | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, n, s) for (int i = s; i < (n); ++i)
#define rsrep(i, n, s) for (i... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, n, s) for (int i = s; i < (n); ++i)
#define rsrep(i, n, s) for (i... | insert | 110 | 110 | 110 | 111 | TLE | |
p03053 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
/**** Type Define ****/
typedef... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
/**** Type Define ****/
typedef... | insert | 240 | 240 | 240 | 241 | TLE | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef long double ld;
#define REP(i, a, n) for (int(i) = (a); (i) < (int)(n); (i)++)
#define rep(i, n) REP(i, 0, n)
#define vec vector
const ll large_P = 1e9 + 7;
int main() {
int H, W;
cin >> H >> W;
vec... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef long double ld;
#define REP(i, a, n) for (int(i) = (a); (i) < (int)(n); (i)++)
#define rep(i, n) REP(i, 0, n)
#define vec vector
const ll large_P = 1e9 + 7;
int main() {
int H, W;
cin >> H >> W;
vec... | replace | 46 | 49 | 46 | 47 | TLE | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define pb push_back
#define mp make_pair
#define ii pair<int, int>
#define ll long long
#define forn(i... | #include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define pb push_back
#define mp make_pair
#define ii pair<int, int>
#define ll long long
#define forn(i... | replace | 50 | 51 | 50 | 51 | 0 | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdint.h>
#include <string>
#include <vector>
using namespace std;
#define PI (3.14159265358979323846)
#define INF (2147483647)
#define INF_LL (9223372036854775807)
... | #include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdint.h>
#include <string>
#include <vector>
using namespace std;
#define PI (3.14159265358979323846)
#define INF (2147483647)
#define INF_LL (9223372036854775807)
... | replace | 20 | 22 | 20 | 22 | 0 | |
p03053 | C++ | Runtime Error | /**
* Author: "Robin Singh" !!
* rob_in_1
**/
#include <bits/stdc++.h>
using namespace std;
#define dbg(args...) \
{ \
vector<string> _v = split(#args, ','); ... | /**
* Author: "Robin Singh" !!
* rob_in_1
**/
#include <bits/stdc++.h>
using namespace std;
#define dbg(args...) \
{ \
vector<string> _v = split(#args, ','); ... | replace | 100 | 102 | 100 | 101 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long LL;
using namespace std;
int main() {
int h, w;
cin >> h >> w;
vector<vector<char>> g(h, vector<char>(w));
vector<vector<int>> d(h, vector<int>(w, -1));
queue<pair<int, int>> Q;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> g[i][j];
... | #include <bits/stdc++.h>
typedef long long LL;
using namespace std;
int main() {
int h, w;
cin >> h >> w;
vector<vector<char>> g(h, vector<char>(w));
vector<vector<int>> d(h, vector<int>(w, -1));
queue<pair<int, int>> Q;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> g[i][j];
... | replace | 33 | 34 | 33 | 34 | -11 | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <deque>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
typedef pair<char, char> pair;
int H, W;
cin >> H >> W;
vector<string> maze(H);
vector<vector<int>> dist(H, vector<int>(W, -1));
for (int i = 0; i < H; i++)
cin >> maze[i];
... | #include <algorithm>
#include <deque>
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
typedef pair<int, int> pair;
int H, W;
cin >> H >> W;
vector<string> maze(H);
vector<vector<int>> dist(H, vector<int>(W, -1));
for (int i = 0; i < H; i++)
cin >> maze[i];
d... | replace | 8 | 9 | 8 | 9 | 0 | |
p03053 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <string>
#include <vector>
struct Point {
int x;
int y;
Point(int x, int y) : x(x), y(y) {}
};
struct Cell {
char c;
int count;
Cell() : c{' '}, count{std::numeric_limits<decltype(count)>::max()} {}
bool update_count... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <string>
#include <vector>
struct Point {
int x;
int y;
Point(int x, int y) : x(x), y(y) {}
};
struct Cell {
char c;
int count;
Cell() : c{' '}, count{std::numeric_limits<decltype(count)>::max()} {}
bool update_count... | replace | 77 | 83 | 77 | 83 | TLE | |
p03053 | C++ | Time Limit Exceeded | /*
author : s@if
*/
#include <bits/stdc++.h>
using namespace std;
#define NIL -1
#define fi first
#define sec second
#define MAX INT_MAX
#define INF 99999999
#define ll long long
#define PI acos(-1.0)
#define MOD 1000000007
#define PLL pair<ll, ll>
#define PII pair<int, int>
#define ull unsigned long long
#defin... | /*
author : s@if
*/
#include <bits/stdc++.h>
using namespace std;
#define NIL -1
#define fi first
#define sec second
#define MAX INT_MAX
#define INF 99999999
#define ll long long
#define PI acos(-1.0)
#define MOD 1000000007
#define PLL pair<ll, ll>
#define PII pair<int, int>
#define ull unsigned long long
#defin... | replace | 77 | 79 | 77 | 78 | TLE | |
p03053 | C++ | Time Limit Exceeded | #include <iostream>
#include <queue>
#include <set>
using namespace std;
typedef long long ll;
struct cell {
ll i, j;
cell(ll _i, ll _j) {
i = _i;
j = _j;
}
};
int main(void) {
ll H, W;
ll A[1000][1000];
cin >> H >> W;
for (ll i = 0; i < H; i++) {
for (ll j = 0; j < W; j++) {
char c;... | #include <iostream>
#include <queue>
#include <set>
using namespace std;
typedef long long ll;
struct cell {
ll i, j;
cell(ll _i, ll _j) {
i = _i;
j = _j;
}
};
int main(void) {
ll H, W;
ll A[1000][1000];
cin >> H >> W;
for (ll i = 0; i < H; i++) {
for (ll j = 0; j < W; j++) {
char c;... | insert | 55 | 55 | 55 | 59 | TLE | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
#define Rep(i, a, b) for (int i = a; i < b; i++)
#define rep(i,... | #include <algorithm>
#include <array>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
#define Rep(i, a, b) for (int i = a; i < b; i++)
#define rep(i,... | replace | 81 | 82 | 81 | 82 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
long H, W;
cin >> H >> W;
vector<vector<long>> data(H, vector<long>(W, INT_MAX));
char a;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> a;
if (a == '#')
data.at(i).at(j) = 0;
}
}
for (int i = 0; i <... | #include <bits/stdc++.h>
using namespace std;
int main() {
long H, W;
cin >> H >> W;
vector<vector<long>> data(H, vector<long>(W, INT_MAX));
char a;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
cin >> a;
if (a == '#')
data.at(i).at(j) = 0;
}
}
for (int i = 0; i <... | replace | 23 | 24 | 23 | 24 | 0 | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF 3000
#define INFF 9223372036854775807
#define ll long long
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, m, n) for (int i = m; i < n; i++)
#define ALL(N) (N.begin(), N.end())
#define de cout << "debug" << endl;
#define push_back pb
template <clas... | #include <bits/stdc++.h>
using namespace std;
#define INF 3000
#define INFF 9223372036854775807
#define ll long long
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, m, n) for (int i = m; i < n; i++)
#define ALL(N) (N.begin(), N.end())
#define de cout << "debug" << endl;
#define push_back pb
template <clas... | replace | 30 | 31 | 30 | 31 | TLE | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
string mp[1111];
int h, w;
int num[1111][1111];
int vx[4] = {1, 0, -1, 0};
int vy[4] = {0, -1, 0, 1};
bool check(int x, int y) {
return x >= 0 && x < h && y >= 0 && y < w && num[x][y] == (1e9);
}
int main() {
cin >> h >> w;
for (int i = 0; i < 1111; i++)
for (int ... | #include <bits/stdc++.h>
using namespace std;
string mp[1111];
int h, w;
int num[1111][1111];
int vx[4] = {1, 0, -1, 0};
int vy[4] = {0, -1, 0, 1};
bool check(int x, int y) {
return x >= 0 && x < h && y >= 0 && y < w && num[x][y] == (1e9);
}
int main() {
cin >> h >> w;
for (int i = 0; i < 1111; i++)
for (int ... | insert | 28 | 28 | 28 | 29 | TLE | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).beg... | #include <bits/stdc++.h>
#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).beg... | replace | 112 | 113 | 112 | 113 | TLE | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (i... | #include <bits/stdc++.h>
#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (i... | replace | 111 | 112 | 111 | 112 | TLE | |
p03053 | C++ | Runtime Error | // include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#in... | // include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#in... | replace | 45 | 46 | 45 | 46 | 0 | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <bits/stdc++.h>
#include <bitset>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>
#include <list>
#include <map>
#in... | #include <algorithm>
#include <assert.h>
#include <bits/stdc++.h>
#include <bitset>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>
#include <list>
#include <map>
#in... | insert | 53 | 53 | 53 | 55 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#ifdef _DEBUG_
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<... | #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#ifdef _DEBUG_
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<... | insert | 48 | 48 | 48 | 50 | -11 | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
vector<vector<int>> d(h + 2, vector<int>(w + 2));
queue<int> q;
for (int i = 0; i < h; i++) {
string s;
cin >> s;
for (int j = 0; j < w; j++) {
if (s[j] == '#')
q.push((w + 2) * (i + 1) + j + 1);
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
vector<vector<int>> d(h + 2, vector<int>(w + 2));
queue<int> q;
for (int i = 0; i < h; i++) {
string s;
cin >> s;
for (int j = 0; j < w; j++) {
if (s[j] == '#')
q.push((w + 2) * (i + 1) + j + 1);
... | insert | 20 | 20 | 20 | 21 | TLE | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
using namespace std;
int main(void) {
int h, w;
cin >> h >> w;
string s[1000];
for (int i = 0; i < h; i++) {
cin >> s[i];
}
queue<tuple<int, int, int>> q;
for (int i = 0; i < h; i++) {
for (int j = 0; j... | #include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
using namespace std;
int main(void) {
int h, w;
cin >> h >> w;
string s[1000];
for (int i = 0; i < h; i++) {
cin >> s[i];
}
queue<tuple<int, int, int>> q;
for (int i = 0; i < h; i++) {
for (int j = 0; j... | replace | 33 | 34 | 33 | 34 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
typedef long long ll;
ll mod = 1000000007;
int main() {
int h, w;
cin >> h >> w;
string grid[w][h];
queue<pair<int, int>> q;
int cnt_b = 0;
for (int i = 0; i < h; ++i) {
string s;
cin >> s;
for (int j = 0; j < w... | #include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
typedef long long ll;
ll mod = 1000000007;
int main() {
int h, w;
cin >> h >> w;
string grid[w][h];
queue<pair<int, int>> q;
int cnt_b = 0;
for (int i = 0; i < h; ++i) {
string s;
cin >> s;
for (int j = 0; j < w... | replace | 20 | 21 | 20 | 21 | 0 | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
const int inf = 2147483647, dx[] = {-1, 0, 1, 0},
dy[] = {0, -1, 0, 1}; // 上... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
const int inf = 2147483647, dx[] = {-1, 0, 1, 0},
dy[] = {0, -1, 0, 1}; // 上... | replace | 18 | 19 | 18 | 19 | 0 | |
p03053 | C++ | Runtime Error | #pragma region _head
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
void Init... | #pragma region _head
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
void Init... | replace | 290 | 291 | 290 | 293 | 0 | |
p03053 | Python | Runtime Error | h, w = map(int, input().split())
rb = ["#"] * (w + 2)
a = [rb + [["#"] + list(input()) + ["#"] for _ in range(h)] + rb]
p = [(i, j) for i in range(1, h + 1) for j in range(1, w + 1) if a[i][j] == "#"]
d = (-1, 0), (1, 0), (0, -1), (0, 1)
r = -1
while p:
r += 1
s = []
for i, j in p:
for di, dj in d:
... | h, w = map(int, input().split())
rb = [["#"] * (w + 2)]
a = rb + [list("#" + input() + "#") for _ in range(h)] + rb
p = [(i, j) for i in range(1, h + 1) for j in range(1, w + 1) if a[i][j] == "#"]
d = (-1, 0), (1, 0), (0, -1), (0, 1)
r = -1
while p:
r += 1
s = []
for i, j in p:
for di, dj in d:
... | replace | 1 | 3 | 1 | 3 | IndexError: list index out of range | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03053/Python/s767280437.py", line 4, in <module>
p = [(i, j) for i in range(1, h + 1) for j in range(1, w + 1) if a[i][j] == '#']
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03053/Pyt... |
p03053 | Python | Time Limit Exceeded | h, w = map(int, input().split())
rb = [["#"] * (w + 2)]
a = rb + [list("#" + input() + "#") for _ in range(h)] + rb
p = [(i, j) for i in range(1, h + 1) for j in range(1, w + 1) if a[i][j] == "#"]
d = (-1, 0), (1, 0), (0, -1), (0, 1)
r = -1
while p:
r += 1
s = []
for i, j in p:
for di, dj in d:
... | h, w = map(int, input().split())
a = [["#"] * (w + 2)] * 2
a[1:1] = (list("#" + input() + "#") for _ in range(h))
p = [(i, j) for i in range(1, h + 1) for j in range(1, w + 1) if a[i][j] == "#"]
d = (-1, 0), (1, 0), (0, -1), (0, 1)
r = -1
while p:
r += 1
s = []
for i, j in p:
for di, dj in d:
... | replace | 1 | 3 | 1 | 3 | TLE | |
p03053 | Python | Runtime Error | from collections import deque
h, w = map(int, input().split())
inf = 10**6
a = [[0] * (w + 2), *[[0] + [inf] * w + [0] for _ in range(h)], [0] * (w + 2)]
d = deque()
for i in range(h):
for j, k in enumerate(input()):
if k == "#":
a[i + 1][j + 1] = 0
d.append((i + 1, j + 1))
stp = ... | from collections import deque
h, w = map(int, input().split())
inf = 10**6
a = [[0] * (w + 2)] + [[0] + [inf] * w + [0] for _ in range(h)] + [[0] * (w + 2)]
d = deque()
for i in range(h):
for j, k in enumerate(input()):
if k == "#":
a[i + 1][j + 1] = 0
d.append((i + 1, j + 1))
stp... | replace | 4 | 5 | 4 | 5 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i < (n); i++)
#define REP2(i, d, n) for (int i = (d); i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= ... | #include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i < (n); i++)
#define REP2(i, d, n) for (int i = (d); i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= ... | replace | 64 | 65 | 64 | 65 | 0 | |
p03053 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <string.h>
using namespace std;
const int MAXN = 1005;
const int dx[] = {-1, 1, 0, 0};
const int dy[] = {0, 0, -1, 1};
int n, m;
bool a[MAXN][MAXN];
int vis[MAXN][MAXN];
int main()
{
memset(vis, -1, sizeof(vis));
queue<pair<int, int>> q;
cin >> n >> m;
for (int i ... | #include <iostream>
#include <queue>
#include <string.h>
using namespace std;
const int MAXN = 1005;
const int dx[] = {-1, 1, 0, 0};
const int dy[] = {0, 0, -1, 1};
int n, m;
bool a[MAXN][MAXN];
int vis[MAXN][MAXN];
int main()
{
memset(vis, -1, sizeof(vis));
queue<pair<int, int>> q;
cin >> n >> m;
for (int i ... | insert | 34 | 34 | 34 | 36 | -11 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define INIT(a, b) memset(a, b, sizeof(a))
using namespace std;
const int maxn = 1000 + 7;
int H, W;
char mp[maxn][maxn];
int ans = 0;
int stk[maxn << 2][2];
int wat[maxn << 2][2];
int tail, p;
void bfs() {
while (tail) {
p = 0;
for (int i = 0; i < tail; ++i) {
... | #include <bits/stdc++.h>
#define ll long long
#define INIT(a, b) memset(a, b, sizeof(a))
using namespace std;
const int maxn = 1000 + 7;
int H, W;
char mp[maxn][maxn];
int ans = 0;
int stk[maxn * maxn][2];
int wat[maxn * maxn][2];
int tail, p;
void bfs() {
while (tail) {
p = 0;
for (int i = 0; i < tail; ++i... | replace | 9 | 11 | 9 | 11 | 0 | |
p03053 | C++ | Runtime Error | #include <iostream>
#include <set>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int h, w;
cin >> h >> w;
vector<vector<char>> a(h);
set<pair<int, int>> p;
for (int i = 0; i < h; i++) {
a[i].resize(w);
for (int j = 0; j < w; j++) {
... | #include <iostream>
#include <set>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int h, w;
cin >> h >> w;
vector<vector<char>> a(h);
set<pair<int, int>> p;
for (int i = 0; i < h; i++) {
a[i].resize(w);
for (int j = 0; j < w; j++) {
... | replace | 27 | 29 | 27 | 30 | -11 | |
p03053 | C++ | Runtime Error | /*
こんにちは。あたしはカウガール。
redcoderになるためAtCoderを巡る旅をしてます。
__
ヽ|__|ノ モォ
||‘‐‘||レ _)_, ―‐ 、
/(Y (ヽ_ /・ ヽ  ̄ヽ
∠ _ ゝ `^ヽ ノ.::::_(ノヽ
_/ヽ /ヽ ̄ ̄/ヽ
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout <... | /*
こんにちは。あたしはカウガール。
redcoderになるためAtCoderを巡る旅をしてます。
__
ヽ|__|ノ モォ
||‘‐‘||レ _)_, ―‐ 、
/(Y (ヽ_ /・ ヽ  ̄ヽ
∠ _ ゝ `^ヽ ノ.::::_(ノヽ
_/ヽ /ヽ ̄ ̄/ヽ
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout <... | replace | 61 | 62 | 61 | 62 | 0 | |
p03053 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
bool custom1(pair<int, int> a, pair<int, int> b) { return (a.first < b.first); }
bool custom2(pair<int, i... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
bool custom1(pair<int, int> a, pair<int, int> b) { return (a.first < b.first); }
bool custom2(pair<int, i... | replace | 108 | 135 | 108 | 132 | TLE | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include ... | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include ... | replace | 45 | 47 | 45 | 47 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define... | replace | 53 | 55 | 53 | 55 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
int dx[4] = {-1, 0, 0, 1};
int dy[4] = {0, 1, -1, 0};
char buf[55][55];
int field[55][55];
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> buf[i][j];
}
}
for (int i = 0; i < h; i++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
int dx[4] = {-1, 0, 0, 1};
int dy[4] = {0, 1, -1, 0};
char buf[1005][1005];
int field[1005][1005];
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cin >> buf[i][j];
}
}
for (int i = 0; i < h; ... | replace | 7 | 9 | 7 | 9 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, a) for (int i = 0; i < int(a); ++i)
#define REP(i, a, b) for (int i = int(a); i < int(b); ++i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
using ll = long long;
using itn = int;
using namespace std;
int GCD(int a, int b) { return b ? GCD(b, a % b) :... | #include <bits/stdc++.h>
#define rep(i, a) for (int i = 0; i < int(a); ++i)
#define REP(i, a, b) for (int i = int(a); i < int(b); ++i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
using ll = long long;
using itn = int;
using namespace std;
int GCD(int a, int b) { return b ? GCD(b, a % b) :... | replace | 23 | 24 | 23 | 24 | 0 | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
queue<P> q;
char c[1010][1010];
int d[1010][1010];
int main() {
int ... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
queue<P> q;
char c[1010][1010];
int d[1010][1010];
int main() {
int ... | replace | 40 | 44 | 40 | 46 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef vector<vector<char>> field_t;
typedef pair<int, int> point_t;
// point_tの足し算
point_t operator+(const point_t &lhs, const point_t &rhs) {
point_t res;
res.first = lhs.first + rhs.first;
res.second = lhs.second + rhs.second;
return res;
}
// 範囲内外判定
bool is_... | #include <bits/stdc++.h>
using namespace std;
typedef vector<vector<char>> field_t;
typedef pair<int, int> point_t;
// point_tの足し算
point_t operator+(const point_t &lhs, const point_t &rhs) {
point_t res;
res.first = lhs.first + rhs.first;
res.second = lhs.second + rhs.second;
return res;
}
// 範囲内外判定
bool is_... | replace | 63 | 64 | 63 | 64 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll H, W;
cin >> H >> W;
vector<char> vec(H * W); // vecは各頂点の白か黒かを保持
vector<ll> answer(H * W + 1,
H + W); // 各黒点からの距離のうち小さいものを保持(随時更新)
for (ll i = 0; i < H * W; i++) {
cin >> vec.at(i);
}
using Graph = v... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll H, W;
cin >> H >> W;
vector<char> vec(H * W); // vecは各頂点の白か黒かを保持
vector<ll> answer(H * W + 1,
H + W); // 各黒点からの距離のうち小さいものを保持(随時更新)
for (ll i = 0; i < H * W; i++) {
cin >> vec.at(i);
}
using Graph = v... | replace | 12 | 13 | 12 | 13 | 0 | |
p03053 | C++ | Runtime Error |
#include <bits/stdc++.h>
using namespace std;
using p_int = pair<int, int>;
int H, W;
// char field[1000][1000];
char field[6][6];
p_int direction[4] = {make_pair(1, 0), make_pair(0, 1), make_pair(-1, 0),
make_pair(0, -1)};
vector<p_int> blacks;
int main() {
cin.tie(nullptr);
ios::sync_with_... |
#include <bits/stdc++.h>
using namespace std;
using p_int = pair<int, int>;
int H, W;
char field[1000][1000];
p_int direction[4] = {make_pair(1, 0), make_pair(0, 1), make_pair(-1, 0),
make_pair(0, -1)};
vector<p_int> blacks;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cin ... | replace | 5 | 7 | 5 | 6 | 0 | |
p03053 | C++ | Runtime Error | #include <iostream>
#include <queue>
#define rep(i, n) for (int i = 0; i < n; i++)
#define move(i) for (int i = -1; i <= 1; i += 2)
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INF 1e9
using namespace std;
using P = pair<int, int>;
int h, w, M[50][50], C[50][50], D[50][50];
queue<P> Q;
int main() {
cin ... | #include <iostream>
#include <queue>
#define rep(i, n) for (int i = 0; i < n; i++)
#define move(i) for (int i = -1; i <= 1; i += 2)
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INF 1e9
using namespace std;
using P = pair<int, int>;
int h, w, M[1010][1010], C[1010][1010], D[1010][1010];
queue<P> Q;
int mai... | replace | 13 | 14 | 13 | 14 | 0 | |
p03053 | C++ | Runtime Error | /* #include */
#include "bits/stdc++.h"
#include <sstream>
/* 名前空間 */
using namespace std;
/* #define */
// リピート
#define rpt0(i, n) for (ll i = 0; i < (n); i++) // リピート 0からn - 1まで
#define rpt1(i, n) for (ll i = 1; i <= (n); i++) // リピート 1からnまで
#define rptb0(i, n) ... | /* #include */
#include "bits/stdc++.h"
#include <sstream>
/* 名前空間 */
using namespace std;
/* #define */
// リピート
#define rpt0(i, n) for (ll i = 0; i < (n); i++) // リピート 0からn - 1まで
#define rpt1(i, n) for (ll i = 1; i <= (n); i++) // リピート 1からnまで
#define rptb0(i, n) ... | replace | 145 | 146 | 145 | 146 | 0 | |
p03053 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#inc... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#inc... | delete | 62 | 63 | 62 | 62 | TLE | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = int;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll IN... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = int;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll IN... | replace | 221 | 223 | 221 | 223 | 0 | |
p03053 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
int n, m, ans;
char s[1111][1111];
int vis[1111][1111];
struct node {
int x, y, step;
} nex, now;
queue<node> que;
void bfs() {
while (!que.empty()) {
now = que.front();
que.pop();
ans = max(ans... | #include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
int n, m, ans;
char s[1111][1111];
int vis[1111][1111];
struct node {
int x, y, step;
} nex, now;
queue<node> que;
void bfs() {
while (!que.empty()) {
now = que.front();
que.pop();
ans = max(ans... | replace | 21 | 22 | 21 | 22 | -11 | |
p03053 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
#define CHMAX(a, b) a = std::max(a, b)
#define CHMIN(a, b) a = std::min(a, b)
#define CHABS(a) a = std::abs(a)
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
#define CHMAX(a, b) a = std::max(a, b)
#define CHMIN(a, b) a = std::min(a, b)
#define CHABS(a) a = std::abs(a)
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std... | replace | 61 | 62 | 61 | 62 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int h, w, n, sr, sc;
char s1[N], s2[N];
bool judge(char opt) {
int x = sr, y = sc;
for (int i = 1; i <= n; i++) {
if (s1[i] == opt) {
if (opt == 'U')
x--;
else if (opt == 'D')
x++;
else if (opt == 'L')
... | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int h, w, n, sr, sc;
char s1[N], s2[N];
bool judge(char opt) {
int x = sr, y = sc;
for (int i = 1; i <= n; i++) {
if (s1[i] == opt) {
if (opt == 'U')
x--;
else if (opt == 'D')
x++;
else if (opt == 'L')
... | replace | 2 | 3 | 2 | 3 | 0 | |
p03054 | C++ | Runtime Error | // https://atcoder.jp/contests/agc033/tasks/agc033_b
/*<head>*/
// #include "Template.cpp"
/*</head>*/
/*<body>*/
/* #region header */
/**
* @file template.cpp
* @brief 競技プログラミング用テンプレート
* @author btk15049
* @date 2019/05/02
*/
#include <bits/stdc++.h>
using namespace std;
/* #region macro */
#ifdef BTK
#define D... | // https://atcoder.jp/contests/agc033/tasks/agc033_b
/*<head>*/
// #include "Template.cpp"
/*</head>*/
/*<body>*/
/* #region header */
/**
* @file template.cpp
* @brief 競技プログラミング用テンプレート
* @author btk15049
* @date 2019/05/02
*/
#include <bits/stdc++.h>
using namespace std;
/* #region macro */
#ifdef BTK
#define D... | replace | 152 | 154 | 152 | 157 | 0 | |
p03054 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
typedef long long LL;
const int N = 2e5 + 100;
char a[N], b[N], c[N];
int h_max[N], h_min[N], v_max[N], v_min[N];
int h_max_suf[N], h_min_suf[N], v_max_suf[N], v_min_suf[N];
int main() {
int n, m, Q;... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
typedef long long LL;
const int N = 4e5 + 100;
char a[N], b[N], c[N];
int h_max[N], h_min[N], v_max[N], v_min[N];
int h_max_suf[N], h_min_suf[N], v_max_suf[N], v_min_suf[N];
int main() {
int n, m, Q;... | replace | 9 | 10 | 9 | 10 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef pair<P, int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#def... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef pair<P, int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#def... | replace | 30 | 34 | 30 | 34 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int mx = 200005;
int h, w, n, x, y, r, l, u, d;
char s[mx], t[mx];
int main() {
scanf("%d%d%d%d%d%s%s", &h, &w, &n, &x, &y, s, t);
l = 1;
r = w;
u = 1;
d = h;
for (int i = n - 1; i >= 0; i--) {
if (t[i] == 'L' && r != w)
r++;
else if (t[i] =... | #include <bits/stdc++.h>
using namespace std;
const int mx = 200005;
int h, w, n, x, y, r, l, u, d;
char s[mx], t[mx];
int main() {
scanf("%d%d%d%d%d%s%s", &h, &w, &n, &x, &y, s, t);
l = 1;
r = w;
u = 1;
d = h;
for (int i = n - 1; i >= 0; i--) {
if (t[i] == 'L' && r != w)
r++;
else if (t[i] =... | replace | 30 | 31 | 30 | 31 | 0 | |
p03054 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
namespace {
#define DUMPOUT cerr
#ifndef DEBUG_
#define dump(...)
#else
#define dump(...) \
DUMPOUT << " "; \
DUMPOUT << #__VA_ARGS__ << " :[" << _... | #include <bits/stdc++.h>
using namespace std;
namespace {
#define DUMPOUT cerr
#ifndef DEBUG_
#define dump(...)
#else
#define dump(...) \
DUMPOUT << " "; \
DUMPOUT << #__VA_ARGS__ << " :[" << _... | replace | 218 | 259 | 218 | 274 | TLE | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string dirs = "LRUD";
int pre[2][4][200005];
int di[] = {0, 0, -1, 1};
int dj[] = {-1, 1, 0, 0};
int n, m, l;
bool valid(int i, int j) { return i > 0 && j > 0 && i <= n && j <= m; }
int main() {
#ifndef ONLINE_JUDGE
freopen("input.in", "r", stdin);
#endif
ios::sync_... | #include <bits/stdc++.h>
using namespace std;
string dirs = "LRUD";
int pre[2][4][200005];
int di[] = {0, 0, -1, 1};
int dj[] = {-1, 1, 0, 0};
int n, m, l;
bool valid(int i, int j) { return i > 0 && j > 0 && i <= n && j <= m; }
int main() {
#ifndef ONLINE_JUDGE
// freopen("input.in", "r", stdin);
#endif
ios::sy... | replace | 13 | 14 | 13 | 14 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#if 0
const int MOD = ;
inline int lgput(int a, int b) {
int ans = 1;
while(b > 0) {
if(b & 1) ans = (1LL * ans * a) % MOD;
b >>= 1;
a = (1LL * a * a) % MOD;
}
return ans;
}
... | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#if 0
const int MOD = ;
inline int lgput(int a, int b) {
int ans = 1;
while(b > 0) {
if(b & 1) ans = (1LL * ans * a) % MOD;
b >>= 1;
a = (1LL * a * a) % MOD;
}
return ans;
}
... | replace | 68 | 69 | 68 | 69 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound
const int MAX_N = 200000;
int H, W, N;
int sr, sc;
string S, T;
int slr[MAX_N], tlr[MAX_N], sud[MAX_... | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound
const int MAX_N = 200000;
int H, W, N;
int sr, sc;
string S, T;
int slr[MAX_N], tlr[MAX_N], sud[MAX_... | delete | 79 | 80 | 79 | 79 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
const int N = 100010;
char str1[N], str2[N];
int n;
int main() {
int n1, n2, x1, x2;
scanf("%d%d%d", &n1, &n2, &n);
scanf("%d%d", &x1, &x2);
scanf("%s%s", str1 + 1, str2 + 1);
bool f = 1;
int L = 0, R = n1 + 1;
for (int i = n; i >= 1; i--) {
if (str2[i] == 'L' || str2[i]... | #include <bits/stdc++.h>
const int N = 200010;
char str1[N], str2[N];
int n;
int main() {
int n1, n2, x1, x2;
scanf("%d%d%d", &n1, &n2, &n);
scanf("%d%d", &x1, &x2);
scanf("%s%s", str1 + 1, str2 + 1);
bool f = 1;
int L = 0, R = n1 + 1;
for (int i = n; i >= 1; i--) {
if (str2[i] == 'L' || str2[i]... | replace | 2 | 3 | 2 | 3 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
inline char gc() {
static char buf[100000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
? EOF
: *p1++;
}
#define gc getchar
inline int rd() {
int x = 0, fl = 1;
char ch = gc();
for (... | #include <bits/stdc++.h>
using namespace std;
inline char gc() {
static char buf[100000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
? EOF
: *p1++;
}
#define gc getchar
inline int rd() {
int x = 0, fl = 1;
char ch = gc();
for (... | replace | 30 | 31 | 30 | 31 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 7;
typedef pair<int, int> ii;
int main() {
int h, w, n;
scanf("%d %d %d", &h, &w, &n);
int sr, sc;
scanf("%d %d", &sr, &sc);
char t[N];
char a[N];
int r[] = {0, 0};
int l[] = {0, 0};
int u[] = {0, 0};
int d[] = {0, 0};
getcha... | #include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 7;
typedef pair<int, int> ii;
int main() {
int h, w, n;
scanf("%d %d %d", &h, &w, &n);
int sr, sc;
scanf("%d %d", &sr, &sc);
char t[N];
char a[N];
int r[] = {0, 0};
int l[] = {0, 0};
int u[] = {0, 0};
int d[] = {0, 0};
getcha... | replace | 4 | 5 | 4 | 5 | 0 | |
p03054 | C++ | Runtime Error | // #pragma GCC optimize(3)
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
typedef long long LL;
using namespace std;
#define MAXN 105
char t[MAXN];
char a[MAXN];
int tongt[4]; // LRUD
int tonga[4];
bool a1[MAXN];
int main() {
// ios::sync_with_stdio(false);
// cin.tie(0);
int groups;
// scanf("%d... | // #pragma GCC optimize(3)
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
typedef long long LL;
using namespace std;
#define MAXN 200005
char t[MAXN];
char a[MAXN];
int tongt[4]; // LRUD
int tonga[4];
bool a1[MAXN];
int main() {
// ios::sync_with_stdio(false);
// cin.tie(0);
int groups;
// scanf(... | replace | 8 | 9 | 8 | 9 | 0 | |
p03054 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, N, Sx, Sy;
cin >> H >> W >> N >> Sx >> Sy;
string S, T;
cin >> S >> T;
bool flag = true; // true ならTの勝ち。つまりYes
int down[20200]; // 累積和にあたるもの
int up[20200]; // 初手で出れる場合があるんだよな
int right[20200];
int left[20200];
for (int i = 0; ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, N, Sx, Sy;
cin >> H >> W >> N >> Sx >> Sy;
string S, T;
cin >> S >> T;
bool flag = true; // true ならTの勝ち。つまりYes
int down[202000]; // 累積和にあたるもの
int up[202000]; // 初手で出れる場合があるんだよな
int right[202000];
int left[202000];
for (int i =... | replace | 11 | 15 | 11 | 15 | 0 | |
p03054 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#include <bitset>
#include <iostream>
using namespace std;
int h, w, n;
int sr, sc;
string s, t;
bitset<200003> b;
template <char c1, char c2> bool solve(int m, int pos) {
... | #pragma GCC optimize("O3", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC optimize("tree-vectorize")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#include <bitset>
#include <iostream>
using namespace std;
int h, w, n;
int sr, sc;
string s, t;
bitset<200003> b;
template <char c1, c... | insert | 1 | 1 | 1 | 2 | TLE | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#defin... | #include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(1e9 + 7)
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n) for (int i = 1; i <= (int)(n); i++)
#define REP(i, n) for (int i = n - 1; i >= 0; i--)
#define REPS(i, n) for (int i = n; i > 0; i--)
#defin... | replace | 34 | 35 | 34 | 35 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template <typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template <typename T> void chmax(T ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template <typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template <typename T> void chmax(T ... | replace | 43 | 44 | 43 | 44 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int fir[N], snd[N], d[N];
int hed[N], to[N << 1], nxt[N << 1], cnt;
int L = 0;
inline void dfs(int x, int pre) {
d[x] = d[pre] + 1;
fir[x] = snd[x] = d[x];
for (int i = hed[x]; i; i = nxt[i]) {
int v = to[i];
if (v == pre)
continue... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int fir[N], snd[N], d[N];
int hed[N], to[N << 1], nxt[N << 1], cnt;
int L = 0;
inline void dfs(int x, int pre) {
d[x] = d[pre] + 1;
fir[x] = snd[x] = d[x];
for (int i = hed[x]; i; i = nxt[i]) {
int v = to[i];
if (v == pre)
continue... | replace | 2 | 3 | 2 | 3 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define pb push_back
vector<vector<int>> E;
// Eは頂点数+1をとっておく
int diameter(int x) { // 頂点数を入れる
int ans = 0, en;
queue<int> q;
vector<int> dis(x + 1, 0); // 何マスで訪れたか
dis.at(x) = -1;
q.push(x);
while (q.si... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define pb push_back
vector<vector<int>> E;
// Eは頂点数+1をとっておく
int diameter(int x) { // 頂点数を入れる
int ans = 0, en = x;
queue<int> q;
vector<int> dis(x + 1, 0); // 何マスで訪れたか
dis.at(x) = -1;
q.push(x);
while (... | replace | 11 | 12 | 11 | 12 | 0 | |
p03055 | C++ | Runtime Error | // template version 1.15
using namespace std;
#include <bits/stdc++.h>
// varibable settings
#define int long long
const int INF = 1e18;
// define basic macro {{{
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep... | // template version 1.15
using namespace std;
#include <bits/stdc++.h>
// varibable settings
#define int long long
const int INF = 1e18;
// define basic macro {{{
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep... | insert | 78 | 78 | 78 | 82 | 0 | |
p03055 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <un... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <un... | replace | 23 | 24 | 23 | 24 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int d[101];
vector<int> gr[101];
void dfs(int cur, int parent) {
for (int adj : gr[cur]) {
if (adj != parent) {
d[adj] = d[cur] + 1;
dfs(adj, cur);
}
}
}
int main() {
int n;
cin >> n;
for (int i = 0; i < n - 1; i++) {
int u, v;
cin >> ... | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int d[N];
vector<int> gr[N];
void dfs(int cur, int parent) {
for (int adj : gr[cur]) {
if (adj != parent) {
d[adj] = d[cur] + 1;
dfs(adj, cur);
}
}
}
int main() {
int n;
cin >> n;
for (int i = 0; i < n - 1; i++) {
i... | replace | 2 | 4 | 2 | 5 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int N;
bool dp[MAXN];
vector<int> adj[MAXN];
int s, md;
void dfs(int cur, int prv, int d) {
if (d > md) {
s = cur;
md = d;
}
for (int nxt : adj[cur]) {
if (nxt == prv)
continue;
dfs(nxt, cur, d + 1);
}
}
int main() {... | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int N;
bool dp[MAXN];
vector<int> adj[MAXN];
int s, md;
void dfs(int cur, int prv, int d) {
if (d > md) {
s = cur;
md = d;
}
for (int nxt : adj[cur]) {
if (nxt == prv)
continue;
dfs(nxt, cur, d + 1);
}
}
int main() {... | replace | 3 | 4 | 3 | 4 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FASTIO
#define endl \
"\n" // Since endl forces a buffer flush which slows down large I/O
// operations.
#define ff first
#define ss second
#define pb push_back
#define input(c, n) ... | #include <bits/stdc++.h>
#define FASTIO
#define endl \
"\n" // Since endl forces a buffer flush which slows down large I/O
// operations.
#define ff first
#define ss second
#define pb push_back
#define input(c, n) ... | replace | 63 | 64 | 63 | 64 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define PER(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, l, r) for (int i = l; i <= r; i++)
#define ROF(i, l, r) for (int i = r; i >= l; i--)
#define DEBUG(x) cout << #x << "=" << x << endl;
#define SHOW1(A, n) ... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define PER(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, l, r) for (int i = l; i <= r; i++)
#define ROF(i, l, r) for (int i = r; i >= l; i--)
#define DEBUG(x) cout << #x << "=" << x << endl;
#define SHOW1(A, n) ... | replace | 23 | 24 | 23 | 24 | 0 | |
p03055 | C++ | Runtime Error | /*
Author: QAQAutomaton
Lang: C++
Code: C.cpp
Mail: lk@qaq-am.com
Blog: https://www.qaq-am.com/
*/
#include <bits/stdc++.h>
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define DEBUG printf("Passing [%s] in LINE %d\n", __FUNCTION__, __LINE__)
#define Debug debug("Passing [%s] in LINE %d\n", __FUNCTION__, __LINE__)
#... | /*
Author: QAQAutomaton
Lang: C++
Code: C.cpp
Mail: lk@qaq-am.com
Blog: https://www.qaq-am.com/
*/
#include <bits/stdc++.h>
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define DEBUG printf("Passing [%s] in LINE %d\n", __FUNCTION__, __LINE__)
#define Debug debug("Passing [%s] in LINE %d\n", __FUNCTION__, __LINE__)
#... | replace | 130 | 133 | 130 | 133 | 0 | |
p03055 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> edge;
void dfs(int idx, int y, int d, vector<int> &vv) {
if (vv[idx] >= 0)
return;
vv[idx] = d;
for (int x : edge[idx]) {
if (x == y)
continue;
dfs(x, idx, d + 1, vv);
}
}
int main() {
int N;
cin >> N;
edge... | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> edge;
void dfs(int idx, int y, int d, vector<int> &vv) {
if (vv[idx] >= 0)
return;
vv[idx] = d;
for (int x : edge[idx]) {
if (x == y)
continue;
dfs(x, idx, d + 1, vv);
}
}
int main() {
int N;
cin >> N;
edge... | replace | 21 | 22 | 21 | 22 | 0 | |
p03055 | C++ | Runtime Error | /*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i, m, n) for (ll i = (m); i < (n); i++)
#define rrep(i, m, n) for (ll i = (m); i >= (n); i--)
#define printa(x, n) ... | /*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i, m, n) for (ll i = (m); i < (n); i++)
#define rrep(i, m, n) for (ll i = (m); i >= (n); i--)
#define printa(x, n) ... | insert | 34 | 34 | 34 | 39 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #define int long long
// #define double long double
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i < (int)(n); ++i)
#define repeq(i, n) for (int i = 0; i <= (int)(n); ++i)
#define rep1eq(i, n) for (int i = 1; i <= (int)(n); ++i)... | #include <bits/stdc++.h>
using namespace std;
// #define int long long
// #define double long double
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i < (int)(n); ++i)
#define repeq(i, n) for (int i = 0; i <= (int)(n); ++i)
#define rep1eq(i, n) for (int i = 1; i <= (int)(n); ++i)... | insert | 99 | 99 | 99 | 105 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9 + 10;
const ll LINF = 1LL * INF * INF;
const int MAXN = 1e5 + 10;
const int MAXM = 3e3 ... | #include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9 + 10;
const ll LINF = 1LL * INF * INF;
const int MAXN = 2e5 + 10;
const int MAXM = 3e3 ... | replace | 12 | 13 | 12 | 13 | 0 | |
p03055 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
const int N = 1e5 + 5;
struct edge {
int u, v, next;
} e[N * 2];
int head[N], cnt;
int dep[N], x, y;
int n, m;
void add_edge(int u, int v) {
e[++cnt] = (edge){u, v, head[u]};
head... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
const int N = 2e5 + 5;
struct edge {
int u, v, next;
} e[N * 2];
int head[N], cnt;
int dep[N], x, y;
int n, m;
void add_edge(int u, int v) {
e[++cnt] = (edge){u, v, head[u]};
head... | replace | 7 | 8 | 7 | 8 | 0 | |
p03055 | C++ | Runtime Error | #include <algorithm> // minmax, sort, swap
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <cstdio> // printf, scanf
#include <deque> // deque
#include <functional> // std::function<void(int)>
#include <iomanip> // cout<<setprecision(n)
#in... | #include <algorithm> // minmax, sort, swap
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <cstdio> // printf, scanf
#include <deque> // deque
#include <functional> // std::function<void(int)>
#include <iomanip> // cout<<setprecision(n)
#in... | replace | 39 | 40 | 39 | 40 | 0 | |
p03055 | C++ | Runtime Error | #ifdef __LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
template <typename T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
#define... | #ifdef __LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
template <typename T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
#define... | replace | 41 | 42 | 41 | 42 | 0 | |
p03055 | C++ | Runtime Error | /*
ЗАПУСКАЕМ
░ГУСЯ░▄▀▀▀▄░РАБОТЯГУ░░
▄███▀░◐░░░▌░░░░░░░
░░░░▌░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▌░░░░░▐▄▄░░░░░
░░░░▌░░░░▄▀▒▒▀▀▀▀▄
░░░▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄
░░░▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄
░░░░▀▄░░░░▀▄... | /*
ЗАПУСКАЕМ
░ГУСЯ░▄▀▀▀▄░РАБОТЯГУ░░
▄███▀░◐░░░▌░░░░░░░
░░░░▌░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▐░░░░░▐░░░░░░░
░░░░▌░░░░░▐▄▄░░░░░
░░░░▌░░░░▄▀▒▒▀▀▀▀▄
░░░▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄
░░░▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄
░░░░▀▄░░░░▀▄... | replace | 104 | 105 | 104 | 105 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
// const int MOD=998244353;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<vector<int>> tree(n + 1);
for (int i = 0; i < n; i++) {
int x, y;
cin >> x >> y;
tree[x].push_back(y);
tree... | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
// const int MOD=998244353;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<vector<int>> tree(n + 1);
for (int i = 0; i < n - 1; i++) {
int x, y;
cin >> x >> y;
tree[x].push_back(y);
... | replace | 17 | 18 | 17 | 18 | 0 | |
p03055 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for... | replace | 38 | 40 | 38 | 40 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
pair<uint64_t, uint64_t>
farthest(uint64_t N, map<uint64_t, set<uint64_t>> &edges, uint64_t src) {
vector<bool> visited(N, false);
stack<pair<uint64_t, uint64_t>> s;
s.emplace(src, 0);
uint64_t max_len = 0, max_len_node = -1;
while (!s.empty()) {
pair<uint... | #include <bits/stdc++.h>
using namespace std;
pair<uint64_t, uint64_t>
farthest(uint64_t N, map<uint64_t, set<uint64_t>> &edges, uint64_t src) {
vector<bool> visited(N, false);
stack<pair<uint64_t, uint64_t>> s;
s.emplace(src, 0);
uint64_t max_len = 0, max_len_node = 0;
while (!s.empty()) {
pair<uint6... | replace | 11 | 12 | 11 | 12 | 0 | |
p03055 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define al... | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define al... | replace | 30 | 31 | 30 | 31 | 0 | |
p03055 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <map>
#include <set>
#include <string>
#include <thread>
#include <unordered_set>
#include <vector>
using namespace std;
const int N = 1e5 + 10;
vector<int> G[N];
pair<int, int> ... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <map>
#include <set>
#include <string>
#include <thread>
#include <unordered_set>
#include <vector>
using namespace std;
const int N = 3e5 + 10;
vector<int> G[N];
pair<int, int> ... | replace | 16 | 17 | 16 | 17 | 0 | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
template <typename T>
vector<T> Dijkstra(int s, vector<vec... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
template <typename T>
vector<T> Dijkstra(int s, vector<vec... | insert | 42 | 42 | 42 | 46 | 0 | |
p03055 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
vector<int> edge[200000];
int d[2][200000];
int INF = 1e9;
int opposite = 0;
int max_dist = 0;
void f(int index, int x) {
int dx = d[index][x];
if (dx > max_dist) {
opposite = x;
max_dist = dx;
}
int s = edge[x].size();
for (int i = 0; i < ... | #include <iostream>
#include <vector>
using namespace std;
vector<int> edge[200000];
int d[2][200000];
int INF = 1e9;
int opposite = 0;
int max_dist = 0;
void f(int index, int x) {
int dx = d[index][x];
if (dx > max_dist) {
opposite = x;
max_dist = dx;
}
int s = edge[x].size();
for (int i = 0; i < ... | insert | 36 | 36 | 36 | 40 | 0 | |
p03055 | 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 n, a, b, x, d[100009];
vector<int> e[100009];
int bfs(int s) {
rep(i, n + 1) d[i] = inf;
d[s] = 0;
queue<int> que;
que.push(s);
int now;
while (!que.empty()) {
... | #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 n, a, b, x, d[200009];
vector<int> e[200009];
int bfs(int s) {
rep(i, n + 1) d[i] = inf;
d[s] = 0;
queue<int> que;
que.push(s);
int now;
while (!que.empty()) {
... | replace | 6 | 8 | 6 | 8 | 0 | |
p03055 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int FindFurthest(vector<vector<int>> &adj_nodes, int start, int *p_furthest) {
int N = adj_nodes.size();
vector<b... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int FindFurthest(vector<vector<int>> &adj_nodes, int start, int *p_furthest) {
int N = adj_nodes.size();
vector<b... | insert | 58 | 58 | 58 | 63 | 0 | |
p03055 | C++ | Runtime Error | #include <algorithm>
#include <iomanip> // std::setw(int), std::setfill(char)
#include <ios> // std::left, std::right
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
vector<int> G[200... | #include <algorithm>
#include <iomanip> // std::setw(int), std::setfill(char)
#include <ios> // std::left, std::right
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
vector<int> G[200... | replace | 33 | 38 | 33 | 40 | 0 | |
p03055 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define r... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define r... | insert | 28 | 28 | 28 | 32 | 0 | |
p03055 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template <class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i, a, n) for (int(i) = (a); (i) < (n); ++(i))
#define eFOR(i, a, n) fo... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template <class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i, a, n) for (int(i) = (a); (i) < (n); ++(i))
#define eFOR(i, a, n) fo... | replace | 73 | 74 | 73 | 74 | TLE | |
p03055 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using multiInt = boost::multiprecision::cpp_int;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_temp>
using smaller_queue = priority_queue<Q_temp... | #include <bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using multiInt = boost::multiprecision::cpp_int;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_temp>
using smaller_queue = priority_queue<Q_temp... | replace | 82 | 83 | 82 | 83 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.