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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#define ff first
#define endl "\n"
#define ss second
#define li list<int>
#define vi vector<int>
#define ll long long int
#define pii pair<int, int>
#define vii vector<pair<int, int>>
#define mp ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#define ff first
#define endl "\n"
#define ss second
#define li list<int>
#define vi vector<int>
#define ll long long int
#define pii pair<int, int>
#define vii vector<pair<int, int>>
#define mp ... | replace | 34 | 35 | 34 | 35 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
#define taskname ""
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#defin... | #include <bits/stdc++.h>
#define taskname ""
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#defin... | replace | 24 | 25 | 24 | 25 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <climits>
#include <fstream>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
typedef vector<vector<int>> matrix;
int N, M;
int solve_rec(matrix &G, int u, vector<int> &DP) {
if (DP[u] != -1)
return DP[u];
int massimo = 0;
for (int i = 0; i < G[u].size()... | #include <climits>
#include <fstream>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
typedef vector<vector<int>> matrix;
int N, M;
int solve_rec(matrix &G, int u, vector<int> &DP) {
if (DP[u] != -1)
return DP[u];
int massimo = 0;
for (int i = 0; i < G[u].size()... | insert | 19 | 19 | 19 | 20 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <cmath>
#include <iostream>
#include <unistd.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int n, m;
vector<vector<int>> G;
vector<vector<int>> invG;
vector<int> memo;
int search(int v) {
if (invG[v].size() == 0) {
memo[v] = 0;
} else ... | #include <cmath>
#include <iostream>
#include <unistd.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int n, m;
vector<vector<int>> G;
vector<vector<int>> invG;
vector<int> memo;
int search(int v) {
if (invG[v].size() == 0) {
memo[v] = 0;
} else ... | replace | 17 | 18 | 17 | 24 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 5;
template <typename T> void min_self(T &a, T b) { a = min(a, b); }
template <typename T> void max_self(T &a, T b) { a = max(a, b); }
const int Nax = 1e5 + 5;
vector<int> edges[Nax];
bool visited[Nax];
int dist[Nax];
int i... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 5;
template <typename T> void min_self(T &a, T b) { a = min(a, b); }
template <typename T> void max_self(T &a, T b) { a = max(a, b); }
const int Nax = 1e5 + 5;
vector<int> edges[Nax];
bool visited[Nax];
int dist[Nax];
int i... | replace | 25 | 26 | 25 | 28 | TLE | |
p03166 | C++ | Time Limit Exceeded | // @ /\/\ BESH //
#include <bits/stdc++.h>
#define inp_out_work \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define testCa... | // @ /\/\ BESH //
#include <bits/stdc++.h>
#define inp_out_work \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define testCa... | replace | 32 | 33 | 32 | 34 | TLE | |
p03166 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define ll long long
vector<int> dp(100001);
int n, m, x, y;
int vis[100001] = {0};
vector<int> g[100001];
int solve(int vertex) {
vis[vertex] = 1;
dp[vertex] = 0;
for (int child : g[vertex]) {
if (!vis[child]) {
solve(child);
}
dp[vertex] = max(dp[v... | #include "bits/stdc++.h"
using namespace std;
#define ll long long
vector<int> dp(100001);
int n, m, x, y;
int vis[100001] = {0};
vector<int> g[100001];
void solve(int vertex) {
vis[vertex] = 1;
dp[vertex] = 0;
for (int child : g[vertex]) {
if (!vis[child]) {
solve(child);
}
dp[vertex] = max(dp[... | replace | 7 | 8 | 7 | 8 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x).begin(), (x).end()
#define int long long
#define fr first
#def... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x).begin(), (x).end()
#define int long long
#define fr first
#def... | insert | 42 | 42 | 42 | 43 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <cstdio>
using namespace std;
#define ll long long
#define PB push_back
#define ld long double
#define ff first
#define ss second
#define st(v) (v).begin(), (v).end()
#define pr pair<int, int>
const int N = 505, M = N, inf = (int)1e9;
const ll mod = 1e9 + 7;
int fastAbs(int n) { return... | #include <bits/stdc++.h>
#include <cstdio>
using namespace std;
#define ll long long
#define PB push_back
#define ld long double
#define ff first
#define ss second
#define st(v) (v).begin(), (v).end()
#define pr pair<int, int>
const int N = 1e5 + 4, M = N, inf = (int)1e9;
const ll mod = 1e9 + 7;
int fastAbs(int n) { re... | replace | 10 | 11 | 10 | 11 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
#define ll long long
const int MAX = 1e5 + 7;
vector<int> graph[MAX];
bool vis[MAX];
int dp[MAX];
int dfs(int s) {
if (vis[s])
return dp[s];
for (int i = 0; i < graph[s].size(); ++i) {
int t = graph[s][i];
dp[s] = max(dp[s], dfs(t) + 1);
... | #include <iostream>
#include <vector>
using namespace std;
#define ll long long
const int MAX = 1e5 + 7;
vector<int> graph[MAX];
bool vis[MAX];
int dp[MAX];
int dfs(int s) {
if (vis[s])
return dp[s];
vis[s] = true;
for (int i = 0; i < graph[s].size(); ++i) {
int t = graph[s][i];
dp[s] = max(dp[s]... | insert | 16 | 16 | 16 | 17 | TLE | |
p03166 | C++ | Time Limit Exceeded |
#include <bits/stdc++.h>
#include <dirent.h>
#include <stdlib.h>
using namespace std;
#define sp << " " <<
typedef vector<int> vi;
typedef vector<long int> vli;
typedef vector<long long int> vlli;
typedef long int li;
typedef long long int lli;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<lli, lli>> vplli;
... |
#include <bits/stdc++.h>
#include <dirent.h>
#include <stdlib.h>
using namespace std;
#define sp << " " <<
typedef vector<int> vi;
typedef vector<long int> vli;
typedef vector<long long int> vlli;
typedef long int li;
typedef long long int lli;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<lli, lli>> vplli;
... | replace | 15 | 16 | 15 | 16 | TLE | |
p03166 | C++ | Runtime Error | // Author:: MUKUL KUMAR RAI
// Institution:: Jalpaiguri Government Engineering College
// If you are not doing well now just stick to it and learn new things one day
// you will be... Compete with yourself
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define fi first
#de... | // Author:: MUKUL KUMAR RAI
// Institution:: Jalpaiguri Government Engineering College
// If you are not doing well now just stick to it and learn new things one day
// you will be... Compete with yourself
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define fi first
#de... | replace | 117 | 121 | 117 | 121 | -11 | |
p03166 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
#define inp(X) cin >> X
#define out(X) cout << X << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, f, n) for (int i = f; i < n; i++)
#define MAX(A) *ma... | #include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
#define inp(X) cin >> X
#define out(X) cout << X << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, f, n) for (int i = f; i < n; i++)
#define MAX(A) *ma... | replace | 52 | 53 | 52 | 53 | -11 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> a[100002];
int f[100002];
int vis[100002];
int res = 0;
int cal(int u) {
vis[u] = 1;
for (int i = 0; i < a[u].size(); i++) {
if (vis[a[u][i]])
continue;
f[u] = max(f[u], cal(a[u][i]) + 1);
vis[a[u][i]] = 0;
}
res = max(res, f... | #include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> a[100002];
int f[100002];
int vis[100002];
int res = 0;
int cal(int u) {
if (f[u] != 0)
return f[u];
vis[u] = 1;
for (int i = 0; i < a[u].size(); i++) {
if (vis[a[u][i]])
continue;
f[u] = max(f[u], cal(a[u][i]) + 1);
vis[a[... | insert | 9 | 9 | 9 | 11 | TLE | |
p03166 | C++ | Runtime Error | /*-------------------------------"ANJAN AGARWALA"-----------------------------
_/_/_/_/ _/_/ _/ _/_/_/_/ _/_/_/_/ _/_/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
_/_/_/_/ _/ _/ _/ _/ _/_/_/_/ _/ _/ _/
_/ _/ _/ _/_/ _/ _/... | /*-------------------------------"ANJAN AGARWALA"-----------------------------
_/_/_/_/ _/_/ _/ _/_/_/_/ _/_/_/_/ _/_/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
_/_/_/_/ _/ _/ _/ _/ _/_/_/_/ _/ _/ _/
_/ _/ _/ _/_/ _/ _/... | replace | 89 | 93 | 89 | 93 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
vector<int> v[100001];
int level[100001];
bool visited[100001];
void dfs(int u) {
visited[u] = true;
for (int i = 0; i < v[u].size(); i++) {
level[v[u][i]] = max(level[v[u][i]], level[u] + 1);
dfs(v[u][i]);
}
}
int main() {
int n, m;
cin >> n >> m;
for (... | #include <bits/stdc++.h>
using namespace std;
vector<int> v[100001];
int level[100001];
bool visited[100001];
void dfs(int u) {
visited[u] = true;
for (int i = 0; i < v[u].size(); i++) {
if (!visited[v[u][i]])
dfs(v[u][i]);
level[u] = max(level[v[u][i]] + 1, level[u]);
}
}
int main() {
int n, m;
... | replace | 8 | 10 | 8 | 11 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#define ios \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#define ios \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | replace | 12 | 13 | 12 | 13 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001
#define all(c) c.begin(), c.end()
#define mp(x, y) make_pair(x, y)
#define mem(a... | #include <bits/stdc++.h>
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001
#define all(c) c.begin(), c.end()
#define mp(x, y) make_pair(x, y)
#define mem(a... | insert | 37 | 37 | 37 | 39 | TLE | |
p03166 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
int N, M;
int dp[100010];
vector<int> G[100010];
int rec(int v) {
if (dp[v] != -1)
return dp[v];
int res = 0;
for (int u : G[v]) {
res = max(res, rec(u) + 1);
}
return dp[v] = res;
}
int main() {
cin >> N >> M;
for (int i = 0; i < N; i++... | #include <iostream>
#include <vector>
using namespace std;
int N, M;
int dp[100010];
vector<int> G[100010];
int rec(int v) {
if (dp[v] != -1)
return dp[v];
int res = 0;
for (int u : G[v]) {
res = max(res, rec(u) + 1);
}
return dp[v] = res;
}
int main() {
cin >> N >> M;
for (int i = 0; i < M; i++... | replace | 19 | 20 | 19 | 20 | 0 | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll d[10005];
using Graph = vector<vector<ll>>;
vector<ll> topological_sort(const Graph &G, vector<ll> &indeg, ll V) {
vector<ll> sorted;
queue<ll> que;
for (int i = 0; i < V; i++)
if (indeg[i] == 0)
que.push(i);
while (!que.empty()) {... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll d[100005];
using Graph = vector<vector<ll>>;
vector<ll> topological_sort(const Graph &G, vector<ll> &indeg, ll V) {
vector<ll> sorted;
queue<ll> que;
for (int i = 0; i < V; i++)
if (indeg[i] == 0)
que.push(i);
while (!que.empty()) ... | replace | 3 | 4 | 3 | 4 | 0 | |
p03166 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long int lint;
typedef long long int llint;
#define INF 1073741824
#define LINF 4611686018000000000
// Graph
... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long int lint;
typedef long long int llint;
#define INF 1073741824
#define LINF 4611686018000000000
// Graph
... | replace | 124 | 125 | 124 | 125 | -11 | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ini(arr, val) memset(arr, (val), sizeof(arr))
#define loop(i, n) for (ll i = 0; i < n; i++)
#define loop1(i, n) for (ll i = 1; i <= n; i++)
#define all(a) (a).begin(), (a).end()
#define exist(s, e) (s.find(e) != s.end())
#define dbg(x) cout <... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ini(arr, val) memset(arr, (val), sizeof(arr))
#define loop(i, n) for (ll i = 0; i < n; i++)
#define loop1(i, n) for (ll i = 1; i <= n; i++)
#define all(a) (a).begin(), (a).end()
#define exist(s, e) (s.find(e) != s.end())
#define dbg(x) cout <... | replace | 97 | 98 | 97 | 98 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03166 | C++ | Runtime Error | /*
*
* I am o0o0oo00.
*
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define p7 1000000007
#define p9 998244353
#define pb push_back
#define ff first
#define ss second
#define vll ve... | /*
*
* I am o0o0oo00.
*
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define p7 1000000007
#define p9 998244353
#define pb push_back
#define ff first
#define ss second
#define vll ve... | replace | 95 | 96 | 95 | 96 | -11 | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define F(i, a, n) for (int i = a; i < n; i++)
#define INF 1000000007
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a,... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define F(i, a, n) for (int i = a; i < n; i++)
#define INF 1000000007
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a,... | insert | 41 | 41 | 41 | 43 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
};
} fast_ios_;
#define FOR(i, begin, end) ... | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
fast_ios() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(20);
};
} fast_ios_;
#define FOR(i, begin, end) ... | insert | 119 | 119 | 119 | 121 | TLE | |
p03166 | C++ | Time Limit Exceeded | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#in... | #define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#in... | replace | 49 | 50 | 49 | 51 | TLE | |
p03166 | C++ | Time Limit Exceeded | // #include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <vector>
#define ii int64_t
#define PI 3.... | // #include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <vector>
#define ii int64_t
#define PI 3.... | insert | 45 | 45 | 45 | 46 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int mxN = 1e5 + 2;
int n, m, visited[mxN], dp[mxN];
vector<int> adj[mxN], radj[mxN], topo;
void dfs(int node) {
visited[node] = true;
for (auto &v : adj[node]) {
if (!visited[v]) {
dfs(v);
}
}
topo.push_back(node);
}
int main() {
cin >> n >>... | #include <bits/stdc++.h>
using namespace std;
const int mxN = 1e5 + 2;
int n, m, visited[mxN], dp[mxN];
vector<int> adj[mxN], radj[mxN], topo;
void dfs(int node) {
visited[node] = true;
for (auto &v : adj[node]) {
if (!visited[v]) {
dfs(v);
}
}
topo.push_back(node);
}
int main() {
cin >> n >>... | replace | 27 | 28 | 27 | 31 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>... | insert | 39 | 39 | 39 | 40 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<int> adj[100010];
vector<int> ts; /// topological sort
bool vis[100010];
void dfs(int u) {
vis[u] = true;
for (auto v : adj[u]) {
if (vis[v])
continue;
dfs(v);
}
ts.push_back(u);
}
int dp[10010]; /// dp table
int main() {
ios_base::sync... | #include <bits/stdc++.h>
using namespace std;
vector<int> adj[100010];
vector<int> ts; /// topological sort
bool vis[100010];
void dfs(int u) {
vis[u] = true;
for (auto v : adj[u]) {
if (vis[v])
continue;
dfs(v);
}
ts.push_back(u);
}
int dp[100010]; /// dp table
int main() {
ios_base::syn... | replace | 20 | 21 | 20 | 21 | 0 | |
p03166 | C++ | Time Limit Exceeded | /**
* Kaiwen Zhou,
* CUHK
**/
#include <bits/stdc++.h>
using namespace std;
#define INS \
ios::sync_with_stdio(false); \
cin.tie(0)
typedef long long LINT;
#define INF 1000000000000
vector<int> dp... | /**
* Kaiwen Zhou,
* CUHK
**/
#include <bits/stdc++.h>
using namespace std;
#define INS \
ios::sync_with_stdio(false); \
cin.tie(0)
typedef long long LINT;
#define INF 1000000000000
vector<int> dp... | insert | 22 | 22 | 22 | 23 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int int64_t
using namespace std;
vector<int> adj[100001];
vector<int> val, vis;
int dfs(int u) {
vis[u] = 1;
int ans = 0;
for (auto it : adj[u]) {
if (vis[it]) {
ans = max(ans, 1 + val[it]);
}
ans = max(1 + dfs(it), ans);
}
val[u] = ans;
return val[u];
}... | #include <bits/stdc++.h>
#define int int64_t
using namespace std;
vector<int> adj[100001];
vector<int> val, vis;
int dfs(int u) {
vis[u] = 1;
int ans = 0;
for (auto it : adj[u]) {
if (vis[it]) {
ans = max(ans, 1 + val[it]);
continue;
}
ans = max(1 + dfs(it), ans);
}
val[u] = ans;
... | insert | 14 | 14 | 14 | 15 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<pair<ll, ll>> vpll;
typedef vec... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<pair<ll, ll>> vpll;
typedef vec... | insert | 60 | 60 | 60 | 62 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) \
for (__typeof__((s).begin()... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) \
for (__typeof__((s).begin()... | replace | 63 | 64 | 63 | 65 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm> // minmax, sort, swap
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <cstdio> // printf, scanf
#include <iomanip> // cout<<setprecision(n)
#include <iostream> // cin, cout, cerr, clog
#include <map> // key-value pa... | #include <algorithm> // minmax, sort, swap
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <cstdio> // printf, scanf
#include <iomanip> // cout<<setprecision(n)
#include <iostream> // cin, cout, cerr, clog
#include <map> // key-value pa... | replace | 25 | 27 | 25 | 28 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
void input() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
#define endl "\n"
#define ll long long int
#define vll vector<ll>
#define pb push_back
#define pll pair<ll, ll>
#define mp make_pair
#define ff first
#def... | #include <bits/stdc++.h>
using namespace std;
void input() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
#define endl "\n"
#define ll long long int
#define vll vector<ll>
#define pb push_back
#define pll pair<ll, ll>
#define mp make_pair
#define ff first
#def... | replace | 81 | 82 | 81 | 82 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
#define ar array
const int mxn = 1e5;
int n, m;
vector<int> adj[mxn];
ll d[mxn], indegree[mxn];
bool vis[mxn];
void bfs(int node) {
queue<int> q;
q.push(node);
vis[node] = true;
while (!q.empty()) {
int u = q.front();
q.pop();
... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
#define ar array
const int mxn = 1e5;
int n, m;
vector<int> adj[mxn];
ll d[mxn], indegree[mxn];
bool vis[mxn];
void bfs(int node) {
queue<int> q;
q.push(node);
vis[node] = true;
while (!q.empty()) {
int u = q.front();
q.pop();
... | replace | 50 | 51 | 50 | 51 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <chrono>
#include <cstring>
#include <iostream>
#include <random>
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) ... | #include <algorithm>
#include <chrono>
#include <cstring>
#include <iostream>
#include <random>
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) ... | replace | 37 | 38 | 37 | 38 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int solve(int cur, vector<int> *gr, vector<int> &dp) {
bool isLeaf = true;
int best = 0;
for (auto nbr : gr[cur]) {
isLeaf = false;
best = max(best, solve(nbr, gr, dp));
}
dp[cur] = (isLeaf) ? 0 : 1 + best;
return dp[cu... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int solve(int cur, vector<int> *gr, vector<int> &dp) {
if (dp[cur] != -1) {
return dp[cur];
}
bool isLeaf = true;
int best = 0;
for (auto nbr : gr[cur]) {
isLeaf = false;
best = max(best, solve(nbr, gr, dp));
}
dp... | insert | 6 | 6 | 6 | 9 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iostream>
// #include <algorithm>
// #include <iomanip>
#define ll long long
using namespace std;
const ll MOD = 1000000007;
const ll INF = (1LL << 62);
ll dp[100005];
map<ll, vector<ll>> m;
ll rec(ll v) {
if (dp[v] >= 0) {
return dp[v];
}
auto ite = m[v].begin();
... | #include <bits/stdc++.h>
#include <iostream>
// #include <algorithm>
// #include <iomanip>
#define ll long long
using namespace std;
const ll MOD = 1000000007;
const ll INF = (1LL << 62);
ll dp[100005];
map<ll, vector<ll>> m;
ll rec(ll v) {
if (dp[v] >= 0) {
return dp[v];
}
auto ite = m[v].begin();
... | insert | 30 | 30 | 30 | 32 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fast \
ios_base::sync_with_stdio(0); \
ci... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fast \
ios_base::sync_with_stdio(0); \
ci... | replace | 144 | 145 | 144 | 146 | TLE | |
p03166 | C++ | Runtime Error | // fahadmd16(IIEST Shibpur)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define db double
#define pll pair<ll, ll>
#define ALL(a) (a).begin(), (a).end()
#define endl "\n"
#... | // fahadmd16(IIEST Shibpur)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define db double
#define pll pair<ll, ll>
#define ALL(a) (a).begin(), (a).end()
#define endl "\n"
#... | replace | 137 | 141 | 137 | 138 | -11 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
//****************************************************
#define lp(var, start, end) for (ll var = start; var < end; ++var)
#define rlp(var, start, end) for (ll var = start; var >= end; var--)
#define pb push_back
#define mp... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
//****************************************************
#define lp(var, start, end) for (ll var = start; var < end; ++var)
#define rlp(var, start, end) for (ll var = start; var >= end; var--)
#define pb push_back
#define mp... | insert | 59 | 59 | 59 | 60 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <deque>
#include <iostream>
#include <vector>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;
uint lps(const vector<vector<uint>> &E, vector<int> &LP, const uint v) {
if (LP[v] >= 0)
return LP[v];
uint d = 0;
for (auto nv : E[v]) {
d = max(d,... | #include <algorithm>
#include <deque>
#include <iostream>
#include <vector>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;
uint lps(const vector<vector<uint>> &E, vector<int> &LP, const uint v) {
if (LP[v] >= 0)
return LP[v];
uint d = 0;
for (auto nv : E[v]) {
d = max(d,... | insert | 17 | 17 | 17 | 18 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
vector<vector<int>> graph;
vector<int> dp;
int dfs(int fr) {
int mx = 0;
if (dp[fr] != -1)
return dp[fr];
for (auto itr = graph[fr].begin(); itr != graph[fr].end(); itr++) {
int t ... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
vector<vector<int>> graph;
vector<int> dp;
int dfs(int fr) {
int mx = 0;
if (dp[fr] != -1)
return dp[fr];
for (auto itr = graph[fr].begin(); itr != graph[fr].end(); itr++) {
int t ... | replace | 19 | 20 | 19 | 20 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MAX_N 10005
int n, m, dp[MAX_N];
vector<int> adh[MAX_N];
int f_imp(int);
int f(int p) {
if (dp[p] == 0)
dp[p] = f_imp(p) + 1;
return dp[p] - 1;
}
int f_imp(int p) {
int rs = 0;
for (auto &i : adh[p])
rs = max(rs, f(i) + 1);
return rs;
}
int... | #include <bits/stdc++.h>
using namespace std;
#define MAX_N 100005
int n, m, dp[MAX_N];
vector<int> adh[MAX_N];
int f_imp(int);
int f(int p) {
if (dp[p] == 0)
dp[p] = f_imp(p) + 1;
return dp[p] - 1;
}
int f_imp(int p) {
int rs = 0;
for (auto &i : adh[p])
rs = max(rs, f(i) + 1);
return rs;
}
in... | replace | 4 | 5 | 4 | 5 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int d[100000];
int f(int x, vector<vector<int>> &v) {
if (d[x] != 0)
return d[x];
if (v[x].size() == 0)
return 0;
int ans = 0;
for (int a : v[x]) {
ans = max(ans, f(a, v) + 1);
}
return ans;
}
int main() {
int n, m;
cin >> n >> m;
vector<vect... | #include <bits/stdc++.h>
using namespace std;
int d[100000];
int f(int x, vector<vector<int>> &v) {
if (d[x] != 0)
return d[x];
if (v[x].size() == 0)
return 0;
int ans = 0;
for (int a : v[x]) {
ans = max(ans, f(a, v) + 1);
}
return d[x] = ans;
}
int main() {
int n, m;
cin >> n >> m;
vect... | replace | 13 | 14 | 13 | 14 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb emplace_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define FIO \
ios_base::sync_with_s... | #include <bits/stdc++.h>
using namespace std;
#define ld double
#define ll long long
#define pb emplace_back
#define mk make_pair
#define mod 1000000007
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define FIO \
ios_base::sync_with_s... | replace | 32 | 33 | 32 | 35 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define int long ... | #include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define int long ... | delete | 83 | 87 | 83 | 83 | -11 | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
vector<int> vis, dp;
void initialise(int n) {
vis.assign(n, 0);
dp.assign(n, 0);
}
int dfs(int i, vector<int> v[]) {
int max = 0;
vis[i] = 1;
for (int j = 0; j < (int)v[i].size(); j++) {
if (max < dfs(v[i][j], v)) {
max ... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
vector<int> vis, dp;
void initialise(int n) {
vis.assign(n, 0);
dp.assign(n, 0);
}
int dfs(int i, vector<int> v[]) {
int max = 0;
vis[i] = 1;
for (int j = 0; j < (int)v[i].size(); j++) {
if (!vis[v[i][j]]) {
if (max < df... | replace | 13 | 15 | 13 | 19 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Graph;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmi... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Graph;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmi... | replace | 31 | 32 | 31 | 32 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> tree[100001];
vector<int> emp[100001];
int dp[100001];
int gmx = 0;
int dfs(int ind) {
int mx = 0;
for (auto e : tree[ind]) {
mx = max(mx, dfs(e));
}
dp[ind] = mx + 1;
return mx + 1;
}
int main() {
cin >> n >> m;
for (int i = 0; i... | #include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> tree[100001];
vector<int> emp[100001];
int dp[100001];
int gmx = 0;
int dfs(int ind) {
int mx = 0;
if (dp[ind] != 0)
return dp[ind];
for (auto e : tree[ind]) {
mx = max(mx, dfs(e));
}
dp[ind] = mx + 1;
return mx + 1;
}
int main... | insert | 12 | 12 | 12 | 15 | TLE | |
p03166 | C++ | Time Limit Exceeded | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned ... | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned ... | replace | 66 | 67 | 66 | 67 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n, m;
vector<int> adj[100100];
vector<int> inc[100100];
bool vis[100100];
vector<int> ord;
void topo(int x) {
vis[x] = true;
for (auto i : adj[x]) {
topo(i);
}
ord.push_back(x);
}
int dp[100100];
int o = 0;
int main() {
io... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n, m;
vector<int> adj[100100];
vector<int> inc[100100];
bool vis[100100];
vector<int> ord;
void topo(int x) {
vis[x] = true;
for (auto i : adj[x]) {
if (vis[i])
continue;
topo(i);
}
ord.push_back(x);
}
int dp[10010... | insert | 12 | 12 | 12 | 14 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
void dfs(int i, vector<int> adj[], vector<bool> vis, vector<int> &dp) {
vis[i] = 1;
for (int j = 0; j < adj[i].size(); j++) {
if (!vis[adj[i][j]])
dfs(adj[i][j], adj, vis, dp);
dp[i] = max(dp[i], 1 + dp[adj[i][j]]);
}
}
int main() {
int n, m, x, y;
... | #include <bits/stdc++.h>
using namespace std;
void dfs(int i, vector<int> adj[], vector<bool> &vis, vector<int> &dp) {
vis[i] = 1;
for (int j = 0; j < adj[i].size(); j++) {
if (!vis[adj[i][j]])
dfs(adj[i][j], adj, vis, dp);
dp[i] = max(dp[i], 1 + dp[adj[i][j]]);
}
}
int main() {
int n, m, x, y;
... | replace | 3 | 4 | 3 | 4 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) // [a, b)
#define reprev(i, n) reprrev(i, 0, n)
typedef long long ll;
typedef unsigned long long ull;
template <class T>... | #include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) // [a, b)
#define reprev(i, n) reprrev(i, 0, n)
typedef long long ll;
typedef unsigned long long ull;
template <class T>... | replace | 63 | 64 | 63 | 64 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
vector<int> graph[100001];
int dp[100001];
int solve(int src) {
if (dp[src] != -1)
return dp[src];
bool leaf = true;
int best = 0;
for (int child : graph[src]) {
leaf = false;
best = max(best, solve(child));
}
... | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
vector<int> graph[100001];
int dp[100001];
int solve(int src) {
if (dp[src] != -1)
return dp[src];
bool leaf = true;
int best = 0;
for (int child : graph[src]) {
leaf = false;
best = max(best, solve(child));
}
... | replace | 19 | 20 | 19 | 20 | TLE | |
p03166 | C++ | Time Limit Exceeded | /****************************************************************************
Is this the real life? Is this just fantasy?
Caught in a landslide, no escape from reality
Open your eyes, look up to the skies and see
I'm just a poor boy, I need no sympathy
Because I'm easy come, easy go, little high, little low
Any way th... | /****************************************************************************
Is this the real life? Is this just fantasy?
Caught in a landslide, no escape from reality
Open your eyes, look up to the skies and see
I'm just a poor boy, I need no sympathy
Because I'm easy come, easy go, little high, little low
Any way th... | insert | 37 | 37 | 37 | 38 | TLE | |
p03166 | C++ | Time Limit Exceeded | #pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
typedef long int li;
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pt;
#define fi first
#define se second
#define dump(x) cout << #x << " = " << x << endl
#define fastIO ... | #pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
typedef long int li;
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pt;
#define fi first
#define se second
#define dump(x) cout << #x << " = " << x << endl
#define fastIO ... | insert | 22 | 22 | 22 | 24 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> x;
int n, m;
bool visited[100009];
int dp[100009];
int solve(int curr) {
if (dp[curr] != -1)
return dp[curr];
int temp = -1;
for (auto i : x[curr]) {
if (dp[i] != -1) {
temp = 1 + dp[i];
dp[curr] = max(dp[curr], temp);
} els... | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> x;
int n, m;
bool visited[100009];
int dp[100009];
int solve(int curr) {
if (dp[curr] != -1)
return dp[curr];
int temp = -1;
for (auto i : x[curr]) {
if (dp[i] != -1) {
temp = 1 + dp[i];
dp[curr] = max(dp[curr], temp);
} els... | replace | 24 | 25 | 24 | 25 | 0 | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int dp[10010];
int longest(vector<int> v[], int i) {
if (v[i].size() == 0)
return 0;
if (dp[i] >= 0)
return dp[i];
else {
for (auto e : v[i]) {
dp[i] = max(dp[i], 1 + longest(v, e));
}
return dp[i];
}
}
int main(... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int dp[100100];
int longest(vector<int> v[], int i) {
if (v[i].size() == 0)
return 0;
if (dp[i] >= 0)
return dp[i];
else {
for (auto e : v[i]) {
dp[i] = max(dp[i], 1 + longest(v, e));
}
return dp[i];
}
}
int main... | replace | 5 | 6 | 5 | 6 | 0 | |
p03166 | C++ | Time Limit Exceeded | /// Code By t_bone_289 (Tushar Singh)
/// An Immature Programmer.... I'm still developing !!
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pll pair<ll, ll>
#define fi first
#define se second
#define mp make... | /// Code By t_bone_289 (Tushar Singh)
/// An Immature Programmer.... I'm still developing !!
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pll pair<ll, ll>
#define fi first
#define se second
#define mp make... | insert | 58 | 58 | 58 | 59 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int dp[100001], n, m, a, b;
int solve(vector<vector<int>> &arr, int i) {
if (dp[i] != -1)
return dp[i];
for (int j = 0; j < arr[i].size(); j++) {
dp[i] = max(1 + solve(arr, arr[i][j]), dp[i]);
}
return dp[i];
}
int main() {
ios_base::sync_with_stdio(fa... | #include <bits/stdc++.h>
using namespace std;
int dp[100001], n, m, a, b;
int solve(vector<vector<int>> &arr, int i) {
if (dp[i] != -1)
return dp[i];
for (int j = 0; j < arr[i].size(); j++) {
dp[i] = max(1 + solve(arr, arr[i][j]), dp[i]);
}
return dp[i];
}
int main() {
ios_base::sync_with_stdio(fa... | delete | 33 | 39 | 33 | 33 | TLE | |
p03166 | C++ | Time Limit Exceeded | // #pragma GCC optimize ("O3")
// #pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const int NINF = -1 * INF;
const long long LLINF = 1ll << 60;
const long long LLNINF = -1 * LLINF;
template <class Ch, class Tr, class Container>
basic_ostream<Ch, Tr> &operator<<(basic... | // #pragma GCC optimize ("O3")
// #pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const int NINF = -1 * INF;
const long long LLINF = 1ll << 60;
const long long LLNINF = -1 * LLINF;
template <class Ch, class Tr, class Container>
basic_ostream<Ch, Tr> &operator<<(basic... | insert | 62 | 62 | 62 | 63 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define BIGINF (int)4e18 + 7
#define MOD7 1000000007
#define MOD9 1e9 + 9
#define INF (int)2e9 + 7
#define SCD(t) scanf("%d", &t)
#define SCLD(t) scanf("%ld", &t)
#define SCLLD(t) scanf("%lld", &t)
#define SCC(t) scanf("%c", &t)
#define SCS(t) scanf("%s", t)
#define SCF(t) ... | #include <bits/stdc++.h>
using namespace std;
#define BIGINF (int)4e18 + 7
#define MOD7 1000000007
#define MOD9 1e9 + 9
#define INF (int)2e9 + 7
#define SCD(t) scanf("%d", &t)
#define SCLD(t) scanf("%ld", &t)
#define SCLLD(t) scanf("%lld", &t)
#define SCC(t) scanf("%c", &t)
#define SCS(t) scanf("%s", t)
#define SCF(t) ... | replace | 47 | 48 | 47 | 48 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int dfs(const vector<vector<int>> &p, vector<int> &r, int n) {
if (r[n] != -1)... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int dfs(const vector<vector<int>> &p, vector<int> &r, int n) {
if (r[n] != -1)... | replace | 22 | 23 | 22 | 23 | TLE | |
p03166 | C++ | Runtime Error | /*
https://atcoder.jp/contests/dp/tasks/dp_g
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 10;
const int oo = 1e9 + 7;
vector<vector<int>> adj;
int n, m;
int f[N], ans = 0;
bool Visited[N];
void Init() {
cin >> n >> m;
for (int i = 0; i <= n; ++i) {
adj.push_back(vector<int>());
}
int u,... | /*
https://atcoder.jp/contests/dp/tasks/dp_g
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
const int oo = 1e9 + 7;
vector<vector<int>> adj;
int n, m;
int f[N], ans = 0;
bool Visited[N];
void Init() {
cin >> n >> m;
for (int i = 0; i <= n; ++i) {
adj.push_back(vector<int>());
}
i... | replace | 7 | 8 | 7 | 8 | 0 | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define ll long long int
#define ull unsigned long long int
#define fast \
ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define ll long long int
#define ull unsigned long long int
#define fast \
ios_base::sync_with_stdio(false); ... | replace | 12 | 15 | 12 | 15 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
long long N, W;
vector<vector<int>> G;
long long solve(long long *dp, long long v);
int main() {
cin >> N >> W;
G.assign(N, vector<int>());
// dp[v]: v を始点としたときの、G の有効パスの長さの最大値
long long dp[N];
for (int i = 0; i < N; i++) {
dp[i] = -1;
}
... | #include <iostream>
#include <vector>
using namespace std;
long long N, W;
vector<vector<int>> G;
long long solve(long long *dp, long long v);
int main() {
cin >> N >> W;
G.assign(N, vector<int>());
// dp[v]: v を始点としたときの、G の有効パスの長さの最大値
long long dp[N];
for (int i = 0; i < N; i++) {
dp[i] = -1;
}
... | insert | 43 | 43 | 43 | 47 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int MN = 100010;
int n, m;
int dp[MN];
bool used[MN];
vector<int> g[MN];
int dfs(int v) {
if (used[v])
return dp[v];
for (int i = 0; i < int(g[v].size()); i++) {
int u = g[v][i];
dp[v] = max(dp[v], dfs(u) + 1);
}
return dp[v];
}
int main() {
... | #include <bits/stdc++.h>
using namespace std;
const int MN = 100010;
int n, m;
int dp[MN];
bool used[MN];
vector<int> g[MN];
int dfs(int v) {
if (used[v])
return dp[v];
for (int i = 0; i < int(g[v].size()); i++) {
int u = g[v][i];
dp[v] = max(dp[v], dfs(u) + 1);
}
used[v] = true;
return dp[v];
... | insert | 17 | 17 | 17 | 18 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int N, M;
vector<vector<int>> adj;
vector<int> lp;
vector<bool> visited;
void dfs(const int vertex) {
for (const auto child : adj[vertex]) {
if (not visited[child]) {
dfs(child);
}
lp[vertex] = max(lp[vertex], lp[child] + 1);
}
}
int main() {
ios... | #include <bits/stdc++.h>
using namespace std;
int N, M;
vector<vector<int>> adj;
vector<int> lp;
vector<bool> visited;
void dfs(const int vertex) {
for (const auto child : adj[vertex]) {
if (not visited[child]) {
visited[child] = true;
dfs(child);
}
lp[vertex] = max(lp[vertex], lp[child] + ... | insert | 12 | 12 | 12 | 13 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define _u(i, a, b) for (int i = a; i <= b; ++i)
#define _d(i, a, b) for (int i = a; i >= b; --i)
#define endl "\n"
#define ii pair<int, int>
#define fi first
#define se second
#define ll long long
#define FIO() \
ios::sync_wit... | #include <bits/stdc++.h>
#define _u(i, a, b) for (int i = a; i <= b; ++i)
#define _d(i, a, b) for (int i = a; i >= b; --i)
#define endl "\n"
#define ii pair<int, int>
#define fi first
#define se second
#define ll long long
#define FIO() \
ios::sync_wit... | replace | 28 | 29 | 28 | 30 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
// var
int n, m, t1, t2, dp[100001], ans = 0;
vector<int> e[100001];
bool v[100001];
void dfs(int g) {
dp[g] = 1;
int am = 0;
for (int u : e[g]) {
if (!v[u])
dfs(u);
am = max(am, dp[u]);
}
dp[g] += am;
}
int main() {
cin >>... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
// var
int n, m, t1, t2, dp[100001], ans = 0;
vector<int> e[100001];
bool v[100001];
void dfs(int g) {
dp[g] = 1;
int am = 0;
v[g] = 1;
for (int u : e[g]) {
if (!v[u])
dfs(u);
am = max(am, dp[u]);
}
dp[g] += am;
}
int main(... | insert | 13 | 13 | 13 | 14 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ctype.h>
#define pb push_back
#define fst first
#define sec second
#define For(i, a, b) for (int i = a; i < b; i++)
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
#define fo(i, n) for (ll i = 0; i < n; i++)
#define endl "\n"
#define rev(i, n) for (l... | #include <bits/stdc++.h>
#include <ctype.h>
#define pb push_back
#define fst first
#define sec second
#define For(i, a, b) for (int i = a; i < b; i++)
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
#define fo(i, n) for (ll i = 0; i < n; i++)
#define endl "\n"
#define rev(i, n) for (l... | replace | 68 | 69 | 68 | 69 | -11 | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define V(i) vector<i>
#define rep(i, n) for (__typeof(n) i = 0; i < n; i++)
#define crep(i, N, n) for (__typeof(n) i = N; i < n; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define P(i, j) pair<i, j>
#define MP make_pair
#define MOD 10000000... | #include <bits/stdc++.h>
using namespace std;
#define V(i) vector<i>
#define rep(i, n) for (__typeof(n) i = 0; i < n; i++)
#define crep(i, N, n) for (__typeof(n) i = N; i < n; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define P(i, j) pair<i, j>
#define MP make_pair
#define MOD 10000000... | replace | 17 | 19 | 17 | 19 | -6 | terminate called after throwing an instance of 'std::length_error'
what(): cannot create std::vector larger than max_size()
|
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.t... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.t... | replace | 28 | 29 | 28 | 29 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int dp[100009];
#define pb push_back
int vis[100009];
vector<int> adj[100009];
int n;
int call(int u) {
if (adj[u].size() == 0)
return 0;
int mx = 1;
for (int i = 0; i < adj[u].size(); i++) {
int chi = adj[u][i];
int val = call(chi) + 1;
mx = max(val, ... | #include <bits/stdc++.h>
using namespace std;
int dp[100009];
#define pb push_back
int vis[100009];
vector<int> adj[100009];
int n;
int call(int u) {
if (adj[u].size() == 0)
return 0;
int mx = 1;
if (dp[u] != -1)
return dp[u];
for (int i = 0; i < adj[u].size(); i++) {
int chi = adj[u][i];
int va... | insert | 11 | 11 | 11 | 13 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define fir first
#define sec second
#define sz(s) (s).size();
#define pb push_back
#define get(n) scanf("%d", &n);
#define gets(s) ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define fir first
#define sec second
#define sz(s) (s).size();
#define pb push_back
#define get(n) scanf("%d", &n);
#define gets(s) ... | replace | 140 | 141 | 140 | 141 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, m;
vector<vector<int>> G;
vector<int> dp;
int rec(int now) {
if (dp[now] != -1)
return dp[now];
int ans = 0;
for (auto next : G[now]) {
ans = max(ans, rec(next) + 1);
}
return ans;
}
signed main() {
scanf("%d %d", &n, &m);
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, m;
vector<vector<int>> G;
vector<int> dp;
int rec(int now) {
if (dp[now] != -1)
return dp[now];
int ans = 0;
for (auto next : G[now]) {
ans = max(ans, rec(next) + 1);
}
return dp[now] = ans;
}
signed main() {
scanf("%d %d",... | replace | 14 | 15 | 14 | 15 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repd(i, n) for (int i = n - 1; i > -1; i--)
#define repran(i, a, b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define v(T) vector<T>
#define vv(T) vector<v(T)>
typedef long long ll;
typedef pair<i... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repd(i, n) for (int i = n - 1; i > -1; i--)
#define repran(i, a, b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define v(T) vector<T>
#define vv(T) vector<v(T)>
typedef long long ll;
typedef pair<i... | replace | 41 | 42 | 41 | 42 | TLE | |
p03166 | C++ | Time Limit Exceeded | // È¥°É£¡Æ¤¿¨Çð! °ÑAC´ø»ØÀ´£¡
// ¤Ø¡¡¡¡¡¡¡¡¡¡£¯|
// ¡¡¡¡/£Ü7¡¡¡¡¡¡ ¡Ï£ß/
// ¡¡ /¡¡©¦¡¡¡¡ £¯¡¡£¯ AC AC
// AC AC
// ©¦¡¡Z £ß,£¼¡¡£¯¡¡¡¡ /`©c AC AC AC
// AC ©¦¡¡¡¡¡¡¡¡¡¡©c¡¡¡¡ /¡¡¡¡¡µ AC
// AC AC AC
// ¡¡Y¡¡¡¡¡¡¡¡¡¡`¡¡ /¡¡¡¡/ / AC AC
// AC AC
// ¡¡Øé¡ñ¡¡.¡¡¡ñ¡¡¡¡¡´¡¡/¡¡/ AC... | // È¥°É£¡Æ¤¿¨Çð! °ÑAC´ø»ØÀ´£¡
// ¤Ø¡¡¡¡¡¡¡¡¡¡£¯|
// ¡¡¡¡/£Ü7¡¡¡¡¡¡ ¡Ï£ß/
// ¡¡ /¡¡©¦¡¡¡¡ £¯¡¡£¯ AC AC
// AC AC
// ©¦¡¡Z £ß,£¼¡¡£¯¡¡¡¡ /`©c AC AC AC
// AC ©¦¡¡¡¡¡¡¡¡¡¡©c¡¡¡¡ /¡¡¡¡¡µ AC
// AC AC AC
// ¡¡Y¡¡¡¡¡¡¡¡¡¡`¡¡ /¡¡¡¡/ / AC AC
// AC AC
// ¡¡Øé¡ñ¡¡.¡¡¡ñ¡¡¡¡¡´¡¡/¡¡/ AC... | insert | 75 | 75 | 75 | 77 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define ll long long int
#define N 100005
using namespace std;
string s1, s2;
template <typename T> void max_self(T &a, T b) {... | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define ll long long int
#define N 100005
using namespace std;
string s1, s2;
template <typename T> void max_self(T &a, T b) {... | replace | 27 | 28 | 27 | 29 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
u... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
u... | replace | 30 | 31 | 30 | 34 | TLE | |
p03166 | C++ | Time Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>... | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>... | insert | 38 | 38 | 38 | 40 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, x, y;
cin >> n >> m;
vector<int> g[n + 1];
int indegree[n + 1];
int dp[n + 1];
for (int i = 0; i <= n; i++) {
indegree[i] = 0;
dp[i] = 0;
}
// cout<<dp[2]<<endl;
for (int i = 0; i < m; i++) {
cin >> x >> y;
g[x].push... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, x, y;
cin >> n >> m;
vector<int> g[n + 1];
int indegree[n + 1];
int dp[n + 1];
for (int i = 0; i <= n; i++) {
indegree[i] = 0;
dp[i] = 0;
}
// cout<<dp[2]<<endl;
for (int i = 0; i < m; i++) {
cin >> x >> y;
g[x].push... | replace | 32 | 33 | 32 | 35 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const long long INF = 1e18 + 10;
const int inf = 1e9 + 10, dx[] = {0, 0, 1, -1, 1, -1, 1, -1},
dy[] = {1, -1, 0, 0, 1, 1, -1, -1};
ll MOD = 1e9 + 7;
ld eps = 1e-7, pi = acos(-1);
int n,... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const long long INF = 1e18 + 10;
const int inf = 1e9 + 10, dx[] = {0, 0, 1, -1, 1, -1, 1, -1},
dy[] = {1, -1, 0, 0, 1, 1, -1, -1};
ll MOD = 1e9 + 7;
ld eps = 1e-7, pi = acos(-1);
int n,... | replace | 23 | 24 | 23 | 24 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <cstdio>
#define N 100005
int n, m;
int vis[N];
int dp[N];
int head[N], nxt[N], to[N], tot;
void add(int x, int y) {
nxt[++tot] = head[x];
head[x] = tot;
to[tot] = y;
}
int DP(int u) {
if (vis[u])
return dp[u];
dp[u] = 0;
for (int e = head[u]; e; e = nxt[e]) {
int v = to[e];
int cur = D... | #include <cstdio>
#define N 100005
int n, m;
int vis[N];
int dp[N];
int head[N], nxt[N], to[N], tot;
void add(int x, int y) {
nxt[++tot] = head[x];
head[x] = tot;
to[tot] = y;
}
int DP(int u) {
if (vis[u])
return dp[u];
vis[u] = 1;
dp[u] = 0;
for (int e = head[u]; e; e = nxt[e]) {
int v = to[e];
... | insert | 14 | 14 | 14 | 15 | TLE | |
p03166 | C++ | Time Limit Exceeded | // Om Sree Sai Ram
#include "bits/stdc++.h"
using namespace std;
template <typename T> void max_self(T &a, T b) { a = max(a, b); }
vector<int> dp;
vector<int> vis;
int dfs(int id, vector<vector<int>> adj) {
// cout<<" called "<<id<<endl;
if (vis[id]) {
return dp[id];
}
for (int i = 0; i < adj[id].size()... | // Om Sree Sai Ram
#include "bits/stdc++.h"
using namespace std;
template <typename T> void max_self(T &a, T b) { a = max(a, b); }
vector<int> dp;
vector<int> vis;
int dfs(int id, vector<vector<int>> &adj) {
// cout<<" called "<<id<<endl;
if (vis[id]) {
return dp[id];
}
for (int i = 0; i < adj[id].size(... | replace | 9 | 10 | 9 | 10 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main() {
int n, m;
cin >> n >> m;
Graph g(n);
vector<int> dist(n);
vector<int> delta(n);
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
x--, y--;
delta[y]++;
g[x].push_back(y);
}
queue<int> ... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main() {
int n, m;
cin >> n >> m;
Graph g(n);
vector<int> dist(n);
vector<int> delta(n);
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
x--, y--;
delta[y]++;
g[x].push_back(y);
}
queue<int> ... | insert | 24 | 24 | 24 | 25 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
#include <vector>
#define MAXN 100500
using namespace std;
int n, m;
int dist[MAXN];
vector<int> g[MAXN];
bool was[MAXN];
int ans;
void dfs(int v) {
// cout << v << ' ';
was[v] = true;
for (int w : g[v]) {
dfs(w);
if (dist[v] < dist[w] + 1)
dist[v] = dist[w] + ... | #include <cstdio>
#include <iostream>
#include <vector>
#define MAXN 100500
using namespace std;
int n, m;
int dist[MAXN];
vector<int> g[MAXN];
bool was[MAXN];
int ans;
void dfs(int v) {
// cout << v << ' ';
was[v] = true;
for (int w : g[v]) {
if (!was[w])
dfs(w);
if (dist[v] < dist[w] + 1)
d... | replace | 15 | 16 | 15 | 17 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define N (int)1e5 + 5
#define f1 first
#define s2 second
#define INF 9999999
#define pb push_back
#define ll long long
#define ull unsigned long long;
#define all(a) a.begin(), a.end()
#define fri(a) freopen(a, "r", stdin);
#define fro(a) freopen(a, "w", stdout);
vector<... | #include <bits/stdc++.h>
using namespace std;
#define N (int)1e5 + 5
#define f1 first
#define s2 second
#define INF 9999999
#define pb push_back
#define ll long long
#define ull unsigned long long;
#define all(a) a.begin(), a.end()
#define fri(a) freopen(a, "r", stdin);
#define fro(a) freopen(a, "w", stdout);
vector<... | replace | 22 | 24 | 22 | 23 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define pb push_back
#define MOD 1000000007
#define inf 3e18
#define vi vector<int>
#define vld vector<ld>
#define pii pair<int, int>
#define mii map<int, int>
#define fi first
#define se second
#define fastIO ... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define pb push_back
#define MOD 1000000007
#define inf 3e18
#define vi vector<int>
#define vld vector<ld>
#define pii pair<int, int>
#define mii map<int, int>
#define fi first
#define se second
#define fastIO ... | replace | 49 | 51 | 49 | 53 | -6 | |
p03166 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
int const MAXN = 10000, MAXE = 10000;
int N, E;
std::vector<int> G[MAXN];
int L[MAXN];
int length(int v) {
if (L[v] >= 0)
return L[v];
int ret = 0;
for (auto it = G[v].begin(); it != G[v].end(); ++it) {
ret = std::max(ret, length(*it));
}
... | #include <algorithm>
#include <iostream>
#include <vector>
int const MAXN = 100000, MAXE = 100000;
int N, E;
std::vector<int> G[MAXN];
int L[MAXN];
int length(int v) {
if (L[v] >= 0)
return L[v];
int ret = 0;
for (auto it = G[v].begin(); it != G[v].end(); ++it) {
ret = std::max(ret, length(*it));
}... | replace | 4 | 5 | 4 | 5 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#defin... | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#defin... | insert | 29 | 29 | 29 | 31 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <stack>
#include <utility>
#include <vector>
#define ll long long int
using namespace std;
vector<int> v[100001];
bool vis[100001] = {false};
ll d[100001] = {0};
void dfs(int s) {
ll mx = 0;
for (int i = 0; i < v[s].size(); i++) {... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <stack>
#include <utility>
#include <vector>
#define ll long long int
using namespace std;
vector<int> v[100001];
bool vis[100001] = {false};
ll d[100001] = {0};
void dfs(int s) {
ll mx = 0;
vis[s] = true;
for (int i = 0; i < v[... | insert | 14 | 14 | 14 | 15 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int lim = 100010;
#define IOS() \
ios_base::sync_with_stdio(0); \
cin.tie(0);
typedef long long ll;
#define pb push_back
typedef p... | #include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int lim = 100010;
#define IOS() \
ios_base::sync_with_stdio(0); \
cin.tie(0);
typedef long long ll;
#define pb push_back
typedef p... | replace | 19 | 22 | 19 | 23 | TLE | |
p03166 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define MAX 100005
using namespace std;
vector<int> maps[MAX];
int memo[MAX];
int indegree[MAX] = {0};
// 从i节点到结束所能达到的最长路径
int dfs(int x) {
if (memo[x] != -1)
return memo[x];
int l = maps[x].size();
int res = 0;
for (int i = 0; i ... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define MAX 100005
using namespace std;
vector<int> maps[MAX];
int memo[MAX];
int indegree[MAX] = {0};
// 从i节点到结束所能达到的最长路径
int dfs(int x) {
if (memo[x] != -1)
return memo[x];
int l = maps[x].size();
int res = 0;
for (int i = 0; i ... | replace | 19 | 20 | 19 | 21 | TLE | |
p03166 | C++ | Runtime Error | #include <bits/stdc++.h>
#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 rrep(i, n) for (int i = ((int)(n)-1); i >= 0; (i)--)
#define rrep1(i, n) for (int i = ((int)(n)); i > 0; (i)--)
#define sz(c) ((int)(c).size())
#define all(x) (x).begin(), (x).end... | #include <bits/stdc++.h>
#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 rrep(i, n) for (int i = ((int)(n)-1); i >= 0; (i)--)
#define rrep1(i, n) for (int i = ((int)(n)); i > 0; (i)--)
#define sz(c) ((int)(c).size())
#define all(x) (x).begin(), (x).end... | replace | 16 | 17 | 16 | 17 | 0 | |
p03166 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for (ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rreps(i, e, n) for (ll i = (n)-1; i >= (e); i--)
#defin... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for (ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rreps(i, e, n) for (ll i = (n)-1; i >= (e); i--)
#defin... | insert | 24 | 24 | 24 | 25 | TLE | |
p03166 | C++ | Time Limit Exceeded | // #include <cmath>
// #include <cstdio>
// #include <vector>
// #include <map>
// #include <iostream>
// #include <algorithm>
// #include <set>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using vi = vector<int>;
using vb = vector<bool>;
usi... | // #include <cmath>
// #include <cstdio>
// #include <vector>
// #include <map>
// #include <iostream>
// #include <algorithm>
// #include <set>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using vi = vector<int>;
using vb = vector<bool>;
usi... | insert | 53 | 53 | 53 | 54 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.