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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
int main() {
int n, m;
cin >> n >> m;
int a, b;
vector<int> to[100005];
for (int i = 0; i < m; i++) {
cin >> a >> b;
a--;
b--;
to[a].push_back(b);
to[b].push_back(a);
}
queue<int> q;
vector<int> dist(n, inf);
... | #include <bits/stdc++.h>
using namespace std;
const int inf = 1001001001;
int main() {
int n, m;
cin >> n >> m;
int a, b;
vector<int> to[100005];
for (int i = 0; i < m; i++) {
cin >> a >> b;
a--;
b--;
to[a].push_back(b);
to[b].push_back(a);
}
queue<int> q;
vector<int> dist(n, inf);
... | insert | 24 | 24 | 24 | 26 | TLE | |
p02678 | C++ | Time Limit Exceeded | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int n, m, a, b;
cin >> n >> m;
vector<int> to[100005];
for (int i = 0; i < m; i++) {
cin >> a >> b;
a--;
b--;
to[a].push_back(b);
to[b].push_back(a);
}
queue<int> q;
vector<int> dist(n, 100005);
... | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int n, m, a, b;
cin >> n >> m;
vector<int> to[100005];
for (int i = 0; i < m; i++) {
cin >> a >> b;
a--;
b--;
to[a].push_back(b);
to[b].push_back(a);
}
queue<int> q;
vector<int> dist(n, 100005);
... | replace | 23 | 24 | 23 | 24 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll GCD(ll a, ll b) { return a ? GCD(b % a, a) : b; }
int main() {
int n, m;
cin >> n >> m;
vector<int> a(m), b(m);
for (int i = 0; i < m; i++)
cin >> a[i] >> b[i];
vector<vector<int>> G(n);
for (int i = 0; i < n; i++) {
G[a[i] - 1].... | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll GCD(ll a, ll b) { return a ? GCD(b % a, a) : b; }
int main() {
int n, m;
cin >> n >> m;
vector<int> a(m), b(m);
for (int i = 0; i < m; i++)
cin >> a[i] >> b[i];
vector<vector<int>> G(n);
for (int i = 0; i < m; i++) {
G[a[i] - 1].... | replace | 11 | 12 | 11 | 12 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, n) for (int i = (a); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define FORD(i, a, n) for (int i = (a); i >= (n); i--)
#define REPD(i, n) FOR(i, n, 0)
#define ALL(o) (o).begin(), (o).end()
template <class T> using V = vector<T>;... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, n) for (int i = (a); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define FORD(i, a, n) for (int i = (a); i >= (n); i--)
#define REPD(i, n) FOR(i, n, 0)
#define ALL(o) (o).begin(), (o).end()
template <class T> using V = vector<T>;... | replace | 43 | 44 | 43 | 44 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main(int argc, const char *argv[]) {
int n, m;
cin >> n >> m;
vector<vector<int>> g(m);
for (int i = 0; i < m; ++i) {
int a, b;
cin >> a >> b;
a--, b--;
g[a].push_back(b);
g[b].push_back(a);
}
vector<int> ans(n, -1);
queue<int> q;
... | #include <bits/stdc++.h>
using namespace std;
int main(int argc, const char *argv[]) {
int n, m;
cin >> n >> m;
vector<vector<int>> g(n);
for (int i = 0; i < m; ++i) {
int a, b;
cin >> a >> b;
a--, b--;
g[a].push_back(b);
g[b].push_back(a);
}
vector<int> ans(n, -1);
queue<int> q;
... | replace | 8 | 9 | 8 | 9 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<vector<int>> graph(N);
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
graph[a].push_back(b);
graph[b].push_back(a);
}
vector<int>... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<vector<int>> graph(N);
for (int i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
graph[a].push_back(b);
graph[b].push_back(a);
}
vector<int>... | replace | 9 | 10 | 9 | 10 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MAX 300005
#define endl "\n"
vector<lli> adj[MAX + 5];
lli ans[MAX];
queue<lli> q;
lli N, M;
void BFS(int source, vector<lli> adj[MAX + 5], vector<bool> &visited) {
visited[source] = true;
q.push(source);
while (!q.empty()) {
sou... | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MAX 300005
#define endl "\n"
vector<lli> adj[MAX + 5];
lli ans[MAX];
queue<lli> q;
lli N, M;
void BFS(int source, vector<lli> adj[MAX + 5], vector<bool> &visited) {
visited[source] = true;
q.push(source);
while (!q.empty()) {
sou... | replace | 17 | 18 | 17 | 18 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a =... | replace | 24 | 25 | 24 | 25 | -11 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const ll N = 1e5;
ll n, m, cnt, a;
vector<int> g[N];
ll used[N], p[N];
string s;
int main() {
cin >> n >> m;
for (int i = 0; i < m; i++) {
ll x, y;
cin >> x >> y;
g[x].pb(y);
g[y].pb(x);
}
queue<int> q;
q... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const ll N = 2e6 + 7;
ll n, m, cnt, a;
vector<int> g[N];
ll used[N], p[N];
string s;
int main() {
cin >> n >> m;
for (int i = 0; i < m; i++) {
ll x, y;
cin >> x >> y;
g[x].pb(y);
g[y].pb(x);
}
queue<int> q;... | replace | 5 | 6 | 5 | 6 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
string explanation1 = "これは幅優先探索の問題!";
string explanation2 =
"参考URL:https://qiita.com/drken/items/996d80bcae64649a6580";
const int INF = 1001001001;
int main() {
int n, m;
cin >> n >> m;
// グラフ入力受け取り
Graph G(m);
for (int i ... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
string explanation1 = "これは幅優先探索の問題!";
string explanation2 =
"参考URL:https://qiita.com/drken/items/996d80bcae64649a6580";
const int INF = 1001001001;
int main() {
int n, m;
cin >> n >> m;
// グラフ入力受け取り
Graph G(100005);
for (i... | replace | 14 | 15 | 14 | 15 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, l, r) for (ll i = (ll)l; i < (ll)(r); i++)
const ll INF = 1e9;
using Graph = vector<vector<int>>;
int N, M;
Graph G;
int main() {
cin >> N >> M;
G.assign(N, vector<int>());
rep(i, 0, N) {
int a, b;
cin >> a >> b;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, l, r) for (ll i = (ll)l; i < (ll)(r); i++)
const ll INF = 1e9;
using Graph = vector<vector<int>>;
int N, M;
Graph G;
int main() {
cin >> N >> M;
G.assign(N, vector<int>());
rep(i, 0, M) {
int a, b;
cin >> a >> b;
... | replace | 14 | 15 | 14 | 15 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define MOD = 998244353;
#define int long long int
#define inf (int)(1e15)
#define all(x) (x).begin(), (x).end()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << e... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define MOD = 998244353;
#define int long long int
#define inf (int)(1e15)
#define all(x) (x).begin(), (x).end()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << e... | insert | 62 | 62 | 62 | 63 | -11 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long
typedef long long ll;
using namespace std;
int N, M;
vector<vector<int>> G;
vector<int> ans;
void bfs() {
queue<ll> Q;
vector<ll> color(N, 0);
Q.push(0);
color[0] = 1;
while (!Q.empty()) {
ll u = Q.front();
Q.pop();
for (int i = 0; i < G[u].size(); ... | #include <bits/stdc++.h>
#define int long long
typedef long long ll;
using namespace std;
int N, M;
vector<vector<int>> G;
vector<int> ans;
void bfs() {
queue<ll> Q;
vector<ll> color(N, 0);
Q.push(0);
color[0] = 1;
while (!Q.empty()) {
ll u = Q.front();
Q.pop();
for (int i = 0; i < G[u].size(); ... | delete | 41 | 43 | 41 | 41 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int s[205000];
vector<int> v[100];
int main() {
int n, m;
memset(s, -1, sizeof(s));
cin >> n >> m;
while (m--) {
int u, v1;
cin >> u >> v1;
v[u].push_back(v1);
v[v1].push_back(u);
}
queue<int> que;
s[1] = 0;
for (int i = 0; i < v[1].size(); i... | #include <bits/stdc++.h>
using namespace std;
int s[205000];
vector<int> v[205000];
int main() {
int n, m;
memset(s, -1, sizeof(s));
cin >> n >> m;
while (m--) {
int u, v1;
cin >> u >> v1;
v[u].push_back(v1);
v[v1].push_back(u);
}
queue<int> que;
s[1] = 0;
for (int i = 0; i < v[1].size()... | replace | 3 | 4 | 3 | 4 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int n, m;
bool v[100001], unvisited = false;
int ans[100001];
int dis[100001];
vector<int> adj[100001], newcurr;
int main() {
cin >> n >> m;
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
adj[a].push_back(b);
adj[b].push_back(a);
}
newcurr.pu... | #include <bits/stdc++.h>
using namespace std;
int n, m;
bool v[100001], unvisited = false;
int ans[100001];
int dis[100001];
vector<int> adj[100001], newcurr;
int main() {
cin >> n >> m;
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
adj[a].push_back(b);
adj[b].push_back(a);
}
newcurr.pu... | insert | 32 | 32 | 32 | 33 | TLE | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int N = 100010;
vector<int> G[N];
vector<int> D(N);
vector<int> B(N);
void dfs(int now) {
for (auto x : G[now]) {
int to = x;
if (D[to] > D[now] + 1) {
D[to] = D[now] + 1;
B[to] = now + 1;
dfs(to);
}
}
}
int main() {
cin.tie(null... | #include <bits/stdc++.h>
using namespace std;
const int N = 100010;
vector<int> G[N];
vector<int> D(N);
vector<int> B(N);
void dfs(int now) {
for (auto x : G[now]) {
int to = x;
if (D[to] > D[now] + 1) {
D[to] = D[now] + 1;
B[to] = now + 1;
dfs(to);
}
}
}
int main() {
cin.tie(null... | insert | 40 | 40 | 40 | 55 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> list(n, vector<int>(n));
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
--a;
--b;
list[a].push_back(b);
list[b].push_back(a);
}
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> list(n);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
--a;
--b;
list[a].push_back(b);
list[b].push_back(a);
}
queue<int> q;... | replace | 10 | 11 | 10 | 11 | 0 | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#i... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#i... | replace | 48 | 50 | 48 | 50 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(), x.end()
#define rep(i, j, n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 100... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(), x.end()
#define rep(i, j, n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 100... | replace | 30 | 31 | 30 | 31 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e7;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> graph(m);
for (int i = 0; i < m; ++i) {
int a, b;
cin >> a >> b;
// 配列の位置と入力の数値を統一する
--a;
--b;
// aからb,
// b... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e7;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> graph(n);
for (int i = 0; i < m; ++i) {
int a, b;
cin >> a >> b;
// 配列の位置と入力の数値を統一する
--a;
--b;
// aからb,
// b... | replace | 11 | 12 | 11 | 12 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define repa(i, a, b) for (auto i = (a); i <= (b); i++)
#define repd(i, a, b) for (auto i = (a); i >= (b); i--)
#define rep(i, n) for (int i = 0; i < n... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define repa(i, a, b) for (auto i = (a); i <= (b); i++)
#define repd(i, a, b) for (auto i = (a); i >= (b); i--)
#define rep(i, n) for (int i = 0; i < n... | replace | 57 | 58 | 57 | 59 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int inf = 10000000;
typedef pair<int, int> P;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> to(n);
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
to[a].push_back(b);
to[b].push_back(a);
}
vector<int> paren... | #include <bits/stdc++.h>
using namespace std;
int inf = 10000000;
typedef pair<int, int> P;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> to(n);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
to[a].push_back(b);
to[b].push_back(a);
}
vector<int> paren... | replace | 10 | 11 | 10 | 11 | 0 | |
p02678 | C++ | Runtime Error | // C++(Clang 10.0.0)
// GCC用 ナゾです
// #pragma GCC target("avx")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <cassert> //assert(x>=0) -> x<0の時異常終了
#include <cmath>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <n... | // C++(Clang 10.0.0)
// GCC用 ナゾです
// #pragma GCC target("avx")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <cassert> //assert(x>=0) -> x<0の時異常終了
#include <cmath>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <n... | replace | 214 | 215 | 214 | 215 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
#define faster \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #include <algorithm>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
#define faster \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | insert | 33 | 33 | 33 | 35 | TLE | |
p02678 | C++ | Runtime Error | #pragma GCC optimize(3)
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
/*#include<ext/pb_ds/assoc_container.hpp>
#includ... | #pragma GCC optimize(3)
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
/*#include<ext/pb_ds/assoc_container.hpp>
#includ... | replace | 26 | 27 | 26 | 27 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<int> to[10005];
void bfs(int n) {
queue<int> q;
vector<int> dist(n, -1);
vector<int> pre(n, -1);
q.push(0);
dist[0] = 0;
while (!q.empty()) {
int v = q.front();
q.pop();
for (int u : to[v]) {
if (dist[u] != -1)
continue;
... | #include <bits/stdc++.h>
using namespace std;
vector<int> to[100005];
void bfs(int n) {
queue<int> q;
vector<int> dist(n, -1);
vector<int> pre(n, -1);
q.push(0);
dist[0] = 0;
while (!q.empty()) {
int v = q.front();
q.pop();
for (int u : to[v]) {
if (dist[u] != -1)
continue;
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;
vector<int> G[10010];
int main() {
int n, m;
cin >> n >> m;
rep(i, m) {
int a, b;
cin >> a >> b;
a--;
b--;
G[a].push_... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;
vector<int> G[100100];
int main() {
int n, m;
cin >> n >> m;
rep(i, m) {
int a, b;
cin >> a >> b;
a--;
b--;
G[a].push... | replace | 7 | 8 | 7 | 8 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<set<int>> path(n);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
path.at(a - 1).insert(b - 1);
path.at(b - 1).insert(a - 1);
}
queue<int> q;
vector<int> depth(n, -1);
vector<int> done(n, 0... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<set<int>> path(n);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
path.at(a - 1).insert(b - 1);
path.at(b - 1).insert(a - 1);
}
queue<int> q;
vector<int> depth(n, -1);
vector<int> done(n, 0... | replace | 22 | 28 | 22 | 28 | TLE | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
vector<int> a[200010];
int dis[200010];
int main() {
int n, m;
while (cin >> n >> m) {
ll ans = 0;
for (int i = 1; i <= n; ++i) {
dis[i] = n + 10;
}
... | #include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
vector<int> a[200010];
int dis[200010];
int main() {
int n, m;
while (cin >> n >> m) {
ll ans = 0;
for (int i = 1; i <= n; ++i) {
dis[i] = n + 10;
}
... | replace | 28 | 29 | 28 | 29 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(), x.end()
#define rep(i, j, n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 100... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(), x.end()
#define rep(i, j, n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 100... | replace | 54 | 55 | 54 | 55 | -6 | free(): invalid pointer
|
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int mod = 1e9 + 7;
// const int mod = 998244353;
const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
void YesNo(bool j) {
cout << (j ? "Yes" : "No") << endl;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int mod = 1e9 + 7;
// const int mod = 998244353;
const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
void YesNo(bool j) {
cout << (j ? "Yes" : "No") << endl;
... | replace | 22 | 23 | 22 | 23 | 0 | |
p02678 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <vector>
#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;
cin >> n >> m;
vector<vector<int>> dp(n);
REP(i, n) {
int a, b;
cin >> a >> b;
a--, b--;
dp[a].push_b... | #include <iostream>
#include <queue>
#include <vector>
#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;
cin >> n >> m;
vector<vector<int>> dp(n);
REP(i, m) {
int a, b;
cin >> a >> b;
a--, b--;
dp[a].push_b... | replace | 14 | 15 | 14 | 15 | 0 | |
p02678 | C++ | Runtime Error | #include <iostream>
#include <queue>
#include <stdio.h>
#include <vector>
typedef long long ll;
#define debug(x) cerr << #x << ": " << x << "\n";
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<vector<int>> G(M);
rep(i, M) {
int a, b;
... | #include <iostream>
#include <queue>
#include <stdio.h>
#include <vector>
typedef long long ll;
#define debug(x) cerr << #x << ": " << x << "\n";
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<vector<int>> G(N);
rep(i, M) {
int a, b;
... | replace | 16 | 17 | 16 | 17 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
// cin.tie(0);
// ios::sync_with_stdio(false);
int N, M;
scanf("%d %d", &N, &M);
vector<vector<pair<int, int>>> w(N + 1,
vector<pair<int, int>>()); //(部屋,道番号)
vector<pair<int, int>> result(N + 1, make_pair(N + 1... | #include <bits/stdc++.h>
using namespace std;
int main() {
// cin.tie(0);
// ios::sync_with_stdio(false);
int N, M;
scanf("%d %d", &N, &M);
vector<vector<pair<int, int>>> w(N + 1,
vector<pair<int, int>>()); //(部屋,道番号)
vector<pair<int, int>> result(N + 1, make_pair(N + 1... | replace | 34 | 35 | 34 | 35 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<vector<int>> path(M + 1);
for (int i = 1; i <= M; i++) {
int a, b;
cin >> a >> b;
path[a].push_back(b);
path[b].push_back(a);
}
vector<int> dist(N + 1, INT_MAX);
vector<int> prev(N + 1, INT_MAX);
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<vector<int>> path(N + 1);
for (int i = 1; i <= M; i++) {
int a, b;
cin >> a >> b;
path[a].push_back(b);
path[b].push_back(a);
}
vector<int> dist(N + 1, INT_MAX);
vector<int> prev(N + 1, INT_MAX);
... | replace | 7 | 8 | 7 | 8 | 0 | |
p02678 | C++ | Runtime Error | #pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for (int i = (int)(n); i > 0; i--)
#define pb... | #pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for (int i = (int)(n); i > 0; i--)
#define pb... | replace | 95 | 96 | 95 | 96 | 0 | |
p02678 | C++ | Time Limit Exceeded | // include
// ------------------------------------------------
#include <algorithm>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
// func
// ------------------------------------------------
int CalcSumOfDigit(int n); // 各桁の和を計算する。
int getDigit(int n); // 数字の桁数を取得する。
string upper(string str); ... | // include
// ------------------------------------------------
#include <algorithm>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
// func
// ------------------------------------------------
int CalcSumOfDigit(int n); // 各桁の和を計算する。
int getDigit(int n); // 数字の桁数を取得する。
string upper(string str); ... | insert | 77 | 77 | 77 | 81 | TLE | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define int long long
int mod = 1e9 + 7;
signed main() {
ios_base::sync_with_stdio(0... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define int long long
int mod = 1e9 + 7;
signed main() {
ios_base::sync_with_stdio(0... | replace | 22 | 23 | 22 | 23 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> r(m);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
r[a - 1].push_back(b - 1);
r[b - 1].push_back(a - 1);
}
vector<int> d(n, -1);
queue<int> que;
d[0] = 0;
que.push(0);
w... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> r(n);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
r[a - 1].push_back(b - 1);
r[b - 1].push_back(a - 1);
}
vector<int> d(n, -1);
queue<int> que;
d[0] = 0;
que.push(0);
w... | replace | 6 | 7 | 6 | 7 | 0 | |
p02678 | C++ | Runtime Error |
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stdio.h>
using namespace std;
#define N 10001
#define INFTY 100000000
int n, m;
vector<int> num[N];
bool color[N];
int d[N];
void bfs(int s) {
queue<int> q; // 標準ライブラリのqueue 入るものは最後尾 出すものは先頭
q.push(s);
for (int i = 0; i < n; i++) {
d[i... |
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stdio.h>
using namespace std;
#define N 200001
#define INFTY 100000000
int n, m;
vector<int> num[N];
bool color[N];
int d[N];
void bfs(int s) {
queue<int> q; // 標準ライブラリのqueue 入るものは最後尾 出すものは先頭
q.push(s);
for (int i = 0; i < n; i++) {
d[... | replace | 6 | 7 | 6 | 7 | 0 | |
p02678 | C++ | Runtime Error | #include "bits/stdc++.h"
#define rep(i, j) for (int i = 0; i < j; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using ull = unsigned long long;
int gcd(int x, int y);
const int INF = 1001001001;
// mint�p�̕ϐ� (10��9��)
const int mod = 1000000007;
struct mint {
ll x; // typedef long lon... | #include "bits/stdc++.h"
#define rep(i, j) for (int i = 0; i < j; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using ull = unsigned long long;
int gcd(int x, int y);
const int INF = 1001001001;
// mint�p�̕ϐ� (10��9��)
const int mod = 1000000007;
struct mint {
ll x; // typedef long lon... | replace | 56 | 57 | 56 | 57 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define eps 1e-3
#define pi acos(-1.0)
#define inf 0x3f
#define INF 0x3f3f3f3f
#define pb push_back
#define debug1 cout << "&&";
#define debug2 cout << "**";
#define ms(a, x) memset(a, x, sizeof(a))
#define for0(i, n) for (int i = 0; i < n; ++i)
#define for1(i, n) for (int i = 1; i <= n; ++i)
u... | #include <bits/stdc++.h>
#define eps 1e-3
#define pi acos(-1.0)
#define inf 0x3f
#define INF 0x3f3f3f3f
#define pb push_back
#define debug1 cout << "&&";
#define debug2 cout << "**";
#define ms(a, x) memset(a, x, sizeof(a))
#define for0(i, n) for (int i = 0; i < n; ++i)
#define for1(i, n) for (int i = 1; i <= n; ++i)
u... | replace | 23 | 24 | 23 | 24 | 0 | |
p02678 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for (int i ... | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for (int i ... | replace | 52 | 53 | 52 | 53 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<int> v[10001] = {};
vector<int> vs(10001, -1);
void bfs() {
int s = 1;
vs[s] = 0;
queue<int> q;
q.push(s);
while (!q.empty()) {
int t = q.front();
q.pop();
int num = (int)v[t].size();
for (int i = 0; i < num; i++) {
if (vs[v[t][i]] =... | #include <bits/stdc++.h>
using namespace std;
vector<int> v[100001] = {};
vector<int> vs(100001, -1);
void bfs() {
int s = 1;
vs[s] = 0;
queue<int> q;
q.push(s);
while (!q.empty()) {
int t = q.front();
q.pop();
int num = (int)v[t].size();
for (int i = 0; i < num; i++) {
if (vs[v[t][i]]... | replace | 3 | 5 | 3 | 5 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
// #define MULTI_TEST
int n, m;
vector<int> p;
vector<vector<int>> to;
vector<int> ans;
vector<int> a;
void path(int par, int r, int d) {
if (p[r])
return;
p[r] = 1;
if (a[r] >= d) {
a[r] = d;
ans[r] = par;
}
for (int i : to[r])... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
// #define MULTI_TEST
int n, m;
vector<int> p;
vector<vector<int>> to;
vector<int> ans;
vector<int> a;
void path(int par, int r, int d) {
if (p[r])
return;
p[r] = 1;
if (a[r] >= d) {
a[r] = d;
ans[r] = par;
}
for (int i : to[r])... | replace | 45 | 46 | 45 | 72 | TLE | |
p02678 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
const long MOD = 1000000007;
typedef pair<int, int> P;
typedef long long ll;
int main() {
int N, M;
cin >> N >> M;
vector<int> G[N];
int a[M], b[M];
for (int i = 0; i < M; i++) ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
const long MOD = 1000000007;
typedef pair<int, int> P;
typedef long long ll;
int main() {
int N, M;
cin >> N >> M;
vector<int> G[N];
int a[M], b[M];
for (int i = 0; i < M; i++) ... | replace | 27 | 28 | 27 | 28 | TLE | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
long long modinv(long long a, long long m) {
long long b = m, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b;
swap(a, b);
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
long long modinv(long long a, long long m) {
long long b = m, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b;
swap(a, b);
... | insert | 29 | 29 | 29 | 30 | -6 | double free or corruption (out)
|
p02678 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <forward_list>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#define ll long long int... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <forward_list>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#define ll long long int... | replace | 28 | 29 | 28 | 29 | 0 | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int nextr[100010];
vector<int> rt[10010];
int record[100010];
int main() {
int N, M;
cin >> N >> M;
/*
for (int i =1;i<N+1;i++){
for(int j=1;j<N+1;j++){
route[i][j]=0;
}
}*/
for (... | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int nextr[100010];
vector<int> rt[100100];
int record[100010];
int main() {
int N, M;
cin >> N >> M;
/*
for (int i =1;i<N+1;i++){
for(int j=1;j<N+1;j++){
route[i][j]=0;
}
}*/
for ... | replace | 7 | 8 | 7 | 8 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define INF 1e+9
#define MAX_V 20002
struct edge {
int to;
};
int V;
vector<edge> G[MAX_V];
int d[MAX_V];
int mark[MAX_V];
void dijkstra(int s) {
priority_queue<P, vector<... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define INF 1e+9
#define MAX_V 200002
struct edge {
int to;
};
int V;
vector<edge> G[MAX_V];
int d[MAX_V];
int mark[MAX_V];
void dijkstra(int s) {
priority_queue<P, vector... | replace | 6 | 7 | 6 | 7 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using namespace std;
int main() {
int n, m, a, b;
cin >> n >> m;
vector<vector<int>> v(m);
rep(i, m) {
cin >> a >> b;
a--, b--;
v[a].push_back(b);
v[b].p... | #include <bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using namespace std;
int main() {
int n, m, a, b;
cin >> n >> m;
vector<vector<int>> v(n);
rep(i, m) {
cin >> a >> b;
a--, b--;
v[a].push_back(b);
v[b].p... | replace | 9 | 10 | 9 | 10 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const string YES = "Yes";
const string NO = "No";
void solve(long long N, long long M, std::vector<long long> A,
std::vector<long long> B) {
vector<vector<long long>> lis(N + 1);
vector<long long> path(N + 1, LLONG_MAX);
for (long long i = 0; i < N; i++) ... | #include <bits/stdc++.h>
using namespace std;
const string YES = "Yes";
const string NO = "No";
void solve(long long N, long long M, std::vector<long long> A,
std::vector<long long> B) {
vector<vector<long long>> lis(N + 1);
vector<long long> path(N + 1, LLONG_MAX);
for (long long i = 0; i < M; i++) ... | replace | 10 | 11 | 10 | 11 | 0 | |
p02678 | C++ | Time Limit Exceeded | // #define _GLIBCXX_DEBUG
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using pss = pair<string, string>;
using pcc = pair<char, char>;
using pbb = pair<bool, bool>;
using pil = pair<i... | // #define _GLIBCXX_DEBUG
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using pss = pair<string, string>;
using pcc = pair<char, char>;
using pbb = pair<bool, bool>;
using pil = pair<i... | replace | 317 | 318 | 317 | 318 | TLE | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <climits>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
#define INF 1000000007 // 1000000000000000003
#define MOD 10000... | #include <algorithm>
#include <array>
#include <climits>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>
#define INF 1000000007 // 1000000000000000003
#define MOD 10000... | replace | 179 | 180 | 179 | 197 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1 << 30;
const long long LINF = 1LL << 60;
const long long MOD = (long long)1e9 + 7;
int main() {
int n, m, ans = 0;
cin >> n >> m;
vector<vector<int>> e(m);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1 << 30;
const long long LINF = 1LL << 60;
const long long MOD = (long long)1e9 + 7;
int main() {
int n, m, ans = 0;
cin >> n >> m;
vector<vector<int>> e(n);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
... | replace | 12 | 13 | 12 | 13 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define quickie \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rep1(i, a, b) for (int i = a; i <= b;... | #include <bits/stdc++.h>
#define int long long
#define quickie \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rep1(i, a, b) for (int i = a; i <= b;... | replace | 30 | 33 | 30 | 33 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 5;
int t;
int n, m;
int par[N];
bool vis[N];
vector<vector<int>> v;
void fail() {
cout << "No";
exit(0);
}
void solve() {
cin >> n >> m;
v.resize(n + 5);
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
v[x].push_back(y)... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int t;
int n, m;
int par[N];
bool vis[N];
vector<vector<int>> v;
void fail() {
cout << "No";
exit(0);
}
void solve() {
cin >> n >> m;
v.resize(n + 5);
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
v[x].push_back(y)... | replace | 4 | 5 | 4 | 5 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
typedef long long ll;
constexpr auto INFI = 2147483647;
const ll INFL = 9223372036854775807;
int main() {
int n, m;
cin >> n >> m;
vector<int> parent(n, -1);
vector... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
typedef long long ll;
constexpr auto INFI = 2147483647;
const ll INFL = 9223372036854775807;
int main() {
int n, m;
cin >> n >> m;
vector<int> parent(n, -1);
vector... | replace | 13 | 14 | 13 | 14 | 0 | |
p02678 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <random>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<... | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <random>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<... | replace | 142 | 143 | 142 | 143 | -11 | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define ll long long
int main(void) {
int n, m;
cin >> n >> m;
vector<int> a(m), b(m);
for (int i = 0; i < m; +... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define ll long long
int main(void) {
int n, m;
cin >> n >> m;
vector<int> a(m), b(m);
for (int i = 0; i < m; +... | replace | 49 | 50 | 49 | 50 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define arep(i, x, n) for (int i = int(x); i < (int)(n); i++)
#define rep(i, n) for (long long i = 0; i < n; ++i)
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9 + 7
using ll = long long;
using P = pair<int, int>;
using lP = pair<ll, ll>;
using fP = pair... | #include <bits/stdc++.h>
using namespace std;
#define arep(i, x, n) for (int i = int(x); i < (int)(n); i++)
#define rep(i, n) for (long long i = 0; i < n; ++i)
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9 + 7
using ll = long long;
using P = pair<int, int>;
using lP = pair<ll, ll>;
using fP = pair... | replace | 22 | 23 | 22 | 23 | 0 | |
p02678 | Python | Runtime Error | from collections import deque
n, m = map(int, input().split())
INF = 100000000
to = [[] for _ in range(10005)]
for i in range(m):
a, b = map(int, input().split())
a -= 1
b -= 1
to[a].append(b)
to[b].append(a)
print("Yes")
q = deque([])
dist = [INF] * n
pre = [-1] * n
dist[0] = 0
q.append(0)
while... | from collections import deque
n, m = map(int, input().split())
INF = 100000000
to = [[] for _ in range(100005)]
for i in range(m):
a, b = map(int, input().split())
a -= 1
b -= 1
to[a].append(b)
to[b].append(a)
print("Yes")
q = deque([])
dist = [INF] * n
pre = [-1] * n
dist[0] = 0
q.append(0)
whil... | replace | 5 | 6 | 5 | 6 | 0 | |
p02678 | Python | Time Limit Exceeded | from dataclasses import dataclass
from collections import deque
@dataclass
class Query:
now: int
prev: int
cost: int
N, M = map(int, input().split())
E = [[] for _ in range(N + 1)]
for e in range(M):
a, b = map(int, input().split())
E[a].append(b)
E[b].append(a)
res = [-1 for _ in range(N ... | from dataclasses import dataclass
from collections import deque
@dataclass
class Query:
now: int
prev: int
cost: int
N, M = map(int, input().split())
E = [[] for _ in range(N + 1)]
for e in range(M):
a, b = map(int, input().split())
E[a].append(b)
E[b].append(a)
res = [-1 for _ in range(N ... | replace | 34 | 37 | 34 | 37 | TLE | |
p02678 | Python | Runtime Error | import heapq
def dijkstra_heap(s):
d = [float("inf")] * n
prev = [float("inf")] * n
d[s] = 0
edgelist = [[d[s], s]]
heapq.heapify(edgelist)
while edgelist:
dis, v = heapq.heappop(edgelist)
if d[v] < dis:
continue
for e in edge[v]:
if d[e] > dis... | import heapq
def dijkstra_heap(s):
d = [float("inf")] * n
prev = [float("inf")] * n
d[s] = 0
edgelist = [[d[s], s]]
heapq.heapify(edgelist)
while edgelist:
dis, v = heapq.heappop(edgelist)
if d[v] < dis:
continue
for e in edge[v]:
if d[e] > dis... | replace | 25 | 26 | 25 | 26 | 0 | |
p02678 | Python | Runtime Error | from collections import deque
n, m = map(int, input().split())
to = [[] for _ in range(n + 1)]
for i in range(n):
a, b = map(int, input().split())
to[a].append(b)
to[b].append(a)
q = deque([1])
dist = [-1] * (n + 1)
# print(to)
while q:
v = q.popleft()
for u in to[v]:
if dist[u] != -1:
... | from collections import deque
n, m = map(int, input().split())
to = [[] for _ in range(n + 1)]
for i in range(m):
a, b = map(int, input().split())
to[a].append(b)
to[b].append(a)
q = deque([1])
dist = [-1] * (n + 1)
# print(to)
while q:
v = q.popleft()
for u in to[v]:
if dist[u] != -1:
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02678 | Python | Time Limit Exceeded | def solve(string):
from collections import deque
n, m, *ab = map(int, string.split())
p = [[] for _ in range(n)]
for a, b in zip(*[iter(ab)] * 2):
p[a - 1].append(b - 1)
p[b - 1].append(a - 1)
s, ans, d = deque([0]), [0] * n, [0] + [n] * (n - 1)
while s:
c = s.popleft()
... | def solve(string):
from collections import deque
n, m, *ab = map(int, string.split())
p = [[] for _ in range(n)]
for a, b in zip(*[iter(ab)] * 2):
p[a - 1].append(b - 1)
p[b - 1].append(a - 1)
s, ans, d = deque([0]), [0] * n, [0] + [n] * (n - 1)
while s:
c = s.popleft()
... | replace | 15 | 17 | 15 | 16 | TLE | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
struct Graph {
struct Edge {
int from;
int to;
lint cost;
};
struct Node {
Node() : par(-1), done(false), dist(INF) {}
int index;
int par;
bool done;
lint dist;
vector<Edge> edge;
};
int n;
vector... | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
struct Graph {
struct Edge {
int from;
int to;
lint cost;
};
struct Node {
Node() : par(-1), done(false), dist(INF) {}
int index;
int par;
bool done;
lint dist;
vector<Edge> edge;
};
int n;
vector... | replace | 126 | 128 | 126 | 127 | TLE | |
p02678 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
vector<vector<int>> to;
int main() {
int n, m;
cin >> n >> m;
to = vector<vector<int>>(n);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a-... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
vector<vector<int>> to;
int main() {
int n, m;
cin >> n >> m;
to = vector<vector<int>>(n);
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a-... | insert | 43 | 43 | 43 | 44 | TLE | |
p02678 | C++ | Runtime Error | /*
Jai Shree Krishna !!
Radhe Radhe !!
उद्यमेन हि सिद्ध्यन्ति कार्याणि न मनोरथैः। नहि सुप्तस्य सिंहस्य मुखे प्रविशन्ति
मृगाः।।
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
#define loop(i, ... | /*
Jai Shree Krishna !!
Radhe Radhe !!
उद्यमेन हि सिद्ध्यन्ति कार्याणि न मनोरथैः। नहि सुप्तस्य सिंहस्य मुखे प्रविशन्ति
मृगाः।।
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
#define loop(i, ... | replace | 94 | 96 | 94 | 96 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long ll;
typedef vector<vector<int>> Graph;
Graph G(100010);
vector<int> par(100010);
int room[10010] = {};
void init(int N) { // 最初は全てが根であるとして初期化
for (int i = 0; i < N; i++)
par[i] = i;
}
int root(int... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long ll;
typedef vector<vector<int>> Graph;
Graph G(100010);
vector<int> par(100010);
int room[100010] = {};
void init(int N) { // 最初は全てが根であるとして初期化
for (int i = 0; i < N; i++)
par[i] = i;
}
int root(in... | replace | 7 | 8 | 7 | 8 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define INF 1e+9
#define MAX_V 10
struct edge {
int to;
int cost;
};
// <最短距離, 頂点の番号>
using P = pair<int, int>;
int V;
vector<edge> G[MAX_V];
int y[MAX_V];
int d[MAX_V];
void dijkstra(int s) {
priority_queue<P... | #include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define INF 1e+9
#define MAX_V 100000
struct edge {
int to;
int cost;
};
// <最短距離, 頂点の番号>
using P = pair<int, int>;
int V;
vector<edge> G[MAX_V];
int y[MAX_V];
int d[MAX_V];
void dijkstra(int s) {
priority_que... | replace | 6 | 7 | 6 | 7 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define TRAV(i, a) for (auto &i : (a))
#define SZ(x) ((int)(x).size())
#define PR std::pair
#define MP std::make_pair
#define X first
#define Y second
typedef long long ll;
typedef std::pair<int... | #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define TRAV(i, a) for (auto &i : (a))
#define SZ(x) ((int)(x).size())
#define PR std::pair
#define MP std::make_pair
#define X first
#define Y second
typedef long long ll;
typedef std::pair<int... | replace | 21 | 22 | 21 | 22 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M;
cin >> N >> M;
vector<vector<int>> G(M);
i... | #include <bits/stdc++.h>
#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M;
cin >> N >> M;
vector<vector<int>> G(N);
i... | replace | 15 | 16 | 15 | 16 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
void search(vector<vector<int>> g, vector<int> &nxt, queue<int> &q) {
int tar = q.front();
q.pop();
for (int s : g[tar]) {
if (nxt[s] == -1) {
q.push(s);
nxt[s] = tar;
}
}
if (q.size() < 1)
return;
else
... | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
void search(vector<vector<int>> &g, vector<int> &nxt, queue<int> &q) {
int tar = q.front();
q.pop();
for (int s : g[tar]) {
if (nxt[s] == -1) {
q.push(s);
nxt[s] = tar;
}
}
if (q.size() < 1)
return;
else
... | replace | 5 | 6 | 5 | 6 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
using ll = long long;
int main() {
ll N, M;
cin >> N >> M;
vector<vector<ll>> G(M, vector<ll>(0));
rep(i, M) {
ll a, b;
cin >> a >> b;
--a;
--b;
G[a].push_back(b);
G[b].push_back(a);
}
q... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
using ll = long long;
int main() {
ll N, M;
cin >> N >> M;
vector<vector<ll>> G(N, vector<ll>(0));
rep(i, M) {
ll a, b;
cin >> a >> b;
--a;
--b;
G[a].push_back(b);
G[b].push_back(a);
}
q... | replace | 8 | 9 | 8 | 9 | 0 | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
typedef ... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
typedef ... | replace | 38 | 39 | 38 | 39 | 0 | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i... | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i... | replace | 55 | 56 | 55 | 56 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
long long int mod = (long long int)1000000007;
using namespace std;
int n;
const int full = 200006;
vector<int> adj[full];
bool vis[full];
int par[full];
int depth[full];
int ans[full];
void dfs(int i) {
queue<int> q;
q.push(1);
while (q.size() ... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
long long int mod = (long long int)1000000007;
using namespace std;
int n;
const int full = 200006;
vector<int> adj[full];
bool vis[full];
int par[full];
int depth[full];
int ans[full];
void dfs(int i) {
queue<int> q;
q.push(1);
while (q.size() ... | replace | 22 | 25 | 22 | 25 | TLE | |
p02678 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue... | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue... | replace | 61 | 62 | 61 | 62 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> room(m + 1);
vector<int> dist(n + 1, -1);
queue<int> que;
for (int i = 1; i <= m; i++) {
int a, b;
cin >> a >> b;
room[a].push_back(b);
room[b].push_back(a);
}
/... | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> room(m + 2);
vector<int> dist(n + 1, -1);
queue<int> que;
for (int i = 1; i <= m; i++) {
int a, b;
cin >> a >> b;
room[a].push_back(b);
room[b].push_back(a);
}
/... | replace | 7 | 8 | 7 | 8 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
/*
void showqueue(queue<int> q) {
cout << "queue: " ;
while (!q.empty()) {
cout << q.front() << " " ;
q.pop();
}
cout << endl;
return;
}
*/
int main() {
// input
int N, M;
cin >> N >> M;
vecto... | #include <bits/stdc++.h>
using namespace std;
/*
void showqueue(queue<int> q) {
cout << "queue: " ;
while (!q.empty()) {
cout << q.front() << " " ;
q.pop();
}
cout << endl;
return;
}
*/
int main() {
// input
int N, M;
cin >> N >> M;
vecto... | replace | 19 | 20 | 19 | 20 | 0 | |
p02678 | C++ | Time Limit Exceeded | // by Balloons
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#define mpr make_pair
#define debug() puts("okkkkkkkk")
#define rep(i, a, b) for (int(i) = (a); (i) <= (b); (i)++)
using namespace std;
typedef long long LL;
const int inf = 1e9;
const int m... | // by Balloons
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#define mpr make_pair
#define debug() puts("okkkkkkkk")
#define rep(i, a, b) for (int(i) = (a); (i) <= (b); (i)++)
using namespace std;
typedef long long LL;
const int inf = 1e9;
const int m... | replace | 26 | 27 | 26 | 27 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int INF = 1001001001;
const int MOD = 1000000007;
template <typename T> void print(const T &v);
const int V = 10000;
vector<P> G[V]; // pair<辺の距離, 行き先の頂点> (隣接リスト)
ll d... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int INF = 1001001001;
const int MOD = 1000000007;
template <typename T> void print(const T &v);
const int V = 100100;
vector<P> G[V]; // pair<辺の距離, 行き先の頂点> (隣接リスト)
ll ... | replace | 10 | 11 | 10 | 11 | 0 | |
p02678 | C++ | Runtime Error | #include <cstdint>
#include <iostream>
#include <queue>
#include <vector>
using std::cin;
using std::cout;
using std::vector;
using ll = long long;
using ull = unsigned long long;
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
ull n, m, a, b;
std::cin >> n >> m;
vector<ull> from(n);
ve... | #include <cstdint>
#include <iostream>
#include <queue>
#include <vector>
using std::cin;
using std::cout;
using std::vector;
using ll = long long;
using ull = unsigned long long;
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
ull n, m, a, b;
std::cin >> n >> m;
vector<ull> from(n);
ve... | replace | 20 | 21 | 20 | 21 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<... | replace | 175 | 179 | 175 | 178 | TLE | |
p02678 | C++ | Runtime Error | #include "bits/stdc++.h"
const double pi = 3.141592653589793;
#define YESNO(x) x ? printf("YES") : printf("NO")
#define YesNo(x) x ? printf("Yes") : printf("No")
#define rep(i, a, b) for (int(i) = (a); (i) < (b); ++(i))
#define scani(x) scanf("%d", &x)
#define scanll(x) scanf("%lld", &x)
#define printi(x) printf("%d",... | #include "bits/stdc++.h"
const double pi = 3.141592653589793;
#define YESNO(x) x ? printf("YES") : printf("NO")
#define YesNo(x) x ? printf("Yes") : printf("No")
#define rep(i, a, b) for (int(i) = (a); (i) < (b); ++(i))
#define scani(x) scanf("%d", &x)
#define scanll(x) scanf("%lld", &x)
#define printi(x) printf("%d",... | replace | 23 | 25 | 23 | 25 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(v) (v).size()
#define all(v) (v).begin(), (v).end()
using namespace std;
template <typename T> T Max(T X, T Y) { return X > Y ? X : Y; }
template <typename T> T Min(T X, T Y) { return X < Y ? X : Y; }
templa... | #include <bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(v) (v).size()
#define all(v) (v).begin(), (v).end()
using namespace std;
template <typename T> T Max(T X, T Y) { return X > Y ? X : Y; }
template <typename T> T Min(T X, T Y) { return X < Y ? X : Y; }
templa... | replace | 21 | 22 | 21 | 22 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main(void) {
int N, M, a, b;
cin >> N >> M;
Graph G(N);
// N;頂点 M;辺
for (int i = 0; i < N; i++) {
cin >> a >> b;
a--;
b--;
G[a].push_back(b);
G[b].push_back(a);
}
vector<int> dist(N, -1);
vector<... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main(void) {
int N, M, a, b;
cin >> N >> M;
Graph G(N);
// N;頂点 M;辺
for (int i = 0; i < M; i++) {
cin >> a >> b;
a--;
b--;
G[a].push_back(b);
G[b].push_back(a);
}
vector<int> dist(N, -1);
vector<... | replace | 11 | 12 | 11 | 12 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<vector<int>> mymap(100001, vector<int>());
int res[100001];
queue<pair<int, int>> q;
void dfs(int from, int i) {
if (res[i] != 0)
return;
res[i] = from;
if (i == 1)
res[i] = 0;
for (auto &room : mymap[i]) {
if (res[room] ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<vector<int>> mymap(100001, vector<int>());
int res[100001];
queue<pair<int, int>> q;
void dfs(int from, int i) {
if (res[i] != 0)
return;
res[i] = from;
for (auto &room : mymap[i]) {
if (res[room] != 0)
continue;
q.pu... | delete | 13 | 15 | 13 | 13 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define m1(x) memset(x, -1, sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793;
int main(... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define m1(x) memset(x, -1, sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793;
int main(... | replace | 14 | 16 | 14 | 16 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using stkll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
tem... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using stkll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
tem... | replace | 73 | 74 | 73 | 74 | 0 | |
p02678 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <string>
#include <vector>
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <string>
#include <vector>
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | insert | 106 | 106 | 106 | 107 | TLE | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #define int long long
using P = pair<int, int>;
#define LOG(variable) cout << #variable ":\t" << (variable) << endl
#define LOGCON(i, container) \
for (int(i) = 0; (i) < (container).size(); ++(i)... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #define int long long
using P = pair<int, int>;
#define LOG(variable) cout << #variable ":\t" << (variable) << endl
#define LOGCON(i, container) \
for (int(i) = 0; (i) < (container).size(); ++(i)... | replace | 34 | 35 | 34 | 35 | 0 | |
p02678 | C++ | Time Limit Exceeded | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YN(x) cout << (bool x ? "Yes" : "No") << endl;
#define out(s) cout <<... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YN(x) cout << (bool x ? "Yes" : "No") << endl;
#define out(s) cout <<... | replace | 19 | 20 | 19 | 20 | TLE | |
p02678 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define REP(i, n) for (decltype(n) i = 0; i < (n); ++i)
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, M;
cin >> N >> M;
vector<vector<int>> adj(N);
REP(i, N) {... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define REP(i, n) for (decltype(n) i = 0; i < (n); ++i)
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, M;
cin >> N >> M;
vector<vector<int>> adj(N);
REP(i, N) {... | replace | 30 | 31 | 30 | 31 | TLE | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define inf 0x3f3f3f3f
double const pi = acos(double(-1));
const int maxn = 2e5 + 100;
using namespace std;
typedef long long ll;
struct node {
ll to;
ll next;
} edge[maxn + 5];
ll n, m, ans;
ll h... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define inf 0x3f3f3f3f
double const pi = acos(double(-1));
const int maxn = 4e5 + 100;
using namespace std;
typedef long long ll;
struct node {
ll to;
ll next;
} edge[maxn + 5];
ll n, m, ans;
ll h... | replace | 8 | 9 | 8 | 9 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ris return *this
#define tmplt template <class T
#define dbgo debug &operator<<
tmplt > struct rge {
T b, e;
};
tmplt > rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
tmplt > dbgo(T x) {
cerr << bool... | #include <bits/stdc++.h>
using namespace std;
#define ris return *this
#define tmplt template <class T
#define dbgo debug &operator<<
tmplt > struct rge {
T b, e;
};
tmplt > rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
tmplt > dbgo(T x) {
cerr << bool... | replace | 48 | 49 | 48 | 49 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pi 3.1415
#define ll long long
#define pii pair<ll, ll>
#define debug(a) cout << a << '\n'
#define maxn 50009
#define MOD 1000000007
#define rep(i, a, b) for (ll i = a; i < (b); ++i)
using namespace std;
const ll INF = 1e15 + 9;
ll n, m;
vector<pii> adj[maxn];
ll dis[maxn];
ll pai[maxn]... | #include <bits/stdc++.h>
#define pi 3.1415
#define ll long long
#define pii pair<ll, ll>
#define debug(a) cout << a << '\n'
#define maxn 200009
#define MOD 1000000007
#define rep(i, a, b) for (ll i = a; i < (b); ++i)
using namespace std;
const ll INF = 1e15 + 9;
ll n, m;
vector<pii> adj[maxn];
ll dis[maxn];
ll pai[maxn... | replace | 5 | 6 | 5 | 6 | 0 | |
p02678 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
void _cin() {}
template <class Head, class... Tail> void _cin(Head &&head, Tail &&...tail) {
cin >> head;
_cin(forward<Tail>(tail)...... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = long long;
void _cin() {}
template <class Head, class... Tail> void _cin(Head &&head, Tail &&...tail) {
cin >> head;
_cin(forward<Tail>(tail)...... | replace | 99 | 100 | 99 | 100 | 0 | |
p02678 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (n); ++i)
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a =... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (n); ++i)
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a =... | replace | 52 | 53 | 52 | 53 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.