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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02235 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int q, t1, t2;
string s1, s2;
const int maxS = 10;
int m[maxS][maxS];
cin >> q;
for (int i = 0; i < q; i++) {
for (int i = 0; i < maxS; i++)
for (int j = 0; j < maxS; j++)
m[i][j] = 0;
cin... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
int q, t1, t2;
string s1, s2;
const int maxS = 1000;
int m[maxS][maxS];
cin >> q;
for (int i = 0; i < q; i++) {
for (int i = 0; i < maxS; i++)
for (int j = 0; j < maxS; j++)
m[i][j] = 0;
c... | replace | 8 | 9 | 8 | 9 | 0 | |
p02235 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
int n;
char x[10000], y[10000];
int dp[10010][10010];
// load n;
cin >> n;
for (int i = 0; i < n; i++) {
// load string
scanf("%s", x);
scanf("%s", y);
// dp
for (int j = 0; j < strlen(x); j++) {
... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
int n;
char x[1001], y[1001];
int dp[1010][1010];
// load n;
cin >> n;
for (int i = 0; i < n; i++) {
// load string
scanf("%s", x);
scanf("%s", y);
// dp
for (int j = 0; j < strlen(x); j++) {
... | replace | 7 | 9 | 7 | 9 | -11 | |
p02235 | C++ | Runtime Error | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 1000
void solve(void);
int q, count[MAX][MAX] = {}, xlength, ylength;
char X[MAX], Y[MAX];
void solve(void) {
int i, j;
xlength = strlen(X);
ylength = strlen(Y);
for (i = 1; i <= xlength; i++) {
for (j = 1; j <= ylen... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 1001
void solve(void);
int q, count[MAX][MAX] = {}, xlength, ylength;
char X[MAX], Y[MAX];
void solve(void) {
int i, j;
xlength = strlen(X);
ylength = strlen(Y);
for (i = 1; i <= xlength; i++) {
for (j = 1; j <= ylen... | replace | 4 | 5 | 4 | 5 | 0 | |
p02235 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
// ---------------------
// repetition
#define FOR(i, a, b) for (... | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
// ---------------------
// repetition
#define FOR(i, a, b) for (... | replace | 31 | 32 | 31 | 32 | 0 | |
p02235 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int N, len1, len2;
string seq1, seq2;
int dp[1000][1000];
int main() {
cin >> N;
for (int M = 0; M < N; M++) {
cin >> seq1 >> seq2;
len1 = seq1.length();
len2 = seq2.length();
for (int i = 1; i <= len1; i++) {
fo... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int N, len1, len2;
string seq1, seq2;
int dp[1000 + 10][1000 + 10];
int main() {
cin >> N;
for (int M = 0; M < N; M++) {
cin >> seq1 >> seq2;
len1 = seq1.length();
len2 = seq2.length();
for (int i = 1; i <= len1; i++) ... | replace | 7 | 8 | 7 | 8 | 0 | |
p02235 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define VARIABLE(x) cerr << #x... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define VARIABLE(x) cerr << #x... | replace | 29 | 30 | 29 | 30 | 0 | |
p02235 | C++ | Runtime Error | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
const int MAX_LENGTH = 256;
char A[MAX_LENGTH + 1];
char B[MAX_LENGTH + 1];
int tu[MAX_LENGTH][MAX_LENGTH];
void lcs(int, int);
int main() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> A >> B;
int lA = strlen(A... | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
const int MAX_LENGTH = 1024;
char A[MAX_LENGTH + 1];
char B[MAX_LENGTH + 1];
int tu[MAX_LENGTH][MAX_LENGTH];
void lcs(int, int);
int main() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> A >> B;
int lA = strlen(... | replace | 5 | 6 | 5 | 6 | 0 | |
p02237 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0.0);
const double eps = 1e-8;
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) REP(i, 0, n)
#define INF (1 << 29)
#define INFLL (1L << 29)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
... | #include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0.0);
const double eps = 1e-8;
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) REP(i, 0, n)
#define INF (1 << 29)
#define INFLL (1L << 29)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
... | replace | 30 | 31 | 30 | 31 | 0 | |
p02237 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<vector<int>> G(n, vector<int>(n, 0));
for (int i = 0; i < n; i++) {
int u, k;
cin >> u >> k;
for (int j = 0; j < k; j++) {
int v;
cin >> v;
G[u][v - 1] = 1;
}
}
for (int i = 0; i < n; i++) {... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<vector<int>> G(n, vector<int>(n, 0));
for (int i = 0; i < n; i++) {
int u, k;
cin >> u >> k;
for (int j = 0; j < k; j++) {
int v;
cin >> v;
G[u - 1][v - 1] = 1;
}
}
for (int i = 0; i < n; i+... | replace | 13 | 14 | 13 | 14 | -11 | |
p02237 | C++ | Runtime Error | #include <iostream>
using namespace std;
static const int N = 100;
int main() {
int M[N][N];
int n, u, k, v;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
M[i][j] = 0;
}
for (int i = 0; i < n; i++) {
cin >> u >> k;
u--;
for (int j = 0; j < k; j++) {
cin ... | #include <iostream>
using namespace std;
static const int N = 100;
int main() {
int M[N][N];
int n, u, k, v;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++)
M[i][j] = 0;
}
for (int i = 0; i < n; i++) {
cin >> u >> k;
u--;
for (int j = 0; j < k; j++) {
cin ... | replace | 26 | 27 | 26 | 27 | -11 | |
p02237 | C++ | Runtime Error | #include <iostream>
#include <stdio.h>
#define MAX 100
int main() {
int n;
int M[MAX][MAX];
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
M[i][j] = 0;
}
}
for (int i = 1; i <= n; i++) {
int id, k;
scanf("%d %d", &id, &k);
if (k == 0)
contin... | #include <iostream>
#include <stdio.h>
#define MAX 101
int main() {
int n;
int M[MAX][MAX];
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
M[i][j] = 0;
}
}
for (int i = 1; i <= n; i++) {
int id, k;
scanf("%d %d", &id, &k);
if (k == 0)
contin... | replace | 3 | 4 | 3 | 4 | 0 | |
p02237 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
const int INF = 1e9;
using namespace std;
vector<int> adj[100];
int res[100][100] = {0};
int main() {
int n;
cin >> n;
REP(i, n) {
int u, k;
cin >> u >> k;
REP(j, k) {
int tmp;
... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
const int INF = 1e9;
using namespace std;
vector<int> adj[100];
int res[105][105] = {0};
int main() {
int n;
cin >> n;
REP(i, n) {
int u, k;
cin >> u >> k;
REP(j, k) {
int tmp;
... | replace | 8 | 9 | 8 | 9 | 0 | |
p02237 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define ALL(v) (v).begin(), (v).end()
#define REP(i... | #include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define ALL(v) (v).begin(), (v).end()
#define REP(i... | replace | 35 | 36 | 35 | 36 | 0 | |
p02238 | C++ | Runtime Error | #include <stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, M[N][N];
int color[N], d[N], f[N], tt;
void dfs_visit(int u) {
int v;
color[u] = GRAY;
d[u] = ++tt;
for (v = 0; v < n; v++) {
if (M[u][v] == 0)
continue;
if (color[v] == WHITE) {
dfs_visit(v);
}
}
... | #include <stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, M[N][N];
int color[N], d[N], f[N], tt;
void dfs_visit(int u) {
int v;
color[u] = GRAY;
d[u] = ++tt;
for (v = 0; v < n; v++) {
if (M[u][v] == 0)
continue;
if (color[v] == WHITE) {
dfs_visit(v);
}
}
... | replace | 43 | 44 | 43 | 44 | -11 | |
p02238 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
struct StSeq {
int m_nBgn;
int m_nEnd;
StSeq() : m_nBgn(0), m_nEnd(0) {}
};
void fnInput(vector<vector<int>> &rvvnAdjcy, vector<StSeq> &rvoDFSrch) {
int nMaxSiz;
cin >> nMaxSiz;
rvvnAdjcy.resize(nMaxSiz + 1, vector<int>(nMaxSiz + 1, 0));
for (... | #include <iostream>
#include <vector>
using namespace std;
struct StSeq {
int m_nBgn;
int m_nEnd;
StSeq() : m_nBgn(0), m_nEnd(0) {}
};
void fnInput(vector<vector<int>> &rvvnAdjcy, vector<StSeq> &rvoDFSrch) {
int nMaxSiz;
cin >> nMaxSiz;
rvvnAdjcy.resize(nMaxSiz + 1, vector<int>(nMaxSiz + 1, 0));
for (... | replace | 33 | 34 | 33 | 34 | 0 | |
p02238 | C++ | Time Limit Exceeded | #include <iostream>
#include <stack>
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[N][N];
int color[N], d[N], f[N], tt;
int nt[N];
// uに隣接するvを番号順に取得
int next(int u) {
for (int v = 0; v < n;
v++) { // 訪問した場所は探索しなくていい... | #include <iostream>
#include <stack>
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[N][N];
int color[N], d[N], f[N], tt;
int nt[N];
// uに隣接するvを番号順に取得
int next(int u) {
for (int v = nt[u]; v < n;
v++) { // 訪問した場所は探索しな... | replace | 15 | 16 | 15 | 16 | TLE | |
p02238 | C++ | Runtime Error | #include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
const int max_v = 100;
vector<vector<int>> adj_list;
int d[max_v] = {0};
int f[max_v] = {0};
int discovered[max_v] = {0};
int t = 1;
// Depth-first Search ( Stack implementation)
void DFS(int v) {
stack<int> S;
S.push(v... | #include <iostream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
const int max_v = 101;
vector<vector<int>> adj_list;
int d[max_v] = {0};
int f[max_v] = {0};
int discovered[max_v] = {0};
int t = 1;
// Depth-first Search ( Stack implementation)
void DFS(int v) {
stack<int> S;
S.push(v... | replace | 7 | 8 | 7 | 8 | 0 | |
p02238 | C++ | Runtime Error | #include <iostream>
#include <stack>
using namespace std;
const int MAX_N = 100;
int A[MAX_N + 1][MAX_N + 1];
pair<int, int> TIMESTAMPS[MAX_N + 1];
int N;
void solve() {
int ts = 0;
stack<int> S;
for (int i = N; i > 0; i--) {
if (TIMESTAMPS[i].first == 0)
S.push(i);
}
while (!S.empty()) {
in... | #include <iostream>
#include <stack>
using namespace std;
const int MAX_N = 100;
int A[MAX_N + 1][MAX_N + 1];
pair<int, int> TIMESTAMPS[MAX_N + 1];
int N;
void solve() {
int ts = 0;
stack<int> S;
for (int i = N; i > 0; i--) {
if (TIMESTAMPS[i].first == 0)
S.push(i);
}
while (!S.empty()) {
in... | replace | 25 | 26 | 25 | 26 | 0 | |
p02238 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
vector<int> graph[100];
int start[100], endt[100];
int cnt;
void dfs(int num) {
start[num] = ++cnt;
for (int i = 0; i < graph[num].size(); i++) {
if (graph[num][i] != num && !endt[graph[num][i]])
dfs(graph[num][i]);
}
endt[num] = ++cnt;
}
i... | #include <iostream>
#include <vector>
using namespace std;
vector<int> graph[100];
int start[100], endt[100];
int cnt;
void dfs(int num) {
start[num] = ++cnt;
for (int i = 0; i < graph[num].size(); i++) {
if (graph[num][i] != num && !start[graph[num][i]] && !endt[graph[num][i]])
dfs(graph[num][i]);
}
... | replace | 11 | 12 | 11 | 12 | 0 | |
p02238 | C++ | Runtime Error | #include <iostream>
#include <stack>
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, tt;
int color[N], nt[N], M[N][N], d[N], f[N];
int next(int u) {
for (int v = nt[u]; v < n; v++) {
nt[u] = v + 1;
if (M[u][v])
re... | #include <iostream>
#include <stack>
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, tt;
int color[N], nt[N], M[N][N], d[N], f[N];
int next(int u) {
for (int v = nt[u]; v < n; v++) {
nt[u] = v + 1;
if (M[u][v])
re... | replace | 76 | 77 | 76 | 77 | -6 | terminate called after throwing an instance of 'std::__ios_failure'
what(): basic_ios::clear: iostream error
|
p02238 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[N][N];
int color[N], d[N], f[N], tt;
int nt[N];
// u?????£??\??????v?????????????????????
int next(int u) {
for (int v = 0; v < n; ++v) {
nt[u] = v ... | #include "bits/stdc++.h"
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[N][N];
int color[N], d[N], f[N], tt;
int nt[N];
// u?????£??\??????v?????????????????????
int next(int u) {
for (int v = nt[u]; v < n; ++v) {
nt[u] ... | replace | 13 | 14 | 13 | 14 | TLE | |
p02239 | C++ | Memory Limit Exceeded | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
const int INF = 1 << 21;
const int maxn = 100 + 10;
int n;
vector<int> g[maxn];
int vis[maxn];
int d[maxn];
void bfs(int s) {
queue<int> que;
que.push(s);
vis[s] = 1;
d[s] = 0;
w... | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
const int INF = 1 << 21;
const int maxn = 100 + 10;
int n;
vector<int> g[maxn];
int vis[maxn];
int d[maxn];
void bfs(int s) {
queue<int> que;
que.push(s);
vis[s] = 1;
d[s] = 0;
w... | insert | 25 | 25 | 25 | 26 | MLE | |
p02239 | C++ | Time Limit Exceeded | // Ref : https://book.mynavi.jp/ec/products/detail/id=35408
#include <iostream>
#include <limits.h>
#include <queue>
using namespace std;
static const int NMAX = 100;
int N, D[NMAX] = {};
bool G[NMAX][NMAX] = {{false}};
void breadthFirstSearch(int base) {
int ix;
for (int i = 0; i < N; i++) {
D[i] = INT_MAX;... | // Ref : https://book.mynavi.jp/ec/products/detail/id=35408
#include <iostream>
#include <limits.h>
#include <queue>
using namespace std;
static const int NMAX = 100;
int N, D[NMAX] = {};
bool G[NMAX][NMAX] = {{false}};
void breadthFirstSearch(int base) {
int ix;
for (int i = 0; i < N; i++) {
D[i] = INT_MAX;... | replace | 24 | 29 | 24 | 30 | TLE | |
p02239 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int inf = 1000000000;
class Graph {
public:
int v;
int cost = inf;
int fti... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int inf = 1000000000;
class Graph {
public:
int v;
int cost = inf;
int fti... | replace | 37 | 41 | 37 | 48 | 0 | |
p02239 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int n, u, k, v;
cin >> n;
vector<int> ans(n, 1000000000);
vector<vector<int>> adj(n);
for (int i = 0; i < n; i++) {
cin >> u >> k;
while (k--)
cin >> v, adj[u - 1].push_back(v - 1);
... | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int n, u, k, v;
cin >> n;
vector<int> ans(n, 1000000000);
vector<vector<int>> adj(n);
for (int i = 0; i < n; i++) {
cin >> u >> k;
while (k--)
cin >> v, adj[u - 1].push_back(v - 1);
... | insert | 23 | 23 | 23 | 25 | TLE | |
p02239 | C++ | Runtime Error | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int n, m, l, p;
int a[100][100];
int D[100];
void bfs(int src) {
queue<int> Q;
Q.push(src);
D[src] = 0;
while (!Q.empty()) {
... | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
int n, m, l, p;
int a[100][100];
int D[100];
void bfs(int src) {
queue<int> Q;
Q.push(src);
D[src] = 0;
while (!Q.empty()) {
... | replace | 28 | 29 | 28 | 29 | 0 | 1 0
2 1
3 2
4 1
|
p02239 | C++ | Runtime Error | #include <iostream>
#include <queue>
using namespace std;
static const int N = 100;
static const int INFTY = (1 << 21);
int n, M[N][N];
int d[N];
void bfs(int s) {
queue<int> q;
q.push(s);
for (int i = 0; i < n; i++) {
d[i] = INFTY;
}
d[s] = 0;
int u;
while (!q.empty()) {
u = q.front();
q.po... | #include <iostream>
#include <queue>
using namespace std;
static const int N = 100;
static const int INFTY = (1 << 21);
int n, M[N][N];
int d[N];
void bfs(int s) {
queue<int> q;
q.push(s);
for (int i = 0; i < n; i++) {
d[i] = INFTY;
}
d[s] = 0;
int u;
while (!q.empty()) {
u = q.front();
q.po... | replace | 38 | 39 | 38 | 39 | -11 | |
p02239 | C++ | Runtime Error | #include <iostream>
#include <queue>
using namespace std;
int D[100];
int a[100][100];
int main() {
for (int i = 0; i < 100; i++) {
for (int j = 0; j < 100; j++) {
a[i][j] = 0;
}
}
int n, u, k, v;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> u >> k;
for (int j = 0; j < k; j++) {
... | #include <iostream>
#include <queue>
using namespace std;
int D[100];
int a[100][100];
int main() {
for (int i = 0; i < 100; i++) {
for (int j = 0; j < 100; j++) {
a[i][j] = 0;
}
}
int n, u, k, v;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> u >> k;
for (int j = 0; j < k; j++) {
... | delete | 32 | 34 | 32 | 32 | 0 | visiting 1 0
visiting 2 1
visiting 4 1
visiting 3 2
|
p02239 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <queue>
#define INF 999999999
using namespace std;
int res[101];
int G[101][101] = {0};
int main() {
int n, u, v, k;
std::queue<int> Q;
std::cin >> n;
for (int i = 0; i < n; i++) {
std::cin >> u >> k;
for (int j = 0; j < k; j++) {
std::cin >> v;
... | #include <algorithm>
#include <iostream>
#include <queue>
#define INF 999999999
using namespace std;
int res[101];
int G[101][101] = {0};
int main() {
int n, u, v, k;
std::queue<int> Q;
std::cin >> n;
for (int i = 0; i < n; i++) {
std::cin >> u >> k;
for (int j = 0; j < k; j++) {
std::cin >> v;
... | insert | 33 | 33 | 33 | 34 | TLE | |
p02240 | C++ | Runtime Error | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
static const int MAX = 10000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r, int c) {
stack<int> S;
S.push(r);
color[r] = c;
while (!S.empty()) {
int u = S.top();
S.pop();
for (int i ... | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r, int c) {
stack<int> S;
S.push(r);
color[r] = c;
while (!S.empty()) {
int u = S.top();
S.pop();
for (int i... | replace | 4 | 5 | 4 | 5 | 0 | |
p02240 | C++ | Runtime Error | #include <climits>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
static const int MAX = 100;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r, int c) {
stack<int> S;
S.push(r);
color[r] = c;
while (!S.empty()) {
int u = S.top();
S.pop()... | #include <climits>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r, int c) {
stack<int> S;
S.push(r);
color[r] = c;
while (!S.empty()) {
int u = S.top();
S.po... | replace | 6 | 7 | 6 | 7 | 0 | |
p02240 | C++ | Runtime Error | #include <stdio.h>
int ancestor[10];
int find(int x) {
if (ancestor[x] == x)
return x;
return ancestor[x] = find(ancestor[x]);
}
int min(int a, int b) {
if (a < b)
return a;
return b;
}
int max(int a, int b) {
if (a > b)
return a;
return b;
}
int main() {
int n, q, m, temp, x, y;
scanf("%d%d... | #include <stdio.h>
int ancestor[100000];
int find(int x) {
if (ancestor[x] == x)
return x;
return ancestor[x] = find(ancestor[x]);
}
int min(int a, int b) {
if (a < b)
return a;
return b;
}
int max(int a, int b) {
if (a > b)
return a;
return b;
}
int main() {
int n, q, m, temp, x, y;
scanf("... | replace | 1 | 2 | 1 | 2 | 0 | |
p02240 | C++ | Runtime Error | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
static const int MAX = 10000;
static const int NIL = -1;
int n, color[MAX];
vector<int> G[MAX];
void dfs(int r, int c) {
stack<int> S;
int u, i, v;
S.push(r);
color[r] = c;
while (!S.empty()) {
u = S.top();
S.pop();
fo... | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n, color[MAX];
vector<int> G[MAX];
void dfs(int r, int c) {
stack<int> S;
int u, i, v;
S.push(r);
color[r] = c;
while (!S.empty()) {
u = S.top();
S.pop();
f... | replace | 4 | 5 | 4 | 5 | 0 | |
p02240 | C++ | Runtime Error | #include <stdio.h>
#include <string>
#include <vector>
using namespace std;
vector<vector<int>> g;
int n, m, q, s, t;
vector<bool> visited;
vector<int> color;
void dfs(int s) {
for (int i = 0; i < g[s].size(); i++) {
if (color[g[s][i]] == -1) {
color[g[s][i]] = color[s];
dfs(g[s][i]);
}
}
}
bo... | #include <stdio.h>
#include <string>
#include <vector>
using namespace std;
vector<vector<int>> g;
int n, m, q, s, t;
vector<bool> visited;
vector<int> color;
void dfs(int s) {
for (int i = 0; i < g[s].size(); i++) {
if (color[g[s][i]] == -1) {
color[g[s][i]] = color[s];
dfs(g[s][i]);
}
}
}
bo... | replace | 52 | 53 | 52 | 53 | 0 | |
p02240 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
using namespace std;
int n;
string *color;
queue<int> q;
int *ans;
vector<int> g[10000];
void bfs(int x) {
color[x] = "gray";
q.push(x);
while (q.size() != 0) {
int u = q.front();
q.pop();
for (int i ... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
using namespace std;
int n;
string *color;
queue<int> q;
int *ans;
vector<int> g[1000000];
void bfs(int x) {
color[x] = "gray";
q.push(x);
while (q.size() != 0) {
int u = q.front();
q.pop();
for (int ... | replace | 15 | 16 | 15 | 16 | 0 | |
p02240 | C++ | Runtime Error | #include <stdio.h>
using namespace std;
const int MAX = 100000;
int parent(int table[], int child) {
if (table[child] == -1)
return child;
return table[child] = parent(table, table[child]);
}
int main() {
int n, m, q;
int table[MAX];
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++)
table[i] ... | #include <stdio.h>
using namespace std;
const int MAX = 100000;
int parent(int table[], int child) {
if (table[child] == -1)
return child;
return table[child] = parent(table, table[child]);
}
int main() {
int n, m, q;
int table[MAX];
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++)
table[i] ... | delete | 27 | 30 | 27 | 27 | -11 | |
p02240 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> G(100);
vector<int> c(100);
void dfs(int s, int x) {
if (c[s])
return;
c[s] = x;
for (auto a : G[s])
dfs(a, x);
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
for (int i = 0; i < m; +... | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> G(100000);
vector<int> c(100000);
void dfs(int s, int x) {
if (c[s])
return;
c[s] = x;
for (auto a : G[s])
dfs(a, x);
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
for (int i = 0; i ... | replace | 3 | 5 | 3 | 5 | 0 | |
p02240 | C++ | Runtime Error | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
vector<int> G[10000];
int color[10000];
int n;
void dfs(int idx, int c) {
stack<int> s;
s.push(idx);
color[idx] = c;
while (!s.empty()) {
int u = s.top();
s.pop();
for (int i = 0; i < G[u].size(); ++i) {
int v = G[... | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
vector<int> G[100000];
int color[100000];
int n;
void dfs(int idx, int c) {
stack<int> s;
s.push(idx);
color[idx] = c;
while (!s.empty()) {
int u = s.top();
s.pop();
for (int i = 0; i < G[u].size(); ++i) {
int v = ... | replace | 6 | 8 | 6 | 8 | 0 | |
p02240 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
static const int N = 100;
int n, m;
int color[N], dist;
vector<int> G[N];
void dfs(int i, int c) {
queue<int> q;
q.push(i);
color[i] = c;
while (!q.empty()) {
int u = q.front();
q.pop();
for (int i = 0... | #include <iostream>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
static const int N = 100001;
int n, m;
int color[N], dist;
vector<int> G[N];
void dfs(int i, int c) {
queue<int> q;
q.push(i);
color[i] = c;
while (!q.empty()) {
int u = q.front();
q.pop();
for (int i ... | replace | 7 | 8 | 7 | 8 | 0 | |
p02241 | C++ | Runtime Error | #include <iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];
int prim() {
int u, minv;
int d[MAX], p[MAX], color[MAX];
for (int i = 0; i < n; i++) {
d[i] = INF... | #include <iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];
int prim() {
int u, minv;
int d[MAX], p[MAX], color[MAX];
for (int i = 0; i < n; i++) {
d[i] = INF... | replace | 58 | 59 | 58 | 59 | -11 | |
p02241 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];
int prim() {
int u, minv;
int d[MAX], p[MAX], color[MAX];
// Tに属する頂点とV-Tに属する頂点をつなぐ辺の中で、重みが最小の辺の重みを記録
/... | #include <iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];
int prim() {
int u, minv;
int d[MAX], p[MAX], color[MAX];
// Tに属する頂点とV-Tに属する頂点をつなぐ辺の中で、重みが最小の辺の重みを記録
/... | insert | 37 | 37 | 37 | 38 | TLE | |
p02241 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n; // number of vertices
int P[110], A[2020], B[2020], C[2020];
pair<int, int> D[2020]; // Weights and coordinates
void init(int N) { // Initially all the points are individualized
for (int i = 0; i <= N; ++i)
P[i] = i;
}
int r... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n; // number of vertices
int P[20200], A[20200], B[20200], C[20200];
pair<int, int> D[20200]; // Weights and coordinates
int root(int a) { // find the root of a
if (P[a] == a)
return a; // a is the root
return ... | replace | 6 | 13 | 6 | 8 | 0 | |
p02241 | C++ | Runtime Error | // kruskal tree
#include <algorithm>
#include <iostream>
using namespace std;
#define M 999
int parent[M], a[M], b[M];
pair<int, int> node[M];
int root(int a) { return parent[a] == a ? a : parent[a] = root(parent[a]); }
int unite(int a, int b) {
int x = root(a), y = root(b);
if (x == y)
return 0;
parent[x] = ... | // kruskal tree
#include <algorithm>
#include <iostream>
using namespace std;
#define M 9999
int parent[M], a[M], b[M];
pair<int, int> node[M];
int root(int a) { return parent[a] == a ? a : parent[a] = root(parent[a]); }
int unite(int a, int b) {
int x = root(a), y = root(b);
if (x == y)
return 0;
parent[x] =... | replace | 4 | 5 | 4 | 5 | 0 | |
p02242 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
typedef pair<int, int> P;
typedef pair<P, P> PP;
int main(void) {
int i, j, k, u, n, flg[1001], v, c, sum, ky[1001], t, min, g;
PP ke[1001];
scanf("%d"... | #include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
typedef pair<int, int> P;
typedef pair<P, P> PP;
int main(void) {
int i, j, k, u, n, flg[10001], v, c, sum, ky[10001], t, min, g;
PP ke[10001];
scanf("... | replace | 10 | 12 | 10 | 12 | 0 | |
p02242 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <limits>
#include <vector>
using namespace std;
using graph = vector<vector<int>>;
int main() {
int n;
cin >> n;
graph G(n, vector<int>(n, -1));
for (int i = 0; i < n; ++i) {
int u, k;
cin >> u >> k;
for (int j = 0; j < k; ++j) {
int v, c;
... | #include <algorithm>
#include <iostream>
#include <limits>
#include <vector>
using namespace std;
using graph = vector<vector<int>>;
int main() {
int n;
cin >> n;
graph G(n, vector<int>(n, -1));
for (int i = 0; i < n; ++i) {
int u, k;
cin >> u >> k;
for (int j = 0; j < k; ++j) {
int v, c;
... | replace | 38 | 39 | 38 | 39 | TLE | |
p02242 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) \
sort(x.begin(), x.end()); ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) \
sort(x.begin(), x.end()); ... | replace | 64 | 65 | 64 | 67 | 0 | |
p02242 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];
void dijkstra() {
int minv;
int d[MAX], color[MAX];
for (int i = 0; i < n; i++) {
d[i] = INFTY;
... | #include <iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];
void dijkstra() {
int minv;
int d[MAX], color[MAX];
for (int i = 0; i < n; i++) {
d[i] = INFTY;
... | replace | 31 | 32 | 31 | 32 | TLE | |
p02242 | C++ | Runtime Error | /*宣言*/
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <queue>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
int main() {
int n, u, k, w[101][101], v, c;
... | /*宣言*/
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <queue>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
int main() {
int n, u, k, w[101][101], v, c;
... | replace | 29 | 30 | 29 | 30 | 0 | |
p02242 | C++ | Memory Limit Exceeded | #include <climits>
#include <cstdio>
#include <iostream>
using namespace std;
#define N 10000
int n;
int g[N][N];
int weight[N];
bool us[N];
// prim
void prim() {
int v;
weight[0] = 0;
while (true) {
v = -1;
for (int i = 0; i < n; i++) {
if (us[i] != true && (v == -1 || weight[i] < weight[v]... | #include <climits>
#include <cstdio>
#include <iostream>
using namespace std;
#define N 1010
int n;
int g[N][N];
int weight[N];
bool us[N];
// prim
void prim() {
int v;
weight[0] = 0;
while (true) {
v = -1;
for (int i = 0; i < n; i++) {
if (us[i] != true && (v == -1 || weight[i] < weight[v])... | replace | 5 | 6 | 5 | 6 | MLE | |
p02243 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF 1000000000
#define MAX_N 100
using namespace std;
int n;
int d[MAX_N];
struct edge {
int to, cost;
edge(int to_, int cost_) : to(to_), cost(cost_) {}
};
typedef pair<int, int> P;
vector<edge> G[MAX_N];
void Dijkstra(int start) {
fill(d, d + n, INF);
priority_queue<P, vecto... | #include <bits/stdc++.h>
#define INF 1000000000
#define MAX_N 10000
using namespace std;
int n;
int d[MAX_N];
struct edge {
int to, cost;
edge(int to_, int cost_) : to(to_), cost(cost_) {}
};
typedef pair<int, int> P;
vector<edge> G[MAX_N];
void Dijkstra(int start) {
fill(d, d + n, INF);
priority_queue<P, vec... | replace | 2 | 3 | 2 | 3 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
typedef pair<int, int> pii;
#define INF 0x3f3f3f3f
#define fi first
#define se second
int mcos[105];
vector<pii> G[105];
int N;
void dijkstra(int start) {
priority_queue<pii, vector<pii>, greater<pii>> pq;
pq.push... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
typedef pair<int, int> pii;
#define INF 0x3f3f3f3f
#define fi first
#define se second
int mcos[10005];
vector<pii> G[1000005];
int N;
void dijkstra(int start) {
priority_queue<pii, vector<pii>, greater<pii>> pq;
p... | replace | 12 | 14 | 12 | 14 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
static const int NMAX = 100;
#define INF (1 << 30)
int main() {
int n;
cin >> n;
vector<pair<int, int>> adj[NMAX];
for (int i = 0; i < n; i++) {
int id, nn;
cin >> id >> nn;
for (int j = 0; j < nn; j++... | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
static const int NMAX = 10000;
#define INF (1 << 30)
int main() {
int n;
cin >> n;
vector<pair<int, int>> adj[NMAX];
for (int i = 0; i < n; i++) {
int id, nn;
cin >> id >> nn;
for (int j = 0; j < nn; j... | replace | 5 | 6 | 5 | 6 | 0 | |
p02243 | C++ | Runtime Error | #include <bits/stdc++.h>
#define d first
#define wgt first
#define to second
using namespace std;
typedef pair<int, int> pii;
typedef vector<pii> vec;
typedef vector<vec> Graph;
Graph G(11000);
int n, d[11000];
void Dijkstra() {
bool used[1100];
priority_queue<pii, vector<pii>, greater<pii>> pq;
fill(d, d + n... | #include <bits/stdc++.h>
#define d first
#define wgt first
#define to second
using namespace std;
typedef pair<int, int> pii;
typedef vector<pii> vec;
typedef vector<vec> Graph;
Graph G(11000);
int n, d[11000];
void Dijkstra() {
bool used[11000];
priority_queue<pii, vector<pii>, greater<pii>> pq;
fill(d, d + ... | replace | 15 | 16 | 15 | 16 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#define MAX 1000
#define INF (1 << 21)
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
int n;
vector<pair<int, int>> adj_list[MAX];
void Dijkstra() {
priority_queue<pair<int, int>> PQ;
int next, min_cost;
int color[n], dist[n];
for... | #include <algorithm>
#include <iostream>
#include <queue>
#define MAX 10000
#define INF (1 << 21)
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
int n;
vector<pair<int, int>> adj_list[MAX];
void Dijkstra() {
priority_queue<pair<int, int>> PQ;
int next, min_cost;
int color[n], dist[n];
fo... | replace | 3 | 4 | 3 | 4 | 0 | |
p02243 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
int x[10000][2000];
int x2[10000][2000];
int y[10000];
int z[10000];
int main() {
memset(x, 1, sizeof(x));
memset(y, 1, sizeof(y));
int n, a, b, c, d, e;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a >> b;
for (int i... | #include <algorithm>
#include <cstring>
#include <iostream>
using namespace std;
int x[10000][2000];
int x2[10000][2000];
int y[10000];
int z[10000];
int main() {
memset(x, 1, sizeof(x));
memset(y, 1, sizeof(y));
int n, a, b, c, d, e;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a >> b;
for (int i... | replace | 25 | 26 | 25 | 26 | TLE | |
p02243 | C++ | Runtime Error | #include <iostream>
#include <vector>
struct Edge {
int to, weight;
};
int main() {
int n, u, k, v, c, distance[100]{}, upd_num = 1;
bool must_update[100]{1};
std::vector<Edge> dest[100];
std::cin >> n;
for (int i = 0; i < n; ++i) {
std::cin >> u >> k;
for (int j = 0; j < k; ++j) {
std::cin... | #include <iostream>
#include <vector>
struct Edge {
int to, weight;
};
int main() {
int n, u, k, v, c, distance[100000]{}, upd_num = 1;
bool must_update[100000]{1};
std::vector<Edge> dest[500000];
std::cin >> n;
for (int i = 0; i < n; ++i) {
std::cin >> u >> k;
for (int j = 0; j < k; ++j) {
... | replace | 8 | 11 | 8 | 11 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define MAX 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY (1 << 30)
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pair<int, int>> PQ;
int... | #include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define MAX 10000
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY (1 << 30)
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pair<int, int>> PQ;
i... | replace | 7 | 8 | 7 | 8 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pair<int, int>> P... | #include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
static const int MAX = 10000;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pair<int, int>>... | replace | 4 | 5 | 4 | 5 | 0 | |
p02243 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
#define MAX 10000
#define INFTY 99999999
#define WHITE 0
#define GRAY 1
#define BLACK 2
struct Node {
vector<int> ch;
vector<int> co;
};
Node G[MAX];
int n;
int d[MAX];
int p[MAX];
int color[MAX];
void dijkstra(int s) {
int u;
for (int i = 0; i ... | #include <iostream>
#include <vector>
using namespace std;
#define MAX 10000
#define INFTY 99999999
#define WHITE 0
#define GRAY 1
#define BLACK 2
struct Node {
vector<int> ch;
vector<int> co;
};
Node G[MAX];
int n;
int d[MAX];
int p[MAX];
int color[MAX];
void dijkstra(int s) {
int u;
for (int i = 0; i ... | replace | 52 | 57 | 52 | 60 | TLE | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <st... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <st... | replace | 31 | 33 | 31 | 33 | 0 | |
p02243 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> P;
struct edge {
int to, cost;
};
const int INF = 2100000000;
int n;
vector<edge> G[110];
vector<int> dijkstra(int s) {
priority_queue<P, vector<P>, greater<P>> que;
que.push(P(0, s));
vector<i... | #include <iostream>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> P;
struct edge {
int to, cost;
};
const int INF = 2100000000;
int n;
vector<edge> G[10010];
vector<int> dijkstra(int s) {
priority_queue<P, vector<P>, greater<P>> que;
que.push(P(0, s));
vector... | replace | 11 | 12 | 11 | 12 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
#define P pair<int, int> // cost to
using namespace std;
vector<P> rinsetu[100];
int mincost[100];
signed main() {
int a;
cin >> a;
for (int b = ... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
#define P pair<int, int> // cost to
using namespace std;
vector<P> rinsetu[10000];
int mincost[10000];
signed main() {
int a;
cin >> a;
for (int ... | replace | 12 | 14 | 12 | 14 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctype.h>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define mo... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctype.h>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define mo... | replace | 24 | 25 | 24 | 25 | 0 | |
p02243 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
const int MAX_N = 100;
const int INF = (1 << 21);
int N;
vector<pair<int, int>> A[MAX_N];
void dj() {
int d[MAX_N], c[MAX_N];
// (first: distance*-1, second: adjacent)
priority_queue<pair<int, int>> PQ;
for (int ... | #include <iostream>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
const int MAX_N = 10000;
const int INF = (1 << 21);
int N;
vector<pair<int, int>> A[MAX_N];
void dj() {
int d[MAX_N], c[MAX_N];
// (first: distance*-1, second: adjacent)
priority_queue<pair<int, int>> PQ;
for (in... | replace | 6 | 7 | 6 | 7 | 0 | |
p02243 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <functional>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
int main() {
int n;
scanf("%d", &n);
vector<vector<pii>> G(n);
for (int i = 0; i < n; ++i) {
int u, k, v, c;
scanf("%d%d", &u, &k);
fo... | #include <algorithm>
#include <cstdio>
#include <functional>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
int main() {
int n;
scanf("%d", &n);
vector<vector<pii>> G(n);
for (int i = 0; i < n; ++i) {
int u, k, v, c;
scanf("%d%d", &u, &k);
fo... | insert | 30 | 30 | 30 | 31 | TLE | |
p02243 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAX = 105;
int state[MAX], N, D[MAX];
vector<pair<int, int>> S[MAX];
priority_queue<pair<int, int>> Q;
void dijkstra() {
int cnt = 1;
for (int i = 0; i < N; i++) {
state[i] = 0;
D[i] = 10000000;
}
state[0] = 1;
D[0] = 0;
for (int i = 0; i < S... | #include <bits/stdc++.h>
using namespace std;
const int MAX = 10005;
int state[MAX], N, D[MAX];
vector<pair<int, int>> S[MAX];
priority_queue<pair<int, int>> Q;
void dijkstra() {
int cnt = 1;
for (int i = 0; i < N; i++) {
state[i] = 0;
D[i] = 10000000;
}
state[0] = 1;
D[0] = 0;
for (int i = 0; i <... | replace | 3 | 4 | 3 | 4 | 0 | |
p02243 | C++ | Runtime Error | #include <climits>
#include <cstdio>
#include <cstring>
#include <map>
#include <queue>
using namespace std;
typedef map<int, int>::iterator mitr;
map<int, int> w[100];
int d[100];
char pos[100];
priority_queue<pair<int, int>> others;
pair<int, int> p;
void findPath() {
p = others.top();
others.pop();
while (... | #include <climits>
#include <cstdio>
#include <cstring>
#include <map>
#include <queue>
using namespace std;
typedef map<int, int>::iterator mitr;
map<int, int> w[10000];
int d[10000];
char pos[10000];
priority_queue<pair<int, int>> others;
pair<int, int> p;
void findPath() {
p = others.top();
others.pop();
w... | replace | 9 | 12 | 9 | 12 | 0 | |
p02243 | C++ | Runtime Error | #include <iostream>
#include <limits.h>
#include <queue>
#include <vector>
using namespace std;
struct Node {
int id;
int cost;
bool done;
vector<int> next_node;
vector<int> len_cost;
bool operator<(const Node &right) const { return cost > right.cost; }
} node[100];
int main() {
int n, id, k;
cin >... | #include <iostream>
#include <limits.h>
#include <queue>
#include <vector>
using namespace std;
struct Node {
int id;
int cost;
bool done;
vector<int> next_node;
vector<int> len_cost;
bool operator<(const Node &right) const { return cost > right.cost; }
} node[10000];
int main() {
int n, id, k;
cin... | replace | 15 | 16 | 15 | 16 | 0 | |
p02243 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template <class T> constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template <class T> constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char> T_char TL(T_char cX) ... | #include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template <class T> constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template <class T> constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char> T_char TL(T_char cX) ... | replace | 64 | 65 | 64 | 65 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#define rep(index, num) for (int index = 0; index < num; index++)
#define rep1(index, num) for (int index = 1; index <= num; index++)
... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#define rep(index, num) for (int index = 0; index < num; index++)
#define rep1(index, num) for (int index = 1; index <= num; index++)
... | replace | 25 | 26 | 25 | 26 | 0 | |
p02243 | C++ | Runtime Error | #include <iostream>
#include <queue>
using namespace std;
#define INFTY (1 << 30)
//???????????????
enum Color {
WHITE,
GRAY,
BLACK,
};
// SSSP
void Dijkstra(vector<pair<int, int>> *v_w_m, int verNum) {
//???????¨????
priority_queue<pair<int, int>> pQ;
int distance[10000];
Color color[10000];
int pa... | #include <iostream>
#include <queue>
using namespace std;
#define INFTY (1 << 30)
//???????????????
enum Color {
WHITE,
GRAY,
BLACK,
};
// SSSP
void Dijkstra(vector<pair<int, int>> *v_w_m, int verNum) {
//???????¨????
priority_queue<pair<int, int>> pQ;
int distance[10000];
Color color[10000];
int pa... | replace | 79 | 80 | 79 | 80 | -11 | |
p02243 | C++ | Runtime Error | #include <iostream>
#include <queue>
using namespace std;
#define INFTY (1 << 30)
//???????????????
enum Color {
WHITE,
GRAY,
BLACK,
};
// SSSP
void Dijkstra(vector<pair<int, int>> v_w_m[], int verNum) {
//???????¨????
priority_queue<pair<int, int>> pQ;
int distance[100];
Color color[100];
int paren... | #include <iostream>
#include <queue>
using namespace std;
#define INFTY (1 << 30)
//???????????????
enum Color {
WHITE,
GRAY,
BLACK,
};
// SSSP
void Dijkstra(vector<pair<int, int>> v_w_m[], int verNum) {
//???????¨????
priority_queue<pair<int, int>> pQ;
int distance[10000];
Color color[10000];
int p... | replace | 18 | 21 | 18 | 21 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
static const int MAX = 1000;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pair<int, int>... | #include <algorithm>
#include <climits>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
static const int MAX = 10000;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pair<int, int... | replace | 7 | 8 | 7 | 8 | 0 | |
p02243 | C++ | Runtime Error | //
// Created by ?????°?????? on 2016/05/19.
//
#include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
const int MAX = 100;
const int INFTY = (1 << 21);
const int WHITE = 0;
const int GRAY = 1;
const int BLACK = 2;
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pai... | //
// Created by ?????°?????? on 2016/05/19.
//
#include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
const int MAX = 10000;
const int INFTY = (1 << 20);
const int WHITE = 0;
const int GRAY = 1;
const int BLACK = 2;
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<p... | replace | 8 | 10 | 8 | 10 | 0 | |
p02243 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <limits>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> Edge;
int main() {
int n;
cin >> n;
vector<vector<Edge>> lists;
for (int i = 0; i < n; i++) {
vector<Edge> list;
int u, k;
cin >> u >> k;
... | #include <algorithm>
#include <iostream>
#include <limits>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> Edge;
int main() {
int n;
cin >> n;
vector<vector<Edge>> lists;
for (int i = 0; i < n; i++) {
vector<Edge> list;
int u, k;
cin >> u >> k;
... | replace | 27 | 28 | 27 | 28 | TLE | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long int;
#define rep(i, n) for... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long int;
#define rep(i, n) for... | replace | 37 | 38 | 37 | 38 | 0 | |
p02243 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
vector<int> adja[10000], cost[10000];
#define INF (1 << 30)
int main() {
int n, id, k;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> id >> k;
adja[id].resize(k);
cost[id].resize(k);
for (int j = 0; j < k; ++j) {
cin >> adja[id][j] >> cost[i... | #include <bits/stdc++.h>
using namespace std;
vector<int> adja[10000], cost[10000];
#define INF (1 << 30)
int main() {
int n, id, k;
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> id >> k;
adja[id].resize(k);
cost[id].resize(k);
for (int j = 0; j < k; ++j) {
cin >> adja[id][j] >> cost[i... | replace | 21 | 22 | 21 | 24 | TLE | |
p02243 | C++ | Time Limit Exceeded | // -*- mode:c++; coding:utf-8; c-basic-offset:2; -*-
// ALDS1_12_C: Single Source Shortest Path II
#include <algorithm>
#include <cstdio>
#include <queue>
#include <utility>
#include <vector>
using uint = unsigned int;
class Graph {
using vc_t = std::pair<uint, uint>;
std::vector<std::vector<vc_t>> g_;
public:
... | // -*- mode:c++; coding:utf-8; c-basic-offset:2; -*-
// ALDS1_12_C: Single Source Shortest Path II
#include <algorithm>
#include <cstdio>
#include <queue>
#include <utility>
#include <vector>
using uint = unsigned int;
class Graph {
using vc_t = std::pair<uint, uint>;
std::vector<std::vector<vc_t>> g_;
public:
... | replace | 26 | 27 | 26 | 27 | TLE | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
static const int MAX = 100;
static const int INFTY = 2000000000;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pair<int, int>> PQ... | #include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
static const int MAX = 100000;
static const int INFTY = 2000000000;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n;
vector<pair<int, int>> adj[MAX];
void dijkstra() {
priority_queue<pair<int, int>>... | replace | 4 | 5 | 4 | 5 | 0 | |
p02243 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <stdio.h>
#include <tuple>
#include <vector>
using namespace std;
#define NUM 100
#define NIL -1
#define INF 1000000000
#define WHITE 0
#define BLACK 1
int node_num;
vector<tuple<int, int>> G[NUM];
priority_queue<tuple<int, int>> PQ;
int V[NUM];
int color[NUM];
void init(... | #include <iostream>
#include <queue>
#include <stdio.h>
#include <tuple>
#include <vector>
using namespace std;
#define NUM 10000
#define NIL -1
#define INF 1000000000
#define WHITE 0
#define BLACK 1
int node_num;
vector<tuple<int, int>> G[NUM];
priority_queue<tuple<int, int>> PQ;
int V[NUM];
int color[NUM];
void ini... | replace | 7 | 8 | 7 | 8 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define int(x) \
int x; \
scanf("%d", &x)
#defi... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define int(x) \
int x; \
scanf("%d", &x)
#defi... | replace | 15 | 18 | 15 | 18 | 0 | |
p02243 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define INT_MAX 2147483647
#de... | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define INT_MAX 2147483647
#de... | replace | 27 | 28 | 27 | 28 | 0 | |
p02244 | C++ | Runtime Error | #include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string.h>
namespace {
const int N = 8;
// the positions of k-queens are fixed.
// Once initialized, the values remain unchanged.
bool row[N] = {false};
bool col[N] = {false};
bool down[2 * N - 1] = {false};
bool up[2 * N - 1] = {false};
int pos[N];
... | #include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string.h>
namespace {
const int N = 8;
// the positions of k-queens are fixed.
// Once initialized, the values remain unchanged.
bool row[N] = {false};
bool col[N] = {false};
bool down[2 * N - 1] = {false};
bool up[2 * N - 1] = {false};
int pos[N];
... | replace | 51 | 52 | 51 | 52 | 0 | |
p02244 | C++ | Time Limit Exceeded | #include <cassert>
#include <iostream>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1];
bool X[N][N];
void init() {
for (int i = 0; i < N; i++) {
row[i] = FREE;
col[i] = FREE;
}
for (int i = 0; i < 2 * N - 1; i++) {
dpos[i] = ... | #include <cassert>
#include <iostream>
using namespace std;
#define N 8
#define FREE -1
#define NOT_FREE 1
int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1];
bool X[N][N];
void init() {
for (int i = 0; i < N; i++) {
row[i] = FREE;
col[i] = FREE;
}
for (int i = 0; i < 2 * N - 1; i++) {
dpos[i] = ... | replace | 51 | 52 | 51 | 52 | TLE | |
p02245 | C++ | Memory Limit Exceeded | #include <cmath>
#include <cstdio>
#include <map>
#include <queue>
#include <string>
#include <utility>
using namespace std;
#define N (3)
#define N2 (N * N)
struct Puzzle {
int f[N2];
int space;
string path;
bool operator<(const Puzzle &p) const {
for (int i = 0; i < N2; i++) {
if (f[i] == p.f[i]... | #include <cmath>
#include <cstdio>
#include <map>
#include <queue>
#include <string>
#include <utility>
using namespace std;
#define N (3)
#define N2 (N * N)
struct Puzzle {
int f[N2];
int space;
string path;
bool operator<(const Puzzle &p) const {
for (int i = 0; i < N2; i++) {
if (f[i] == p.f[i]... | replace | 23 | 25 | 23 | 25 | MLE | |
p02245 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
queue<pair<string, int>> Q;
void Sw(string st, int x) {
int i;
int pos, npos;
int d[4] = {-3, 3, -1, 1};
string st1;
for (i = 0; i <= 8; i++) {
if (st[i] == '0') {
pos = i;
break;
}
}
for (i = ... | #include <cstdio>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
queue<pair<string, int>> Q;
void Sw(string st, int x) {
int i;
int pos, npos;
int d[4] = {-3, 3, -1, 1};
string st1;
for (i = 0; i <= 8; i++) {
if (st[i] == '0') {
pos = i;
break;
}
}
for (i = ... | replace | 23 | 24 | 23 | 24 | 0 | |
p02245 | C++ | Memory Limit Exceeded | #include <array>
#include <cctype>
#include <cstdio>
#include <queue>
#include <set>
using namespace std;
#define si static inline
#define gcu getchar_unlocked
si int in() {
int n = 0, c = gcu();
// bool minus = false; if (c == '-') minus = true, c = gcu();
do {
n = 10 * n + (c - '0'), c = gcu();
} while (... | #include <array>
#include <cctype>
#include <cstdio>
#include <queue>
#include <set>
using namespace std;
#define si static inline
#define gcu getchar_unlocked
si int in() {
int n = 0, c = gcu();
// bool minus = false; if (c == '-') minus = true, c = gcu();
do {
n = 10 * n + (c - '0'), c = gcu();
} while (... | insert | 92 | 92 | 92 | 96 | MLE | |
p02246 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int N = 4;
const int LIMIT = 100;
int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
int limit;
int puz[N * N];
int zero;
int esti;
int MDT[N * N][N * N];
int dfs(int dep, int pre) {
if (esti == 0)
return dep;
if (dep >= limit)
return LIMIT;
int ret = ... | #include <bits/stdc++.h>
using namespace std;
const int N = 4;
const int LIMIT = 100;
int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
int limit;
int puz[N * N];
int zero;
int esti;
int MDT[N * N][N * N];
int dfs(int dep, int pre) {
if (esti == 0)
return dep;
if (dep + esti >= limit)
return LIMIT;
int... | replace | 15 | 16 | 15 | 16 | TLE | |
p02246 | C++ | Runtime Error | #include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
#define N 4
#define N2 16
static const int dx[4] = {0, -1, 0, 1};
static const int dy[4] = {1, 0, -1, 0};
static const char dir[4] = {'r', 'u', 'l', 'd'};
int MDT[N2][N2];
struct Puzzle {
int f[N2], space, M... | #include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
#define N 4
#define N2 16
static const int dx[4] = {0, -1, 0, 1};
static const int dy[4] = {1, 0, -1, 0};
static const char dir[4] = {'r', 'u', 'l', 'd'};
int MDT[N2][N2];
struct Puzzle {
int f[N2], space, M... | replace | 94 | 95 | 94 | 95 | -11 | |
p02246 | C++ | Memory Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
const int num = 16, ud[] = {-1, 0, 1, 0}, lr[] = {0, -1, 0, 1}, nd = 4;
int md[num][num];
struct puzzle {
int sp, p[num], mdp, cost;
bool operator<(const puzzle &pu) co... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
const int num = 16, ud[] = {0, -1, 0, 1}, lr[] = {1, 0, -1, 0}, nd = 4;
int md[num][num];
struct puzzle {
int sp, p[num], mdp, cost;
bool operator<(const puzzle &pu) co... | replace | 7 | 8 | 7 | 8 | MLE | |
p02246 | C++ | Memory Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
const int num = 16, ud[] = {0, 1, 0, -1}, lr[] = {1, 0, -1, 0}, nd = 4;
int md[num][num];
struct puzzle {
int sp, p[num], mdp, cost;
bool operator<(const puzzle &pu) co... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
const int num = 16, ud[] = {-1, 1, 0, 0}, lr[] = {0, 0, -1, 1}, nd = 4;
int md[num][num];
struct puzzle {
int sp, p[num], mdp, cost;
bool operator<(const puzzle &pu) co... | replace | 7 | 8 | 7 | 8 | MLE | |
p02246 | C++ | Memory Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
const int num = 16, ud[] = {-1, 0, 0, 1}, lr[] = {0, -1, 1, 0}, nd = 4;
int md[num][num];
struct puzzle {
int sp, p[num], mdp, cost;
bool operator<(const puzzle &pu) co... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
const int num = 16, ud[] = {1, 0, 0, -1}, lr[] = {0, -1, 1, 0}, nd = 4;
int md[num][num];
struct puzzle {
int sp, p[num], mdp, cost;
bool operator<(const puzzle &pu) co... | replace | 7 | 8 | 7 | 8 | MLE | |
p02246 | C++ | Time Limit Exceeded | // #define debug
// //*******************************************************************************************************************************************
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// [Tips]
// XCode??§???EOF??\??????... | // #define debug
// //*******************************************************************************************************************************************
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// [Tips]
// XCode??§???EOF??\??????... | replace | 299 | 306 | 299 | 306 | TLE | |
p02246 | C++ | Runtime Error | #include <algorithm>
#include <functional>
#include <iostream>
#include <istream>
#include <map>
#include <ostream>
#include <queue>
#include <random>
#include <stack>
#include <tuple>
#include <utility>
using namespace std;
// puzzle ?????¶?????????key (ULL) ??§??¨?????????
// priority_que ?????£????????????stack<ke... | #include <algorithm>
#include <functional>
#include <iostream>
#include <istream>
#include <map>
#include <ostream>
#include <queue>
#include <random>
#include <stack>
#include <tuple>
#include <utility>
using namespace std;
// puzzle ?????¶?????????key (ULL) ??§??¨?????????
// priority_que ?????£????????????stack<ke... | replace | 58 | 59 | 58 | 59 | -11 | |
p02246 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long lli;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<vector<lli>> mat;... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long lli;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<vector<lli>> mat;... | replace | 52 | 53 | 52 | 53 | TLE | |
p02246 | C++ | Memory Limit Exceeded | /*
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_13_C
* A*
*/
#include <iostream>
#include <map>
#include <queue>
#include <vector>
#define N 4
#define N2 16
using namespace std;
vector<int> move_list[N2];
int dist[N2][N2];
class Game {
public:
int board[N2];
int w;
vector<int> root;
int... | /*
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_13_C
* A*
*/
#include <iostream>
#include <map>
#include <queue>
#include <vector>
#define N 4
#define N2 16
using namespace std;
vector<int> move_list[N2];
int dist[N2][N2];
class Game {
public:
char board[N2];
char w;
vector<char> root;
... | replace | 17 | 21 | 17 | 21 | MLE | |
p02246 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#define HEAP_SIZE 1000000
#define HASH_SIZE 10000000
#define MAX_STEPS 45
typedef struct _node {
unsigned long long data;
int steps;
int f;
struct _node *next;
} node;
unsigned int hash(unsigned long long data) {
unsigned long lo... | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#define HEAP_SIZE 5000000
#define HASH_SIZE 10000000
#define MAX_STEPS 45
typedef struct _node {
unsigned long long data;
int steps;
int f;
struct _node *next;
} node;
unsigned int hash(unsigned long long data) {
unsigned long lo... | replace | 5 | 6 | 5 | 6 | 0 | |
p02246 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define N 4
#define N2 16
#define LIMIT 100
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};
const char dir[4] = {'r', 'u', 'l', 'd'};
int MDT[N2][N2];
struct puzzle {
int f[N2], space, MD;
};
puzzle state;
int limit;
int path[LIMIT];
int getALLMD(... | #include <bits/stdc++.h>
using namespace std;
#define N 4
#define N2 16
#define LIMIT 100
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};
const char dir[4] = {'r', 'u', 'l', 'd'};
int MDT[N2][N2];
struct puzzle {
int f[N2], space, MD;
};
puzzle state;
int limit;
int path[LIMIT];
int getALLMD(... | replace | 49 | 52 | 49 | 52 | TLE | |
p02246 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
constexpr int n = 3;
const int n2 = n * n;
int MDT[n2][n2];
struct Puzzle {
public:
int f[n2], space, MD;
int cost;
bool operator<(const Puzzle &p) const {
for (int i = 0; i < n2; i++) {
if (f[i] == p.f[i])
... | #include <cmath>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
constexpr int n = 4;
const int n2 = n * n;
int MDT[n2][n2];
struct Puzzle {
public:
int f[n2], space, MD;
int cost;
bool operator<(const Puzzle &p) const {
for (int i = 0; i < n2; i++) {
if (f[i] == p.f[i])
... | replace | 6 | 7 | 6 | 7 | TLE | |
p02246 | C++ | Runtime Error | /////////////////////////////////////////////////////////
//
// ~/Izumi_Chiharu/c/temp.cpp file
// Last Updated: 2018-06-17 ...Maybe
//
// I hope you adding this code to the setting file
// alias g++='g++ -std=c++1y -DDEBUG_LOCAL'
//
// My sweet heart Chiharu Izumi
//
//////////////////////////////////////////... | /////////////////////////////////////////////////////////
//
// ~/Izumi_Chiharu/c/temp.cpp file
// Last Updated: 2018-06-17 ...Maybe
//
// I hope you adding this code to the setting file
// alias g++='g++ -std=c++1y -DDEBUG_LOCAL'
//
// My sweet heart Chiharu Izumi
//
//////////////////////////////////////////... | replace | 286 | 287 | 286 | 287 | -11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.