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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
long long ac = 0;
long long wa = 0;
vector<long long> wrong(n, 0);
vector<bool> isac(n, 0);
for (int i = 0; i < m; ++i) {
int p;
string s;
cin >> p >> s;
if (!isac[p]) {
if (s == "AC") {
is... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
long long ac = 0;
long long wa = 0;
vector<long long> wrong(n, 0);
vector<bool> isac(n, 0);
for (int i = 0; i < m; ++i) {
int p;
string s;
cin >> p >> s;
--p;
if (!isac[p]) {
if (s == "AC") {
... | insert | 16 | 16 | 16 | 17 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
static int wa[10000];
static bool ac[10000];
int n, m;
cin >> n >> m;
int p, a = 0, w = 0;
string s;
for (int i = 0; i < m; i++) {
cin >> p >> s;
if (ac[p])
continue;
if (s == "WA")
wa[p]++;
else {
ac[p] = tru... | #include <bits/stdc++.h>
using namespace std;
int main() {
static int wa[100001];
static bool ac[100001];
int n, m;
cin >> n >> m;
int p, a = 0, w = 0;
string s;
for (int i = 0; i < m; i++) {
cin >> p >> s;
if (ac[p])
continue;
if (s == "WA")
wa[p]++;
else {
ac[p] = t... | replace | 5 | 7 | 5 | 7 | 0 | |
p02802 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int)x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int)x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
... | replace | 39 | 50 | 39 | 52 | TLE | |
p02802 | 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;
int main() {
ll n, m;
cin >> n >> m;
vector<ll> p(n + 10);
vector<ll> wa(n + 10);
ll pen = 0;
ll ans = 0;
rep(i, m) {
ll prob;
string res;
cin >> prob >> res;
if (p[prob] ==... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
ll n, m;
cin >> n >> m;
vector<ll> p(n + 10);
vector<ll> wa(n + 10);
ll pen = 0;
ll ans = 0;
rep(i, m) {
ll prob;
string res;
cin >> prob >> res;
if (p[prob] ==... | replace | 26 | 27 | 26 | 27 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).e... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).e... | replace | 33 | 34 | 33 | 34 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, AC = 0, WA = 0;
cin >> N >> M;
vector<int> p(M), wa(M, 0);
vector<string> S(M);
vector<bool> flag(105000, false);
for (int i = 0; i < M; ++i) {
cin >> p.at(i) >> S.at(i);
if (!flag.at(p.at(i))) {
if (S.at(i) == "WA") {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, AC = 0, WA = 0;
cin >> N >> M;
vector<int> p(M), wa(105000, 0);
vector<string> S(M);
vector<bool> flag(105000, false);
for (int i = 0; i < M; ++i) {
cin >> p.at(i) >> S.at(i);
if (!flag.at(p.at(i))) {
if (S.at(i) == "WA") {
... | replace | 6 | 7 | 6 | 7 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, m, wans = 0, ans = 0;
cin >> n >> m;
vector<int> p(m), ac(n, 0), wa(n, 0);
vector<string> s(m);
rep(i, m) {
cin >> p.at(i) >> s.at(i);
if (ac... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, m, wans = 0, ans = 0;
cin >> n >> m;
vector<int> p(m), ac(n, 0), wa(n, 0);
vector<string> s(m);
rep(i, m) {
cin >> p.at(i) >> s.at(i);
if (ac... | replace | 17 | 18 | 17 | 18 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
|
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, m, p, countWA = 0, countAC = 0;
string s;
cin >> n >> m;
std::deque<int> deq(n + 1, 0);
std::vector<vector<int>> vec(n, vector<int>(1, 0));
for (int i = 0; i < m; i++) {
cin >> p >> s;
if (deq[p] == 0 && s == "AC") {
countAC... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, m, p, countWA = 0, countAC = 0;
string s;
cin >> n >> m;
std::deque<int> deq(n + 1, 0);
std::vector<vector<int>> vec(n + 1, vector<int>(1, 0));
for (int i = 0; i < m; i++) {
cin >> p >> s;
if (deq[p] == 0 && s == "AC") {
cou... | replace | 7 | 8 | 7 | 8 | -11 | |
p02802 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int main(void) {
int n, m;
cin >> n >> m;
int ac = 0, wa = 0;
vector<bool> AC(n);
vector<int> WA(0);
for (int i = 0; i < m; i++) {
int p;
string s;
cin >> p >> s;
p--;
if (AC[p])
continue;
if (s == "AC") {
ac++;... | #include <iostream>
#include <vector>
using namespace std;
int main(void) {
int n, m;
cin >> n >> m;
int ac = 0, wa = 0;
vector<bool> AC(n);
vector<int> WA(n, 0);
for (int i = 0; i < m; i++) {
int p;
string s;
cin >> p >> s;
p--;
if (AC[p])
continue;
if (s == "AC") {
ac... | replace | 8 | 9 | 8 | 9 | -11 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, m;
cin >> n >> m;
vector<int> a(m);
vector<string> b(m);
int i;
for (i = 0; i < m; i++) {
cin >> a.at(i) >> b.at(i);
}
int count_1 = 0, count_2 = 0;
vector<pair<bool, int>> is(n);... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int n, m;
cin >> n >> m;
vector<int> a(m);
vector<string> b(m);
int i;
for (i = 0; i < m; i++) {
cin >> a.at(i) >> b.at(i);
}
int count_1 = 0, count_2 = 0;
vector<pair<bool, int>> is(n);... | replace | 25 | 26 | 25 | 26 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9;
const int MOD = 1000000007;
int main() {
ll n, m;
cin >> n >> m;
vector<ll> p(m);
vector<string> s(m);
rep(i, m) cin >> p[i] >> s[i];
vector... | #include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9;
const int MOD = 1000000007;
int main() {
ll n, m;
cin >> n >> m;
vector<ll> p(m);
vector<string> s(m);
rep(i, m) cin >> p[i] >> s[i];
vector... | replace | 14 | 15 | 14 | 15 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, x, N) for (long long i = x; i < (N); i++)
using namespace std;
int main() {
long long N, M;
cin >> N >> M;
vector<long long> a(M);
vector<string> b(M);
vector<pair<long long, string>> p(M);
rep(i, 0, M) {
cin >> a[i] >> b[i];
p[i] = make_pair(a[i], b[i]);
}
... | #include <bits/stdc++.h>
#define rep(i, x, N) for (long long i = x; i < (N); i++)
using namespace std;
int main() {
long long N, M;
cin >> N >> M;
vector<long long> a(M);
vector<string> b(M);
vector<pair<long long, string>> p(M);
rep(i, 0, M) {
cin >> a[i] >> b[i];
p[i] = make_pair(a[i], b[i]);
}
... | replace | 13 | 17 | 13 | 27 | 0 | |
p02802 | C++ | Runtime Error | #include <iostream>
using namespace std;
int p[10007] = {};
bool ac[10007] = {};
int main() {
int n, m, a;
cin >> n >> m;
string s;
int pen = 0, corr = 0;
for (int i = 0; i < m; i++) {
cin >> a >> s;
if (s == "AC") {
if (!ac[a]) {
pen += p[a];
ac[a] = 1;
corr++;
}... | #include <iostream>
using namespace std;
int p[100007] = {};
bool ac[100007] = {};
int main() {
int n, m, a;
cin >> n >> m;
string s;
int pen = 0, corr = 0;
for (int i = 0; i < m; i++) {
cin >> a >> s;
if (s == "AC") {
if (!ac[a]) {
pen += p[a];
ac[a] = 1;
corr++;
... | replace | 3 | 5 | 3 | 5 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
//----------------------------------------------------------------------------------------------------------------------
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define mp make_pair
#define pb push_back
#define FOR(x, to) ... | #include <bits/stdc++.h>
using namespace std;
//----------------------------------------------------------------------------------------------------------------------
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define mp make_pair
#define pb push_back
#define FOR(x, to) ... | replace | 61 | 63 | 61 | 63 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, s, e) for (int i = (s); i < (e); i++)
#define all(obj) (obj).begin(), (obj).end()
/*卍卍卍 #define int long long 卍卍卍*/
signed main() {
int n, m;
cin >> n >> m;
vector<vector<int>> acwa_pena(n, vector<int>... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, s, e) for (int i = (s); i < (e); i++)
#define all(obj) (obj).begin(), (obj).end()
/*卍卍卍 #define int long long 卍卍卍*/
signed main() {
int n, m;
cin >> n >> m;
vector<vector<int>> acwa_pena(n, vector<int>... | replace | 15 | 18 | 15 | 18 | -11 | |
p02802 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int na = 0;
vector<bool> V(N, false);
vector<int> np(N, 0);
for (int i = 0; i < M; ++i) {
int p;
string s;
cin >> p >> s;
--p;
if (V[p])
continue;
if (s == "AC"... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int na = 0;
vector<bool> V(N, false);
vector<int> np(N, 0);
for (int i = 0; i < M; ++i) {
int p;
string s;
cin >> p >> s;
--p;
if (V[p])
continue;
if (s == "AC"... | replace | 29 | 30 | 29 | 30 | 0 | |
p02802 | C++ | Runtime Error | #include <cstring>
#include <iostream>
using namespace std;
int main() {
int penalties[10001] = {}, rez_w = 0, rez_a = 0, n, m, p;
char ch[3];
cin >> n >> m;
for (int i = 1; i <= m; ++i) {
cin >> p >> ch;
if (strcmp(ch, "WA") == 0 && penalties[p] != -1)
penalties[p]++;
else {
if (penalt... | #include <cstring>
#include <iostream>
using namespace std;
int main() {
int penalties[100001] = {}, rez_w = 0, rez_a = 0, n, m, p;
char ch[3];
cin >> n >> m;
for (int i = 1; i <= m; ++i) {
cin >> p >> ch;
if (strcmp(ch, "WA") == 0 && penalties[p] != -1)
penalties[p]++;
else {
if (penal... | replace | 5 | 6 | 5 | 6 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <numeric>
using namespace std;
using ll = long long;
using pint = pair<int, int>;
#define INF 99999999
#define rep(i, n) for (int(i) = 0, temp = (int)(n); (i) < temp; ++(i))
#define repi(i, start, end) \
for (int(i) = (start), temp... | #include <bits/stdc++.h>
#include <numeric>
using namespace std;
using ll = long long;
using pint = pair<int, int>;
#define INF 99999999
#define rep(i, n) for (int(i) = 0, temp = (int)(n); (i) < temp; ++(i))
#define repi(i, start, end) \
for (int(i) = (start), temp... | replace | 60 | 61 | 60 | 61 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
};
} fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define ... | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
};
} fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define ... | insert | 130 | 130 | 130 | 131 | 0 | |
p02802 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<bool> y(n, true);
vector<int> x(m, 0);
int ac = 0, pen = 0;
for (int i = 0; i < m; ++i) {
int p;
string s;
cin >> p >> s;
--p;
if (y[p]) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<bool> y(n, true);
vector<int> x(n, 0);
int ac = 0, pen = 0;
for (int i = 0; i < m; ++i) {
int p;
string s;
cin >> p >> s;
--p;
if (y[p]) {
... | replace | 12 | 13 | 12 | 13 | 0 | |
p02802 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <vector>
int main() {
long long N, M;
std::cin >> N >> M;
std::vector<bool> flag(N, false);
std::vector<long long> wa(N, 0);
long long ac = 0;
for (long long i = 0; i < M; i++) {
long long p;
std::string s;
std::cin >> p >> s;
if (s == "AC" && ... | #include <iostream>
#include <string>
#include <vector>
int main() {
long long N, M;
std::cin >> N >> M;
std::vector<bool> flag(N, false);
std::vector<long long> wa(N, 0);
long long ac = 0;
for (long long i = 0; i < M; i++) {
long long p;
std::string s;
std::cin >> p >> s;
p--;
if (s ==... | insert | 14 | 14 | 14 | 15 | 0 | |
p02803 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int N, M, ans;
int main() {
cin >> N >> M;
vector<vector<int>> maze(N, vector<int>(M, 1));
for (int i = 0; i < N; i++)
for (int j = 0; j < M; j++) {
char a;
cin >> a;
if (a == '.')
maze... | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int N, M, ans;
int main() {
cin >> N >> M;
vector<vector<int>> maze(N, vector<int>(M, 1));
for (int i = 0; i < N; i++)
for (int j = 0; j < M; j++) {
char a;
cin >> a;
if (a == '.')
maze... | replace | 27 | 29 | 27 | 29 | 0 | |
p02803 | C++ | Time Limit Exceeded | /*
Mbak Sana Dong
Mbak Chaeyoung Dong
*/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int r, c;
char grid[202][202];
int dist[22][22];
int main() {
int n, i, j, k, x, y, ans, curr, temp, m;
cin >> r >> c;
getchar();
vector<pair<int, int>> vi;
for (i = 1; i <= r; i++) {
fo... | /*
Mbak Sana Dong
Mbak Chaeyoung Dong
*/
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int r, c;
char grid[202][202];
int dist[22][22];
int main() {
int n, i, j, k, x, y, ans, curr, temp, m;
cin >> r >> c;
getchar();
vector<pair<int, int>> vi;
for (i = 1; i <= r; i++) {
fo... | insert | 41 | 41 | 41 | 43 | TLE | |
p02803 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <set>
#define int long long
#define iris 1000000007
using namespace std;
char arr[32][32];
int dis[32][32];
int id[32][32];
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, i, j, k;
cin >> n >> m;
k = 0;
for (i = 1; i <= n; i... | #include <algorithm>
#include <iostream>
#include <map>
#include <set>
#define int long long
#define iris 1000000007
using namespace std;
char arr[32][32];
int dis[1024][1024];
int id[32][32];
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, i, j, k;
cin >> n >> m;
k = 0;
for (i = 1; i <= ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02803 | C++ | Time Limit Exceeded | // Author: πα
#include <bits/stdc++.h>
using namespace std;
#define long uint32_t
const int N = 22;
char g[N][N];
long dp[N][N];
bool vis[N][N];
void dfs(int x, int y, long k = 0) {
if (vis[x][y] or g[x][y] != '.')
return;
vis[x][y] = 1;
dp[x][y] = min(dp[x][y], k);
dfs(x + 1, y, k + 1);
dfs(x - 1, y, ... | // Author: πα
#include <bits/stdc++.h>
using namespace std;
#define long uint32_t
const int N = 22;
char g[N][N];
long dp[N][N];
bool vis[N][N];
void dfs(int x, int y, long k = 0) {
if (vis[x][y] or g[x][y] != '.' or dp[x][y] == k)
return;
vis[x][y] = 1;
dp[x][y] = min(dp[x][y], k);
dfs(x + 1, y, k + 1);... | replace | 12 | 13 | 12 | 13 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define _GLIBCXX_DEBUG
#define fi first
#define se second
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define _GLIBCXX_DEBUG
#define fi first
#define se second
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using... | replace | 55 | 56 | 55 | 56 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int H, W;
cin >> H >> W;
vector<string> map(H);
for (auto &s : map)
cin >> s;
auto bfs = [&](int s) {
if (map[s / W][s % W] == '#')
return -1;
vector<int> d(H * W, numeric_limits... | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int H, W;
cin >> H >> W;
vector<string> map(H);
for (auto &s : map)
cin >> s;
auto bfs = [&](int s) {
if (map[s / W][s % W] == '#')
return -1;
vector<int> d(H * W, numeric_limits... | insert | 27 | 27 | 27 | 28 | TLE | |
p02803 | 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
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(), v.end()
#define repf(i, a, b) for (ll i = a; i < b; i++)
#define repb(i, a, b) for (ll i = ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(), v.end()
#define repf(i, a, b) for (ll i = a; i < b; i++)
#define repb(i, a, b) for (ll i = ... | replace | 54 | 62 | 54 | 60 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
co... | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(), A.end()
#define RALL(A) A.rbegin(), A.rend()
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
const ll LINF = 1LL << 60;
co... | replace | 70 | 71 | 70 | 71 | 0 | |
p02803 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int stepX[4] = {1, -1, 0, 0};
int stepY[4] = {0, 0, 1, -1};
bool inArea(int tx, int ty, int w, int h) {
return (0 <= tx && tx < w && 0 <= ty && ty < h);
}
int getFar(vector<vector<bool>> &mat, int sh, int sw, int h, int w) {
queue<int> q... | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int stepX[4] = {1, -1, 0, 0};
int stepY[4] = {0, 0, 1, -1};
bool inArea(int tx, int ty, int w, int h) {
return (0 <= tx && tx < w && 0 <= ty && ty < h);
}
int getFar(vector<vector<bool>> &mat, int sh, int sw, int h, int w) {
queue<int> q... | replace | 60 | 61 | 60 | 61 | 0 | |
p02803 | C++ | Runtime Error | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
using namespace std;
vector<string> vec;
vector<string> vec2;
struct Node {
int y;
int x;
int depth;
};
queue<Node> que;
int H, W;
int sy, sx, gy, gx... | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
using namespace std;
vector<string> vec;
vector<string> vec2;
struct Node {
int y;
int x;
int depth;
};
queue<Node> que;
int H, W;
int sy, sx, gy, gx... | insert | 52 | 52 | 52 | 53 | -11 | |
p02803 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;
// clang-format off
#ifdef _DEBUG_
#define dump(...) do{... | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;
// clang-format off
#ifdef _DEBUG_
#define dump(...) do{... | replace | 88 | 89 | 88 | 92 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll INF = 4e18;
ll nodeno[30][30];
vector<ll> adj_list[30 * 30];
bool visited[30 * 30];
ll level[30 * 30];
void assign_nodeno(ll h, ll w) {
ll k = 1;
for (ll i = 0; i < h; i++) {
for (ll j = 0; j < w; j++) {
nodeno[i][j] = k;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll INF = 4e18;
ll nodeno[30][30];
vector<ll> adj_list[30 * 30];
bool visited[30 * 30];
ll level[30 * 30];
void assign_nodeno(ll h, ll w) {
ll k = 1;
for (ll i = 0; i < h; i++) {
for (ll j = 0; j < w; j++) {
nodeno[i][j] = k;
... | replace | 38 | 40 | 38 | 42 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
int H, W;
char map[20][20];
int dist_value;
int dist[20][20];
void initdist() {
dist_value = 0;
for (int i = 0; i < H; i++) {
for (int j = 0; ... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
int H, W;
char map[20][20];
int dist_value;
int dist[20][20];
void initdist() {
dist_value = 0;
for (int i = 0; i < H; i++) {
for (int j = 0; ... | insert | 56 | 56 | 56 | 57 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
using namespace std;
const int inf = 1e18 + 7;
const int N = 1e6 + 7;
const int md = 1e9 + 7;
int dist[900], vis[900];
char a[30][30];
int n, m;
int val[30][30];
std::vector<int> g[30];
int ok(int i, int j) {
if ((i >= 0 && i < n... | #include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
using namespace std;
const int inf = 1e18 + 7;
const int N = 1e6 + 7;
const int md = 1e9 + 7;
int dist[900], vis[900];
char a[30][30];
int n, m;
int val[30][30];
std::vector<int> g[900];
int ok(int i, int j) {
if ((i >= 0 && i < ... | replace | 12 | 13 | 12 | 13 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
// typedef long long ll;
typedef unsigned long long ll;
// #define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef pair<int, int> P;
// typedef pair<ll, ll> P;
// const double INF =... | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
// typedef long long ll;
typedef unsigned long long ll;
// #define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef pair<int, int> P;
// typedef pair<ll, ll> P;
// const double INF =... | replace | 68 | 69 | 68 | 69 | 0 | |
p02803 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < (ll)(n); ++i)
templa... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <ctype.h>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < (ll)(n); ++i)
templa... | replace | 34 | 36 | 34 | 36 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
int H, W;
int blankMap[20][20];
vector<pair<int, int>> steps = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
int bfs(int initX, int initY) {
int highestCost = 0;
int simulateMap[20][20];
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
int H, W;
int blankMap[20][20];
vector<pair<int, int>> steps = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
int bfs(int initX, int initY) {
int highestCost = 0;
int simulateMap[20][20];
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
... | replace | 26 | 27 | 26 | 31 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define INF 100010001000
#define MOD 1000000007
#define int long long int
#define maxn 100
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
typedef pair<int, int> P;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int g... | #include <bits/stdc++.h>
using namespace std;
#define INF 100010001000
#define MOD 1000000007
#define int long long int
#define maxn 100
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
typedef pair<int, int> P;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int g... | replace | 93 | 94 | 93 | 94 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
int H, W;
cin >> H >> W;
vector<string> S(H);
rep(i, H) cin >> S[i];
int ans ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
int H, W;
cin >> H >> W;
vector<string> S(H);
rep(i, H) cin >> S[i];
int ans ... | insert | 29 | 29 | 29 | 30 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(name) name.begin(), name.end()
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#define ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(name) name.begin(), name.end()
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#define ... | replace | 94 | 95 | 94 | 99 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using xy = pair<int, int>;
using Graph = vector<vector<xy>>;
int main() {
int H, W;
cin >> H >> W;
vector<vector<char>> S(H);
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
char x;
cin >> x;
S.at(i).push_back(x);
}
}
int ... | #include <bits/stdc++.h>
using namespace std;
using xy = pair<int, int>;
using Graph = vector<vector<xy>>;
int main() {
int H, W;
cin >> H >> W;
vector<vector<char>> S(H);
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
char x;
cin >> x;
S.at(i).push_back(x);
}
}
int ... | replace | 34 | 35 | 34 | 35 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int h, w;
cin >> h >> w;
vector<string> S(h);
rep(i, h) cin >> S.at(i);
vector<int> dx = {0, -1, 0, 1};
vector<int> dy = {1, 0, -1, 0};
deque<pair<int, int>> next_masu;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int h, w;
cin >> h >> w;
vector<string> S(h);
rep(i, h) cin >> S.at(i);
vector<int> dx = {0, -1, 0, 1};
vector<int> dy = {1, 0, -1, 0};
deque<pair<int, int>> next_masu;
... | replace | 45 | 46 | 45 | 47 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int ans = 0;
int H, W;
void bfs(vector<string> &S, int sy, int sx, int ey, int ex) {
vector<int> vx = {0, 1, 0, -1};
vector<int> vy = {1, 0, -1, 0};
queue<int> quex;
queue<int> quey;
quex.push(sx);
quey.push(sy);
vector<vector<int>> dis(H, vector<int>(W, 1e9... | #include <bits/stdc++.h>
using namespace std;
int ans = 0;
int H, W;
void bfs(vector<string> &S, int sy, int sx, int ey, int ex) {
vector<int> vx = {0, 1, 0, -1};
vector<int> vy = {1, 0, -1, 0};
queue<int> quex;
queue<int> quey;
quex.push(sx);
quey.push(sy);
vector<vector<int>> dis(H, vector<int>(W, 1e9... | replace | 47 | 48 | 47 | 48 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int mp[23][23];
char str[23][23];
int book[23][23];
int ans;
int gx, gy;
int dx[5] = {-1, 1, 0, 0};
int dy[5] = {0, 0, -1, 1};
int n, m;
int qx[4005], qy[4005], step[4005];
int bfs(int sx, int sy, int gx, int gy) {
memset(book, 0, sizeof(book))... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int mp[23][23];
char str[23][23];
int book[23][23];
int ans;
int gx, gy;
int dx[5] = {-1, 1, 0, 0};
int dy[5] = {0, 0, -1, 1};
int n, m;
int qx[4005], qy[4005], step[4005];
int bfs(int sx, int sy, int gx, int gy) {
memset(book, 0, sizeof(book))... | insert | 29 | 29 | 29 | 30 | 0 | |
p02803 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int I[20][20];
int D[400][400];
int main() {
ios::sync_with_stdio(false);
int H, W;
string S[20];
cin >> H >> W;
for (int i = 0; i < H; i++) {
cin >> S[i];
}
int N = 1;
for (int i = 0; i < H; i++) {
for (int j = 0; j... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int I[20][20];
int D[405][405];
int main() {
ios::sync_with_stdio(false);
int H, W;
string S[20];
cin >> H >> W;
for (int i = 0; i < H; i++) {
cin >> S[i];
}
int N = 1;
for (int i = 0; i < H; i++) {
for (int j = 0; j... | replace | 5 | 6 | 5 | 6 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T> boo... | #include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T> boo... | replace | 36 | 37 | 36 | 37 | TLE | |
p02803 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
const int inf = 10000;
int main() {
int h, w;
cin >> h >> w;
vector<vector<char>> vec(h + 2, vector<char>(w + 2, '#'));
for (int x = 1; x <= h; ++x)
for (int y = 1; y <= w; ++y)
cin >> vec[x][y];
vector<vector<int>> ans((h + 2) * (w + w... | #include <iostream>
#include <vector>
using namespace std;
const int inf = 10000;
int main() {
int h, w;
cin >> h >> w;
vector<vector<char>> vec(h + 2, vector<char>(w + 2, '#'));
for (int x = 1; x <= h; ++x)
for (int y = 1; y <= w; ++y)
cin >> vec[x][y];
vector<vector<int>> ans((h + 2) * (w + 2... | replace | 16 | 17 | 16 | 17 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
int h, w;
std::vector<std::vector<bool>> map;
struct pairs {
int first;
int second;
int depth;
};
std::vector<std::pair<int, int>> dir = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
inline int bfs(int start_h, int start_w) {
int aaa = 0;
std::vector<std::vector<bool>> se... | #include <algorithm>
#include <bits/stdc++.h>
int h, w;
std::vector<std::vector<bool>> map;
struct pairs {
int first;
int second;
int depth;
};
std::vector<std::pair<int, int>> dir = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
inline int bfs(int start_h, int start_w) {
int aaa = 0;
std::vector<std::vector<bool>> se... | replace | 27 | 28 | 27 | 28 | TLE | |
p02803 | C++ | Time Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
// #include <intrin.h>
#define fore(i, a, b) for (int i = a; i < (b); i++)
#define fr(i, a, b) for (int i = a - 1; i >= b; i--)
#define fast \
ios_base::sync_with_stdio... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
// #include <intrin.h>
#define fore(i, a, b) for (int i = a; i < (b); i++)
#define fr(i, a, b) for (int i = a - 1; i >= b; i--)
#define fast \
ios_base::sync_with_stdio... | insert | 49 | 49 | 49 | 50 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <iostream>
#include <queue>
#include <utility>
#include <vector>
using ll = long long;
using lli = long long int;
lli h, w;
std::vector<std::string> vec;
std::vector<std::vector<lli>> visited;
std::string s;
std::vector<int> x_s;
std::vector<int> y_s;
int main() {
lli ans = 0;
x_s = {0, 0, 1, -1};
y_s... | #include <iostream>
#include <queue>
#include <utility>
#include <vector>
using ll = long long;
using lli = long long int;
lli h, w;
std::vector<std::string> vec;
std::vector<std::vector<lli>> visited;
std::string s;
std::vector<int> x_s;
std::vector<int> y_s;
int main() {
lli ans = 0;
x_s = {0, 0, 1, -1};
y_s... | insert | 35 | 35 | 35 | 39 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | replace | 107 | 108 | 107 | 108 | TLE | |
p02803 | C++ | Runtime Error | // D - Maze Master
#include <bits/stdc++.h>
using namespace std;
#define rp(i, s, e) for (int i = (s); i < (e); ++i)
using vi = vector<int>;
using vvi = vector<vi>;
// BFS (幅優先探索)
// 文字列迷路Sについて、S[sh][sw]から各マスまでの最短コストをdist[h][w]に求める
#define HMAX 20
#define WMAX 20
#define INF 100000
vvi dist(HMAX + 1,
vi(WMAX ... | // D - Maze Master
#include <bits/stdc++.h>
using namespace std;
#define rp(i, s, e) for (int i = (s); i < (e); ++i)
using vi = vector<int>;
using vvi = vector<vi>;
// BFS (幅優先探索)
// 文字列迷路Sについて、S[sh][sw]から各マスまでの最短コストをdist[h][w]に求める
#define HMAX 20
#define WMAX 20
#define INF 100000
vvi dist(HMAX + 2,
vi(WMAX ... | replace | 12 | 14 | 12 | 14 | 0 | |
p02803 | C++ | Time Limit Exceeded | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
const ll MOD = 1000000007;
const long long INF = 1LL << 60;
const double pi = acos(-1);
int H, W;
bool movable(vector<string> &maze, vector<vector<int>> &memo, int x, int y,
... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
const ll MOD = 1000000007;
const long long INF = 1LL << 60;
const double pi = acos(-1);
int H, W;
bool movable(vector<string> &maze, vector<vector<int>> &memo, int x, int y,
... | replace | 30 | 31 | 30 | 31 | TLE | |
p02803 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
const int mod = 1000000007;
int bfs(int c, int r);
vector<vector<int>> M(20, vector<int>(20, ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
const int mod = 1000000007;
int bfs(int c, int r);
vector<vector<int>> M(20, vector<int>(20, ... | replace | 73 | 74 | 73 | 74 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
const int INF = 1001001001;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, 1, 0, -1};
int h, w;
vector<string> s;
vector<int> steps;
void bfs(pair<int, int> st, pair<int, int> gl) {
// stからの... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
const int INF = 1001001001;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, 1, 0, -1};
int h, w;
vector<string> s;
vector<int> steps;
void bfs(pair<int, int> st, pair<int, int> gl) {
// stからの... | insert | 47 | 47 | 47 | 48 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define forn(i, a, n) for (int i = a; i < n; i++)
int n, m;
char a[21][21];
int d[401];
int dist[21][21];
int used[21][21];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int res = -2e18;
signed main() {
ios::sync_with_stdio(false);
cin.tie... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define forn(i, a, n) for (int i = a; i < n; i++)
int n, m;
char a[21][21];
int d[40001];
int dist[21][21];
int used[21][21];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int res = -2e18;
signed main() {
ios::sync_with_stdio(false);
cin.t... | replace | 8 | 9 | 8 | 9 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<vector<char>> field(H, vector<char>(W));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
ch... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<vector<char>> field(H, vector<char>(W));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
ch... | insert | 55 | 55 | 55 | 56 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#i... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#i... | replace | 127 | 132 | 127 | 128 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
#define mod ((ll)1e9 + 7)
#define inf ((ll)1e18 + 5)
#define maxx ((ll)1e6 + 5)
#define pb push_back
#define endl "\n"
#define time(i) \
cout <... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
#define mod ((ll)1e9 + 7)
#define inf ((ll)1e18 + 5)
#define maxx ((ll)1e6 + 5)
#define pb push_back
#define endl "\n"
#define time(i) \
cout <... | insert | 89 | 89 | 89 | 90 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
char a[22][22];
int n, m;
struct pos {
int x;
int y;
int step;
};
pos make_pos(int a, int b, int c) {
pos ret;
ret.x = a;
ret.y = b;
ret.step = c;
return ret;
}
int bfs(int sx, int sy, int ex, int ey) {
bool vis[n + 2][m + 2];
for (int i = 0; i <=... | #include <bits/stdc++.h>
using namespace std;
char a[22][22];
int n, m;
struct pos {
int x;
int y;
int step;
};
pos make_pos(int a, int b, int c) {
pos ret;
ret.x = a;
ret.y = b;
ret.step = c;
return ret;
}
int bfs(int sx, int sy, int ex, int ey) {
bool vis[n + 2][m + 2];
for (int i = 0; i <=... | replace | 83 | 84 | 83 | 84 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h> //JuniorMonster a.k.a Sho10
#define ll long long int
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz size
#define f first
#define s second
#define pb push_back... | #include <bits/stdc++.h> //JuniorMonster a.k.a Sho10
#define ll long long int
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz size
#define f first
#define s second
#define pb push_back... | insert | 37 | 37 | 37 | 41 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vi vector<int>
#define vll vector<ll>
#define pll pair<ll, ll>
#define pii pair<int, int>
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define SIZE 25
ll H, W;
string arr[SIZE];
ll vis[SIZE][SIZE];
ll bfs(ll a, ll b, ll x, ll ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vi vector<int>
#define vll vector<ll>
#define pll pair<ll, ll>
#define pii pair<int, int>
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define SIZE 25
ll H, W;
string arr[SIZE];
ll vis[SIZE][SIZE];
ll bfs(ll a, ll b, ll x, ll ... | replace | 59 | 63 | 59 | 63 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
char maze[23][23];
bool visited[23][23];
int level[23][23];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int h, w;
int hx, hy;
int bfs(int fx, int fy) {
memset(visited, 0, sizeof(visited));
memset(level, 0, sizeof(level));
int mx = 0;
queue<pair<int, int>>... | #include <bits/stdc++.h>
using namespace std;
char maze[23][23];
bool visited[23][23];
int level[23][23];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int h, w;
int hx, hy;
int bfs(int fx, int fy) {
memset(visited, 0, sizeof(visited));
memset(level, 0, sizeof(level));
int mx = 0;
queue<pair<int, int>>... | insert | 62 | 62 | 62 | 63 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int H, W;
vector<string> v;
int d[30][30];
int main() {
cin >> H >> W;
for (int i = 0; i < H; i++) {
string S;
cin >> S;
v.push_back(S);
}
for (int i = 0; i < H * W; i++) {
for (int j = 0; j < H * W; j++) {
int ix = i % W, iy = i / W;
int... | #include <bits/stdc++.h>
using namespace std;
int H, W;
vector<string> v;
int d[410][410];
int main() {
cin >> H >> W;
for (int i = 0; i < H; i++) {
string S;
cin >> S;
v.push_back(S);
}
for (int i = 0; i < H * W; i++) {
for (int j = 0; j < H * W; j++) {
int ix = i % W, iy = i / W;
i... | replace | 4 | 5 | 4 | 5 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// in-short-use macros
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
// container-use
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef v... | #include <bits/stdc++.h>
using namespace std;
// in-short-use macros
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
// container-use
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef v... | replace | 58 | 62 | 58 | 59 | 0 | |
p02803 | C++ | Time Limit Exceeded | /*
AuThOr GaRyMr
*/
#include <bits/stdc++.h>
#define rb(a, b, c) for (int a = b; a <= c; ++a)
#define rl(a, b, c) for (int a = b; a >= c; --a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a, b) make_pair(a, b)
#define FIR first
#define SEC second
#define FREO freopen("check.out", "w", stdout... | /*
AuThOr GaRyMr
*/
#include <bits/stdc++.h>
#define rb(a, b, c) for (int a = b; a <= c; ++a)
#define rl(a, b, c) for (int a = b; a >= c; --a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a, b) make_pair(a, b)
#define FIR first
#define SEC second
#define FREO freopen("check.out", "w", stdout... | insert | 45 | 45 | 45 | 47 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i,... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i,... | insert | 85 | 85 | 85 | 86 | TLE | |
p02803 | C++ | Runtime Error | /*
* ID: juryc
* PROG: Maze Master
* LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
vector<string> v(h);
for (string &i : v)
cin >> i;
int val = h * w;
vector<vector<int>> dp(val, vector<int>(val, 0x3f3f3f3f));
for (int i = 0; i < h * w; i++)
d... | /*
* ID: juryc
* PROG: Maze Master
* LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
vector<string> v(h);
for (string &i : v)
cin >> i;
int val = h * w;
vector<vector<int>> dp(val, vector<int>(val, 0x3f3f3f3f));
for (int i = 0; i < h * w; i++)
d... | replace | 28 | 31 | 28 | 32 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <class T> using vc = vector<T>;
template <class T> using vvc = vector<vector<T>>;
using vl = vector<ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e14;
const long double EPS = 1e-11;
#define eb emplace_back
#define all(... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <class T> using vc = vector<T>;
template <class T> using vvc = vector<vector<T>>;
using vl = vector<ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e14;
const long double EPS = 1e-11;
#define eb emplace_back
#define all(... | replace | 55 | 56 | 55 | 56 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (long long i = 0; i < ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (long long i = 0; i < ... | replace | 23 | 24 | 23 | 24 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const ll LINF = (ll)1e18;
int main() {
int h, w;
cin >> h >> w;
int n = h * w;
string s[h];
for (int i = 0; i < h; i++) {
cin >> s[i];
}
int d[n][n];
for (int i = 0; i < n; i+... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const ll LINF = (ll)1e18;
int main() {
int h, w;
cin >> h >> w;
int n = h * w;
string s[h];
for (int i = 0; i < h; i++) {
cin >> s[i];
}
int d[n][n];
for (int i = 0; i < n; i+... | replace | 33 | 34 | 33 | 34 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int h, w;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, -1, 0, 1};
vector<string> s;
int bfs(int sx, int sy, int gx, int gy) {
int d[w][h]; // スタート位置からの距離を持つ配列
// 配列を初期化しておく
fo... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int h, w;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, -1, 0, 1};
vector<string> s;
int bfs(int sx, int sy, int gx, int gy) {
int d[w][h]; // スタート位置からの距離を持つ配列
// 配列を初期化しておく
fo... | replace | 85 | 88 | 85 | 88 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using int32 = int_fast32_t;
using int64 = int_fast64_t;
const int32 INF = 1e9;
const int32 MOD = 1e9 + 7;
const int64 LLINF = 1e18;
#define YES(n) cout << ((n) ? "YES\n" : "NO\n")
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n")
#define POSSIBLE cout << ((n) ? "POSSIBLE\n... | #include <bits/stdc++.h>
using namespace std;
using int32 = int_fast32_t;
using int64 = int_fast64_t;
const int32 INF = 1e9;
const int32 MOD = 1e9 + 7;
const int64 LLINF = 1e18;
#define YES(n) cout << ((n) ? "YES\n" : "NO\n")
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n")
#define POSSIBLE cout << ((n) ? "POSSIBLE\n... | replace | 35 | 36 | 35 | 38 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<ll> VLL;
typedef vector<PLL> VP;
const static int INF = 1000000000;
const stat... | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<ll> VLL;
typedef vector<PLL> VP;
const static int INF = 1000000000;
const stat... | insert | 104 | 104 | 104 | 106 | 0 | |
p02803 | C++ | Runtime Error | // --------------------------------------------------<TEMPLATE>--------------------------------------------------
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pr... | // --------------------------------------------------<TEMPLATE>--------------------------------------------------
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pr... | replace | 294 | 295 | 294 | 296 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#includ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#includ... | insert | 128 | 128 | 128 | 129 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int height, width;
cin >> height >> width;
vector<string> field(height);
for (int h = 0; h < height; ++h)
cin >> field[h];
int sx, sy, gx, gy;
int ans = 0;
for (int h = 0; h < height... | #include <bits/stdc++.h>
using namespace std;
int main() {
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int height, width;
cin >> height >> width;
vector<string> field(height);
for (int h = 0; h < height; ++h)
cin >> field[h];
int sx, sy, gx, gy;
int ans = 0;
for (int h = 0; h < height... | insert | 20 | 20 | 20 | 22 | 0 | |
p02803 | C++ | Runtime Error | // --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC tar... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll, ll>
#define vpii vector<pair<ll, ll>>
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a... | delete | 0 | 11 | 0 | 0 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int, int> P;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
signed main() {
ios::sync_w... | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int, int> P;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
signed main() {
ios::sync_w... | replace | 32 | 33 | 32 | 33 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define FOR(i, n) for (int i = 0; i < (int)n; i++)
#define all(v) v.begin(), v.end()
#define F first
#define S second
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
const in... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define FOR(i, n) for (int i = 0; i < (int)n; i++)
#define all(v) v.begin(), v.end()
#define F first
#define S second
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
const in... | insert | 34 | 34 | 34 | 39 | TLE | |
p02803 | C++ | Runtime Error | // 各スタート地点からDFS
// 探索が終わるまでの距離をカウント
// 最も長かったスタート地点とそのゴール地点を返す
// bfsの引数:現在の場所/前の場所
// グローバル:W/H/S/mxdist
// 任意のスタートから任意の位置までの距離 : dist
#include <bits/stdc++.h>
using namespace std;
int H, W, mxdist = 0;
vector<vector<char>> S(20, vector<char>(20));
typedef pair<int, int> P;
vector<int> dx = {0, 1, 0, -1};
vector<int... | // 各スタート地点からDFS
// 探索が終わるまでの距離をカウント
// 最も長かったスタート地点とそのゴール地点を返す
// bfsの引数:現在の場所/前の場所
// グローバル:W/H/S/mxdist
// 任意のスタートから任意の位置までの距離 : dist
#include <bits/stdc++.h>
using namespace std;
int H, W, mxdist = 0;
vector<vector<char>> S(20, vector<char>(20));
typedef pair<int, int> P;
vector<int> dx = {0, 1, 0, -1};
vector<int... | replace | 60 | 61 | 60 | 61 | 0 | |
p02803 | Python | Runtime Error | from scipy.sparse.csgraph import dijkstra, csgraph_from_dense
import numpy as np
H, W = map(int, input().split())
S = [input() for _ in range(H)]
v_id_dict = {}
dista = np.ones((20, 20)) * np.inf
for i in range(H):
for j in range(W):
if S[i][j] == ".":
v_id_dict[i, j] = len(v_id_dict)
... | from scipy.sparse.csgraph import dijkstra, csgraph_from_dense
import numpy as np
H, W = map(int, input().split())
S = [input() for _ in range(H)]
v_id_dict = {}
dista = np.ones((400, 400)) * np.inf
for i in range(H):
for j in range(W):
if S[i][j] == ".":
v_id_dict[i, j] = len(v_id_dict)
... | replace | 7 | 8 | 7 | 8 | ModuleNotFoundError: No module named 'scipy' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02803/Python/s307435936.py", line 1, in <module>
from scipy.sparse.csgraph import dijkstra, csgraph_from_dense
ModuleNotFoundError: No module named 'scipy'
|
p02803 | Python | Runtime Error | import os
import sys
import numpy as np
from scipy.sparse.csgraph._shortest_path import floyd_warshall
if os.getenv("LOCAL"):
sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(10**9)
INF = float("inf")
IINF = 10**18
MOD = 10**9 + 7
# MOD = 998244353
H, W = list(map(int, sys.stdin.buffer.readline().split())... | import os
import sys
import numpy as np
from scipy.sparse.csgraph._shortest_path import floyd_warshall
if os.getenv("LOCAL"):
sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(10**9)
INF = float("inf")
IINF = 10**18
MOD = 10**9 + 7
# MOD = 998244353
H, W = list(map(int, sys.stdin.buffer.readline().split())... | replace | 37 | 38 | 37 | 38 | TLE | |
p02803 | Python | Runtime Error | from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
H, W = map(int, input().split())
S = [input() for _ in range(H)]
g = [[0] * (H * W) for _ in range(H * W)]
for y in range(H):
for x in range(W):
if S[y][x] == "#":
continue
if y - 1 >= 0 and S[y - 1][x] != "#":
... | from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
H, W = map(int, input().split())
S = [input() for _ in range(H)]
g = [[0] * (H * W) for _ in range(H * W)]
for y in range(H):
for x in range(W):
if S[y][x] == "#":
continue
if y - 1 >= 0 and S[y - 1][x] != "#":
... | replace | 23 | 24 | 23 | 24 | ModuleNotFoundError: No module named 'scipy' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02803/Python/s337120294.py", line 1, in <module>
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
ModuleNotFoundError: No module named 'scipy'
|
p02803 | Python | Runtime Error | H, W = map(int, input().split())
S = [input() for _ in range(H)]
def f(i, j):
t = [[-1] * W for _ in range(W)]
t[i][j] = 0
q = [(i, j)]
while q:
y, x = q.pop(0)
if y - 1 >= 0 and S[y - 1][x] != "#" and t[y - 1][x] == -1:
t[y - 1][x] = t[y][x] + 1
q.append((y - 1... | H, W = map(int, input().split())
S = [input() for _ in range(H)]
def f(i, j):
t = [[-1] * W for _ in range(H)]
t[i][j] = 0
q = [(i, j)]
while q:
y, x = q.pop(0)
if y - 1 >= 0 and S[y - 1][x] != "#" and t[y - 1][x] == -1:
t[y - 1][x] = t[y][x] + 1
q.append((y - 1... | replace | 5 | 6 | 5 | 6 | 0 | |
p02803 | Python | Time Limit Exceeded | from itertools import product
def solve(string):
h, w, *s = string.split()
h, w = map(int, [h, w])
s = ["#" + _s + "#" for _s in s]
s = ["#" * (w + 2)] + s + ["#" * (w + 2)]
ans = 0
d = [(1, 0), (-1, 0), (0, 1), (0, -1)]
for _h, _w in product(range(1, h + 1), range(1, w + 1)):
if s... | from itertools import product
def solve(string):
h, w, *s = string.split()
h, w = map(int, [h, w])
s = ["#" + _s + "#" for _s in s]
s = ["#" * (w + 2)] + s + ["#" * (w + 2)]
ans = 0
d = [(1, 0), (-1, 0), (0, 1), (0, -1)]
for _h, _w in product(range(1, h + 1), range(1, w + 1)):
if s... | insert | 19 | 19 | 19 | 21 | TLE | |
p02803 | C++ | Time Limit Exceeded | /*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vecto... | /*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vecto... | insert | 105 | 105 | 105 | 114 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
const int INF = 10000;
int d[20][20];
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
char maze[20][20];
int h, w, hw;
int l = 0;
bool flg = true;
int bfs(int sx, int sy) {
int hwc = 0;
queue<P> que;
for (int i = 0; i < h; i++)
for (int... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
const int INF = 10000;
int d[20][20];
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
char maze[20][20];
int h, w, hw;
int l = 0;
bool flg = true;
int bfs(int sx, int sy) {
int hwc = 0;
queue<P> que;
for (int i = 0; i < h; i++)
for (int... | replace | 18 | 19 | 18 | 19 | 0 | |
p02803 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
int x[] = {0, 1, 0, -1};
int y[] = {1, 0, -1, 0};
bool M[21][21];
int H, W;
bool valid(int r, int c) {
if (r < H && r >= 0 && c < W && c >= 0)
return true;
else
return false;
}
bool v[21][21];
int BFS(int r, int c) {
for (int i = 0; i < H; i++) {
for (int... | #include "bits/stdc++.h"
using namespace std;
int x[] = {0, 1, 0, -1};
int y[] = {1, 0, -1, 0};
bool M[21][21];
int H, W;
bool valid(int r, int c) {
if (r < H && r >= 0 && c < W && c >= 0)
return true;
else
return false;
}
bool v[21][21];
int BFS(int r, int c) {
for (int i = 0; i < H; i++) {
for (int... | replace | 45 | 46 | 45 | 46 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
char c[21][21];
int check[21][21];
int i, j;
queue<pair<int, int>> que;
cin >> H >> W;
int ans = 0;
for (i = 0; i < H; i++)
for (j = 0; j < W; j++)
cin >> c[i][j];
for (i = 0; i < H; i++)
for (j = 0; j < W; j++) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
char c[21][21];
int check[21][21];
int i, j;
queue<pair<int, int>> que;
cin >> H >> W;
int ans = 0;
for (i = 0; i < H; i++)
for (j = 0; j < W; j++)
cin >> c[i][j];
for (i = 0; i < H; i++)
for (j = 0; j < W; j++) {
... | replace | 32 | 33 | 32 | 33 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ln(a) cout << (a) << endl
#define debug(a, n) \
rep(hoge, n) printf("%lld%c", a[hoge], hoge == (n)-1 ? '\n' : ' ');
#define all(a) (a).begin(), (a).end()
#define pb push_bac... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ln(a) cout << (a) << endl
#define debug(a, n) \
rep(hoge, n) printf("%lld%c", a[hoge], hoge == (n)-1 ? '\n' : ' ');
#define all(a) (a).begin(), (a).end()
#define pb push_bac... | replace | 26 | 54 | 26 | 48 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int h, w;
vector<vector<char>> s;
vector<vector<bool>> sb;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, -1, 0, 1};
struct xydata {
int x, y, d;
};
void refresh() {
for (int i = 0; i < h; ++i) {
for (int j = 0; j < w; ++j) {
sb.at(i).at(j) = false;
... | #include <bits/stdc++.h>
using namespace std;
int h, w;
vector<vector<char>> s;
vector<vector<bool>> sb;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, -1, 0, 1};
struct xydata {
int x, y, d;
};
void refresh() {
for (int i = 0; i < h; ++i) {
for (int j = 0; j < w; ++j) {
sb.at(i).at(j) = false;
... | replace | 43 | 44 | 43 | 44 | TLE | |
p02803 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int h, w;
vector<vector<char>> s;
vector<vector<int>> sb;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, -1, 0, 1};
struct xydata {
int x, y;
};
int bfs(int sx, int sy, int gx, int gy) {
sb = vector<vector<int>>(h, vector<int>(w, 1000));
xydata first;
first.... | #include <bits/stdc++.h>
using namespace std;
int h, w;
vector<vector<char>> s;
vector<vector<int>> sb;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, -1, 0, 1};
struct xydata {
int x, y;
};
int bfs(int sx, int sy, int gx, int gy) {
sb = vector<vector<int>>(h, vector<int>(w, 1000));
xydata first;
first.... | replace | 37 | 42 | 37 | 41 | TLE | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int INF = 1e9 + 7;
#define MAX_V 300
struct edge {
int to;
int cost;
};
int V;
vector<edge> G[MAX_V];
int d[MAX_V][MAX_V];
void warshall_floyd() {
for (int i = 0; i < V; i++) {
fill(d[i], d[i] + V, INF);
d[i][i] = 0;
for (int j = 0; j < G[i].size(); j+... | #include <bits/stdc++.h>
using namespace std;
int INF = 1e9 + 7;
#define MAX_V 401
struct edge {
int to;
int cost;
};
int V;
vector<edge> G[MAX_V];
int d[MAX_V][MAX_V];
void warshall_floyd() {
for (int i = 0; i < V; i++) {
fill(d[i], d[i] + V, INF);
d[i][i] = 0;
for (int j = 0; j < G[i].size(); j+... | replace | 4 | 5 | 4 | 5 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF 1001001001
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int H;
int W;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
void display_matrix(vector<vector<int>> &matrix) {
int x, y;
cout << "----------... | #include <bits/stdc++.h>
#define INF 1001001001
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int H;
int W;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
void display_matrix(vector<vector<int>> &matrix) {
int x, y;
cout << "----------... | replace | 79 | 80 | 79 | 80 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
const int INF = 0x3fffffff;
int h, w;
vector<string> s;
vector<vector<int>> bfs(int x, int y) {
vector<vector<int>> cost(h, vector<int>(h, INF));
cost[x][y] = 0;
queue<pair<int, int>> q;
q.emplace(x, y);
while... | #include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
const int INF = 0x3fffffff;
int h, w;
vector<string> s;
vector<vector<int>> bfs(int x, int y) {
vector<vector<int>> cost(h, vector<int>(w, INF));
cost[x][y] = 0;
queue<pair<int, int>> q;
q.emplace(x, y);
while... | replace | 8 | 9 | 8 | 9 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define endl "\n"
#define PI 3.14... | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define endl "\n"
#define PI 3.14... | replace | 49 | 50 | 49 | 50 | 0 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll = long long;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define MOD 1000000007
c... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll = long long;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define MOD 1000000007
c... | replace | 30 | 31 | 30 | 31 | -11 | |
p02803 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef pair<int, int> P;
int di[] = {1, -1, 0, 0};
in... | #include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef pair<int, int> P;
int di[] = {1, -1, 0, 0};
in... | replace | 39 | 40 | 39 | 40 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.