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
p03044
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <tuple> #include <vector> using namesp...
#include <algorithm> #include <cctype> #include <cmath> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <tuple> #include <vector> using namesp...
replace
140
142
140
141
0
p03044
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define srep(i, s, t) for (int i = s; i < t; i++) #define drep(i, n...
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define srep(i, s, t) for (int i = s; i < t; i++) #define drep(i, n...
replace
39
40
39
40
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ln '\n' #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define FOR(i, a, b) for (int i = (a); i <= (int)(b); ++i) #define FORR(i, a, b) for (int i = (a); i >= (int)(b); --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector<int> VI; ...
#include <bits/stdc++.h> using namespace std; #define ln '\n' #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define FOR(i, a, b) for (int i = (a); i <= (int)(b); ++i) #define FORR(i, a, b) for (int i = (a); i >= (int)(b); --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector<int> VI; ...
replace
40
41
40
41
0
p03044
C++
Runtime Error
/* confirm 0LL and 1LL confirm cornercases such as 0 confirm times of cin < 10^6 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector<char>; using VecS = vector<string>; using VecVec ...
/* confirm 0LL and 1LL confirm cornercases such as 0 confirm times of cin < 10^6 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector<char>; using VecS = vector<string>; using VecVec ...
replace
72
73
72
73
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; int main(void) { int n; cin >> n; vector<int> color(n, -1); color[0] = 0; Graph g(n, vector<int>(n)); Graph cost(n, vector<int>(n)); for (int i = 0; i < n - 1; ++i) { int a, b, l; cin >> a >> b >> l; a--; b-...
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; int main(void) { int n; cin >> n; vector<int> color(n, -1); color[0] = 0; Graph g(n), cost(n); for (int i = 0; i < n - 1; ++i) { int a, b, l; cin >> a >> b >> l; a--; b--; g[a].push_back(b); g[b].push_...
replace
10
12
10
11
0
p03044
Python
Time Limit Exceeded
def solve(string): n, *uvw = map(int, string.split()) uvw = list(zip(uvw[::3], uvw[1::3], uvw[2::3])) whites = set([1]) blacks = set([]) while len(uvw) > 0: tmp = [] for i in range(len(uvw)): t = uvw.pop() if t[0] in whites: if t[2] % 2 == 0: ...
N = int(input()) p = [[] for _ in range(N + 1)] for _ in range(N - 1): u, v, w = map(int, input().split()) p[u].append((v, w)) p[v].append((u, w)) s = [(1, 0)] l = [-1] * N while s: a, w = s.pop() l[a - 1] = w % 2 for b, c in p[a]: if l[b - 1] == -1: s.append((b, w + c)) for ...
replace
0
43
0
16
TLE
p03044
Python
Runtime Error
N = int(input()) en = [[] for _ in range(N)] on = [[] for _ in range(N)] for i in range(N - 1): u, v, w = map(int, input().split()) if w % 2: on[u - 1].append(v - 1) on[v - 1].append(u - 1) else: en[u - 1].append(v - 1) en[v - 1].append(u - 1) color = [None] * N def dfs(no...
import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline N = int(input()) en = [[] for _ in range(N)] on = [[] for _ in range(N)] for i in range(N - 1): u, v, w = map(int, input().split()) if w % 2: on[u - 1].append(v - 1) on[v - 1].append(u - 1) else: en[u - 1].append(v ...
insert
0
0
0
5
0
p03044
Python
Runtime Error
N = int(input()) neighbors = [[] for _ in range(N + 1)] for _ in range(N - 1): u, v, w = map(int, input().split()) neighbors[u].append((v, w)) neighbors[v].append((u, w)) ans = [None for _ in range(N)] def dfs(v, p, c): ans[v - 1] = c for next_v, distance in neighbors[v]: if next_v == p:...
import sys sys.setrecursionlimit(200000) N = int(input()) neighbors = [[] for _ in range(N + 1)] for _ in range(N - 1): u, v, w = map(int, input().split()) neighbors[u].append((v, w)) neighbors[v].append((u, w)) ans = [None for _ in range(N)] def dfs(v, p, c): ans[v - 1] = c for next_v, distan...
insert
0
0
0
4
0
p03044
Python
Runtime Error
import sys from collections import defaultdict input = sys.stdin.readline N = int(input()) G = defaultdict(list) for _ in range(N - 1): u, v, w = map(int, input().split()) G[u - 1].append((v - 1, w)) G[v - 1].append((u - 1, w)) res = [None] * N def dfs(v, c): res[v] = c for u, w in G[v]: ...
import sys from collections import defaultdict sys.setrecursionlimit(100000) input = sys.stdin.readline N = int(input()) G = defaultdict(list) for _ in range(N - 1): u, v, w = map(int, input().split()) G[u - 1].append((v - 1, w)) G[v - 1].append((u - 1, w)) res = [None] * N def dfs(v, c): res[v] = c...
insert
3
3
3
4
0
p03044
Python
Runtime Error
def dfs(v): for u, w in e[v]: if c[u] != -1: continue c[u] = (c[v] + w) % 2 dfs(u) n = int(input()) e = tuple(set() for _ in range(n)) for _ in range(n - 1): u, v, w = map(int, input().split()) u -= 1 v -= 1 e[u].add((v, w)) e[v].add((u, w)) c = [-1] * n c[...
import sys sys.setrecursionlimit(10**7) def dfs(v): for u, w in e[v]: if c[u] != -1: continue c[u] = (c[v] + w) % 2 dfs(u) n = int(input()) e = tuple(set() for _ in range(n)) for _ in range(n - 1): u, v, w = map(int, input().split()) u -= 1 v -= 1 e[u].add((v...
insert
0
0
0
5
0
p03044
Python
Runtime Error
# -*- coding: utf-8 -*- n = int(input()) g = [[] for i in range(n)] c = [-1 for i in range(n)] for i in range(n - 1): u, v, w = map(int, input().split()) u -= 1 v -= 1 w = w % 2 g[u].append([v, w]) g[v].append([u, w]) def dfs(p, d): if c[p] == -1: c[p] = d for x, w in g[p]...
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(100100) n = int(input()) g = [[] for i in range(n)] c = [-1 for i in range(n)] for i in range(n - 1): u, v, w = map(int, input().split()) u -= 1 v -= 1 w = w % 2 g[u].append([v, w]) g[v].append([u, w]) def dfs(p, d): if c[p] == -1...
insert
1
1
1
5
0
p03044
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; typedef long long ll; struct edge { ll dst, cost; edge() {} edge(ll b, ll c) : dst(b), cost(c) {} }; vector<edge> tree[1005]; int ans[1005]; // 頂点 0 を 0(白) と決める. // 頂点 0 から dfs // v: 今いる頂点, p: v の...
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; typedef long long ll; struct edge { ll dst, cost; edge() {} edge(ll b, ll c) : dst(b), cost(c) {} }; vector<edge> tree[100005]; int ans[100005]; // 頂点 0 を 0(白) と決める. // 頂点 0 から dfs // v: 今いる頂点, p:...
replace
16
18
16
18
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const ll mod = 1e9 + 7; const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; using Edge = pair<int, ll>; using Graphy = vector<vector<Edge>>; int n; Graph...
#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; const int INF = 1e9; const ll mod = 1e9 + 7; const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; using Edge = pair<int, ll>; using Graphy = vector<vector<Edge>>; int n; Graph...
insert
30
30
30
31
-11
p03044
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef uint64_t u64; typedef int64_t s64; ty...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef uint64_t u64; typedef int64_t s64; ty...
replace
56
57
56
57
0
p03044
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; vector<pair<int, int>> N[10009]; int v[10009], n; void bfs(int k) { queue<int> Q; Q.push(k); while (!Q.empty()) { for (int j = 0; j < N[Q.front()].size(); j++) { int nei_v = N[Q.front()][j].first; in...
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; vector<pair<int, int>> N[100009]; int v[100009], n; void bfs(int k) { queue<int> Q; Q.push(k); while (!Q.empty()) { for (int j = 0; j < N[Q.front()].size(); j++) { int nei_v = N[Q.front()][j].first; ...
replace
6
8
6
8
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using Edge = pair<int, int>; using Graph = vector<vector<Edge>>; vector<int> result; int N; Graph G; void dfs(int v, int c) { result[v] = c; for (auto nx : G[v]) { if (result[nx.first] != -1) { continue; } if (nx.second % 2 == 0) { dfs(nx.firs...
#include <bits/stdc++.h> using namespace std; using Edge = pair<int, int>; using Graph = vector<vector<Edge>>; vector<int> result; int N; Graph G; void dfs(int v, int c) { result[v] = c; for (auto nx : G[v]) { if (result[nx.first] != -1) { continue; } if (nx.second % 2 == 0) { dfs(nx.firs...
insert
31
31
31
33
-11
p03044
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 using namespace std; constexpr int kMod = 1000000007; typedef long lo...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 using namespace std; constexpr int kMod = 1000000007; typedef long lo...
replace
44
45
44
45
0
p03044
C++
Runtime Error
// #include "bits/stdc++.h" #include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <tuple> #i...
// #include "bits/stdc++.h" #include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <stack> #include <tuple> #i...
replace
148
149
148
149
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < (ll)n; i++) #define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++) #define all(x) x.begin(), x.end() #define MOD 1000000007 // 1e9+7 using namespace std; typedef long long ll; typedef vector<int> vecint; typedef vector<double> vecd; type...
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < (ll)n; i++) #define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++) #define all(x) x.begin(), x.end() #define MOD 1000000007 // 1e9+7 using namespace std; typedef long long ll; typedef vector<int> vecint; typedef vector<double> vecd; type...
replace
26
27
26
27
-11
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int maxn = 100005; struct edge { int next, to, v; } e[maxn]; int h[maxn], col[maxn], n, cnt; void addedge(int x, int y, int z) { e[++cnt].next = h[x]; e[cnt].to = y; e[cnt].v = z; h[x] = cnt; } void dfs(int u, int fa, int now) { // cout<<u<<' '<<fa<<' '<<n...
#include <bits/stdc++.h> using namespace std; const int maxn = 200005; struct edge { int next, to, v; } e[maxn]; int h[maxn], col[maxn], n, cnt; void addedge(int x, int y, int z) { e[++cnt].next = h[x]; e[cnt].to = y; e[cnt].v = z; h[x] = cnt; } void dfs(int u, int fa, int now) { // cout<<u<<' '<<fa<<' '<<n...
replace
2
3
2
3
0
p03044
C++
Runtime Error
#include <algorithm> #include <array> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; u...
#include <algorithm> #include <array> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; u...
replace
20
21
20
21
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N; vector<vector<pair<int, int>>> G; vector<int> seen; void dfs(int a, int b) { seen[a] = b; for (auto x : G[a]) { int s, t; tie(s, t) = x; if (seen[s] == -1) { dfs(s, (b + t) % 2); } } } int main() { cin >> N; G.resize(N); seen.resiz...
#include <bits/stdc++.h> using namespace std; int N; vector<vector<pair<int, int>>> G; vector<int> seen; void dfs(int a, int b) { seen[a] = b; for (auto x : G[a]) { int s, t; tie(s, t) = x; if (seen[s] == -1) { dfs(s, (b + t) % 2); } } } int main() { cin >> N; G.resize(N); seen.resiz...
replace
24
25
24
25
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<vector<int>> G(n); vector<vector<int>> b(n); for (int i = 0; i < n - 1; i++) { int a, s, w; cin >> a >> s >> w; G[a].push_back(s); G[s].push_back(a); b[a].push_back(w); b[s].push_back(w); } vector<i...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<vector<int>> G(n); vector<vector<int>> b(n); for (int i = 0; i < n - 1; i++) { int a, s, w; cin >> a >> s >> w; a--; s--; G[a].push_back(s); G[s].push_back(a); b[a].push_back(w); b[s].push_back(...
insert
11
11
11
13
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<int> vi; typedef pair<int, int> pi; typedef pair<ll, ll> pl; #define rep(i, N) for (int i = 0; i < (int)N; i++) #define all(v) (v).begin(), (v).end() const int INF = 1001001001; struct Edge { int to, cost; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<int> vi; typedef pair<int, int> pi; typedef pair<ll, ll> pl; #define rep(i, N) for (int i = 0; i < (int)N; i++) #define all(v) (v).begin(), (v).end() const int INF = 1001001001; struct Edge { int to, cost; ...
replace
20
21
20
21
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> // typedef //-------------------------#include <bits/stdc++.h> const double pi = 3.141592653589793238462643383279; using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template ...
#include <bits/stdc++.h> // typedef //-------------------------#include <bits/stdc++.h> const double pi = 3.141592653589793238462643383279; using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template ...
replace
259
260
259
260
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N; vector<vector<int>> G; vector<vector<int>> W; vector<int> res; void dfs(int u) { for (int i = 0; i < G[u].size(); i++) { int v = G[u][i]; if (res[v] != -1) continue; res[v] = (res[u] + W[u][i]) % 2; dfs(v); } } int main() { cin >> N; ...
#include <bits/stdc++.h> using namespace std; int N; vector<vector<int>> G; vector<vector<int>> W; vector<int> res; void dfs(int u) { for (int i = 0; i < G[u].size(); i++) { int v = G[u][i]; if (res[v] != -1) continue; res[v] = (res[u] + W[u][i]) % 2; dfs(v); } } int main() { cin >> N; ...
replace
30
31
30
31
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; using pqueg = priority_queue<int, vector<int>, greater<int>>; using pquel = priority_queue<int, vector<int>, less<int>>; #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((lint)(x).s...
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; using pqueg = priority_queue<int, vector<int>, greater<int>>; using pquel = priority_queue<int, vector<int>, less<int>>; #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((lint)(x).s...
replace
40
41
40
41
0
p03044
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #define _USE_MATH_DEFINES #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <map> #include <queue> #include <random> ...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #define _USE_MATH_DEFINES #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <map> #include <queue> #include <random> ...
replace
54
56
54
56
0
p03044
C++
Runtime Error
/**Function Template**/ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for (ll i = ll(0); i < ll(n); i++) #define Rep(i, n) for (ll i = ll(1); i < ll(n); i++) #define ALL(a) (a).begin(), (a).end() #...
/**Function Template**/ #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pint; const int MAX = 510000; const int MOD = 1000000007; #define rep(i, n) for (ll i = ll(0); i < ll(n); i++) #define Rep(i, n) for (ll i = ll(1); i < ll(n); i++) #define ALL(a) (a).begin(), (a).end() #...
replace
210
211
210
211
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; vector<pair<int, int>> v[10005]; bool use[10005]; int d[10005]; void dfs(int n, int w) { use[n] = true; d[n] = (w & 1); for (int i = 0; i < v[n].size(); i++) { if (!use[v[n][i].first]) dfs(v[n][i].first, v[n][i].second + w); } } int n, mb; int main() { c...
#include <bits/stdc++.h> using namespace std; vector<pair<int, int>> v[100005]; bool use[100005]; int d[100005]; void dfs(int n, int w) { use[n] = true; d[n] = (w & 1); for (int i = 0; i < v[n].size(); i++) { if (!use[v[n][i].first]) dfs(v[n][i].first, v[n][i].second + w); } } int n, mb; int main() { ...
replace
2
5
2
5
0
p03044
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <stdlib.h> #include <string> #include <utility> #include <vector> using namespace std; // cout << << endl; typedef long long int ll; typedef double ld; vector<pair<ll, ll>> p; b...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <stdlib.h> #include <string> #include <utility> #include <vector> using namespace std; // cout << << endl; typedef long long int ll; typedef double ld; vector<pair<ll, ll>> p; b...
replace
95
97
95
97
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define SZ(x) ((int)(x).size()) typedef long long ll; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.setf(ios::fixed); cout.precision(20); int n; cin >> n; vector<int> ans(n, 0); queue<int> q; // set<int> S; vector<boo...
#include <bits/stdc++.h> #define SZ(x) ((int)(x).size()) typedef long long ll; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.setf(ios::fixed); cout.precision(20); int n; cin >> n; vector<int> ans(n + 10, 0); queue<int> q; // set<int> S; vecto...
replace
13
14
13
14
0
p03044
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #in...
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #in...
replace
104
105
104
105
0
p03044
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; /* Bismillahir Rahmanir Rahim Problem : Problem Link : Topics : Solver : Masud Parves I Love Code More than Sharks Love Blood <3 */ #define ff first #define ss second #define pb push_back #define mp make_pair #define SZ(a)...
#include <bits/stdc++.h> using namespace std; /* Bismillahir Rahmanir Rahim Problem : Problem Link : Topics : Solver : Masud Parves I Love Code More than Sharks Love Blood <3 */ #define ff first #define ss second #define pb push_back #define mp make_pair #define SZ(a)...
insert
85
85
85
86
TLE
p03044
C++
Runtime Error
#include <iostream> #include <utility> #include <vector> using namespace std; vector<pair<int, int>> neighbour[10001]; int color[10001]; void dfs(int now, int prev) { for (auto p : neighbour[now]) { if (p.first != prev) { color[p.first] = p.second % 2 ? !color[now] : color[now]; dfs(p.first, now); ...
#include <iostream> #include <utility> #include <vector> using namespace std; vector<pair<int, int>> neighbour[100001]; int color[100001]; void dfs(int now, int prev) { for (auto p : neighbour[now]) { if (p.first != prev) { color[p.first] = p.second % 2 ? !color[now] : color[now]; dfs(p.first, now);...
replace
5
7
5
7
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back #define rint register int #define endl '\n' using namespace std; typedef long long ll; typedef pair<int, int> pii; const int maxn = 1e5 + 10; const int inf = 0x3f3f3f3f; struct Edge { int vv, next, ww; } e[maxn]; int n, u, v, w, tot; int head[maxn], clr[maxn]; void ad...
#include <bits/stdc++.h> #define pb push_back #define rint register int #define endl '\n' using namespace std; typedef long long ll; typedef pair<int, int> pii; const int maxn = 1e5 + 10; const int inf = 0x3f3f3f3f; struct Edge { int vv, next, ww; } e[2 * maxn]; int n, u, v, w, tot; int head[maxn], clr[maxn]; voi...
replace
13
14
13
14
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; #define reps(i, s, n) for (ll(i) = (s); (i) < (n); ++(i)) #define rep(i, n) reps(i, 0, n) #define reptr(i, n) for (ll(i) = (n); (i) >= 0; --(i)) #define All(x) (x).begin(), (x).end() #define Rall(a) (a).rbegin(), (a).rend() #define vll vecto...
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; #define reps(i, s, n) for (ll(i) = (s); (i) < (n); ++(i)) #define rep(i, n) reps(i, 0, n) #define reptr(i, n) for (ll(i) = (n); (i) >= 0; --(i)) #define All(x) (x).begin(), (x).end() #define Rall(a) (a).rbegin(), (a).rend() #define vll vecto...
replace
65
66
65
66
0
p03044
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>; // vector<int> to[100005], co[100005]; int main() { int n; cin >> n; vector<vector<int>> to(n), co(n); rep(i, n - 1) { int a, b, w; cin >> a >> b >> w; a--;...
#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>; // vector<int> to[100005], co[100005]; int main() { int n; cin >> n; vector<vector<int>> to(n), co(n); rep(i, n - 1) { int a, b, w; cin >> a >> b >> w; a--;...
delete
17
18
17
17
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p03044
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; using ll = long long int; #define REP(i, n) for (int i = 0; i < n; i++) int main() { int N; cin >> N; vector<vector<int>> a(N, vector<int>(N)); v...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; using ll = long long int; #define REP(i, n) for (int i = 0; i < n; i++) int main() { int N; cin >> N; vector<vector<int>> a(N); vector<vector<int...
replace
16
18
16
18
0
p03044
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; void a() { int N, K; cin >> N >> K; string S; cin >> S; if (S[K - 1] == 'A') S[K - 1] = 'a'; if (S[K - 1] == 'B') S[K - 1] = 'b'; if (S[K - 1] == 'C') S[K - ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; void a() { int N, K; cin >> N >> K; string S; cin >> S; if (S[K - 1] == 'A') S[K - 1] = 'a'; if (S[K - 1] == 'B') S[K - 1] = 'b'; if (S[K - 1] == 'C') S[K - ...
replace
104
105
104
105
0
p03044
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; vector<vector<pair<int, int>>> G; vector<int> V; vector<int> ans; void dfs(int v, int dist) { ans.at(v) = dist % 2; if (accumulate(V.begin(), V.end(), 0) == V.size() - 1) return; for (auto g : G.at(v)) { if (V.at(g.first)) continue; V.at(v) = 1; ...
#include <bits/stdc++.h> using namespace std; vector<vector<pair<int, int>>> G; vector<int> V; vector<int> ans; void dfs(int v, int dist) { ans.at(v) = dist % 2; for (auto g : G.at(v)) { if (V.at(g.first)) continue; V.at(v) = 1; dfs(g.first, dist + g.second); V.at(v) = 0; } } int main() {...
delete
9
11
9
9
TLE
p03044
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int N; vector<vector<pair<int, int>>> G; vector<int> V; vector<int> ans; void dfs(int v, int dist) { V.at(v) = 1; ans.at(v) = dist % 2; if (accumulate(V.begin(), V.end(), 0L) == N) return; for (auto g : G.at(v)) { if (V.at(g.first)) continue; dfs...
#include <bits/stdc++.h> using namespace std; int N; vector<vector<pair<int, int>>> G; vector<int> V; vector<int> ans; void dfs(int v, int dist) { V.at(v) = 1; ans.at(v) = dist % 2; // if (accumulate(V.begin(), V.end(), 0L) == N) return; for (auto g : G.at(v)) { if (V.at(g.first)) continue; dfs(...
replace
11
13
11
12
TLE
p03044
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int N; vector<vector<pair<int, int>>> G; vector<int> seen; vector<int> ans; void dfs(int v, int dist) { seen.at(v) = 1; ans.at(v) = dist % 2; if (accumulate(seen.begin(), seen.end(), 0) == N) return; for (auto to : G.at(v)) { if (!seen.at(to.first)) ...
#include <bits/stdc++.h> using namespace std; int N; vector<vector<pair<int, int>>> G; vector<int> seen; vector<int> ans; void dfs(int v, int dist) { seen.at(v) = 1; ans.at(v) = dist % 2; // if (accumulate(seen.begin(), seen.end(), 0) == N) return; for (auto to : G.at(v)) { if (!seen.at(to.first)) d...
replace
11
13
11
12
TLE
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; vector<vector<pair<int, int>>> tree; vector<int> col; void dfs(int current, int c) { col.at(current) = c; for (pair<int, int> e : tree.at(current)) { int to = e.first; if (col.at(to) != -1) continue; int dist = e.second; if (dist % 2 == 0) { ...
#include <bits/stdc++.h> using namespace std; vector<vector<pair<int, int>>> tree; vector<int> col; void dfs(int current, int c) { col.at(current) = c; for (pair<int, int> e : tree.at(current)) { int to = e.first; if (col.at(to) != -1) continue; int dist = e.second; if (dist % 2 == 0) { ...
replace
27
28
27
28
0
p03044
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; const ld PI = acos(-1); const ld EPS = 0.0000000001; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; 0 <= i; i--) #define FOR(i, a, b) for (ll i = a; i < (ll)(b...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1000000007; const ld PI = acos(-1); const ld EPS = 0.0000000001; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; 0 <= i; i--) #define FOR(i, a, b) for (ll i = a; i < (ll)(b...
replace
41
42
41
42
TLE
p03044
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; typedef pair<ll, ll> P; struct pp { ll fi; ll se; ll th; }; ll n, a, b, c, d[100000]; queue<pp> q; vector<P> v[100000]; int main(void) { cin >> n; d[0] = 1; for (int i = 0; i < n; i++) { cin >> a >> b >> c; a--, ...
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; typedef pair<ll, ll> P; struct pp { ll fi; ll se; ll th; }; ll n, a, b, c, d[100000]; queue<pp> q; vector<P> v[100000]; int main(void) { cin >> n; d[0] = 1; for (int i = 0; i < n - 1; i++) { cin >> a >> b >> c; a...
replace
16
17
16
17
0
p03044
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define MOD 1000000007 #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #defin...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define MOD 1000000007 #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #defin...
replace
303
304
303
308
0
p03044
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) using ll = long long; using vi = vector<int>; using vvi = vector<vector<int>>; using mii = map<int, int>; using msi = map<string, int>; using pii = pair<int, int>; struct Edge { int to; ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) using ll = long long; using vi = vector<int>; using vvi = vector<vector<int>>; using mii = map<int, int>; using msi = map<string, int>; using pii = pair<int, int>; struct Edge { int to; ...
replace
20
21
20
21
TLE
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<vector<pair<long, long>>> e( N + 1, vector<pair<long, long>>{}); // dest, weight for (int i = 0; i < N - 1; ++i) { long u, v, w; cin >> u >> v >> w; e[u].push_back({v, w}); e[v].push_back({u, w}); } v...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<vector<pair<long, long>>> e( N + 1, vector<pair<long, long>>{}); // dest, weight for (int i = 0; i < N - 1; ++i) { long u, v, w; cin >> u >> v >> w; e[u].push_back({v, w}); e[v].push_back({u, w}); } v...
replace
16
17
16
17
0
p03044
C++
Runtime Error
#include <algorithm> #include <bitset> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <sstream> #include <stack> #include <string.h> #include <string> #include <type_traits> #...
#include <algorithm> #include <bitset> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <sstream> #include <stack> #include <string.h> #include <string> #include <type_traits> #...
replace
25
26
25
26
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; const int INF = 0x7fffffff; const ll LINF = 0x7fffffffffffffff; const int maxn = 1e5; const int modn = 1e9 + 7; struct node { int p, w; }; vector<node> tree[maxn + 10]; int color[maxn + 10]; void dfs(int o) { int tmp = color[o]; for (auto it = t...
#include <bits/stdc++.h> #define ll long long using namespace std; const int INF = 0x7fffffff; const ll LINF = 0x7fffffffffffffff; const int maxn = 1e5; const int modn = 1e9 + 7; struct node { int p, w; }; vector<node> tree[maxn + 10]; int color[maxn + 10]; void dfs(int o) { int tmp = color[o]; for (auto it = t...
replace
36
37
36
37
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) REP(i, 0, n) #define REP(i, l, r) for (long long i = l; i < r; i++) #define int long long using namespace std; typedef pair<int, int> P; struct edge { int to, cost; }; class dijkstra { int V; int d[100002]; priority_queue<P, vector<P>, greater<P>> que; void update(i...
#include <bits/stdc++.h> #define rep(i, n) REP(i, 0, n) #define REP(i, l, r) for (long long i = l; i < r; i++) #define int long long using namespace std; typedef pair<int, int> P; struct edge { int to, cost; }; class dijkstra { int V; int d[100002]; priority_queue<P, vector<P>, greater<P>> que; void update(i...
replace
115
116
115
116
0
p03044
C++
Time Limit Exceeded
// Template // #include <bits/stdc++.h> using namespace std; // マクロ // #define rep(i, N) for (int i = 0; i < N; i++) #define all(x) x.begin(), x.end() #define sort(x) sort(all(x)) #define uniq(x) x.erase(unique(all(x)), x.end()) #define vsum(x) accumulate(all(x), 0) #define cou(x) cout << x << endl #define y() cout <<...
// Template // #include <bits/stdc++.h> using namespace std; // マクロ // #define rep(i, N) for (int i = 0; i < N; i++) #define all(x) x.begin(), x.end() #define sort(x) sort(all(x)) #define uniq(x) x.erase(unique(all(x)), x.end()) #define vsum(x) accumulate(all(x), 0) #define cou(x) cout << x << endl #define y() cout <<...
insert
84
84
84
90
TLE
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define lowbit(x) (x & -x) #define jh(x, y) x ^= y ^= x ^= y #define loc(x, y) (x - 1) * m + y #define rg register #define inl inline #define PI 3.141592654 typedef long long ll; const int N = 6e2 + 5, INF = 0x3f3f3f3f, mod = 998244353; using namespace std; namespace fast_IO { inl ll read() { ...
#include <bits/stdc++.h> #define lowbit(x) (x & -x) #define jh(x, y) x ^= y ^= x ^= y #define loc(x, y) (x - 1) * m + y #define rg register #define inl inline #define PI 3.141592654 typedef long long ll; const int N = 6e5 + 5, INF = 0x3f3f3f3f, mod = 998244353; using namespace std; namespace fast_IO { inl ll read() { ...
replace
8
9
8
9
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); vector<pair<int, int>> G[100000]; vector<long long> dis(100000, 0); for (int i = 0; i < n - 1; i++) { int f, g, w; scanf("%d %d %d", &f, &g, &w); G[f].push_back({g, w}); G[g].push_back({f, w}); } queue<int>...
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); vector<pair<int, int>> G[100000]; vector<long long> dis(100000, 0); for (int i = 0; i < n - 1; i++) { int f, g, w; scanf("%d %d %d", &f, &g, &w); f--; g--; G[f].push_back({g, w}); G[g].push_back({f, w})...
insert
11
11
11
13
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll INF = 1e18; vector<ll> col(100005); vector<vector<P>> g(100005); int dfs(int t, int p, int d) { // cout<<"t"<<t<<"p"<<p<<"d"<<d<<endl; for (P T : g[t]) { int to =...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) using namespace std; typedef long long ll; typedef pair<ll, ll> P; const ll INF = 1e18; vector<ll> col(100005); vector<vector<P>> g(100005); void dfs(int t, int p, int d) { // cout<<"t"<<t<<"p"<<p<<"d"<<d<<endl; for (P T : g[t]) { int to ...
replace
11
12
11
12
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define FAST_IO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define Relocate \ freopen("./in.txt", "r", stdin); \ freopen("./out.txt", "w", stdout) #define up(mi, a, b) for (mi = a...
#include <bits/stdc++.h> #define FAST_IO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define Relocate \ freopen("./in.txt", "r", stdin); \ freopen("./out.txt", "w", stdout) #define up(mi, a, b) for (mi = a...
replace
9
10
9
10
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define rep2(i, x, n) for (int i = x, i##_len = (n); i < i##_len; ++i) #define all(n) begin(n), end(n) using ll = long long; using P = pair<int, int>; using vi = vector<int>; using vl = vector<ll>; using vs ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define rep2(i, x, n) for (int i = x, i##_len = (n); i < i##_len; ++i) #define all(n) begin(n), end(n) using ll = long long; using P = pair<int, int>; using vi = vector<int>; using vl = vector<ll>; using vs ...
replace
17
18
17
18
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define all(x) (x).begin(), (x).end() #define cyes cout << "YES" << endl #define cno cout << "NO" << endl #define sp << " " << #define cst(x) cout << fixed << setprecision(x) #define pi 3.14159265359 #define mod 1000000007 using namespace std; using...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define all(x) (x).begin(), (x).end() #define cyes cout << "YES" << endl #define cno cout << "NO" << endl #define sp << " " << #define cst(x) cout << fixed << setprecision(x) #define pi 3.14159265359 #define mod 1000000007 using namespace std; using...
replace
12
13
12
13
0
p03044
C++
Runtime Error
#include <iostream> #include <map> #include <vector> using namespace std; void dfs(const vector<vector<long>> &graph, const map<pair<long, long>, long> &dist, vector<int> &color, long now, long from, long res) { color[now] = res % 2; for (auto e : graph[now]) { if (e == from) continue...
#include <iostream> #include <map> #include <vector> using namespace std; void dfs(const vector<vector<long>> &graph, const map<pair<long, long>, long> &dist, vector<int> &color, long now, long from, long res) { color[now] = res % 2; for (auto e : graph[now]) { if (e == from) continue...
replace
27
28
27
28
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAXN 100010 struct NODE { int w; int e; int next; } edge[MAXN]; int cnt = 1; int head[MAXN]; int color[MAXN]; void add(int u, int v, int w) { edge[cnt].w = w; edge[cnt].e = v; edge[cnt].next = head[u]; head[u] = cnt++; edge[cnt].w = w; edge[cnt].e ...
#include <bits/stdc++.h> using namespace std; #define MAXN 100010 struct NODE { int w; int e; int next; } edge[MAXN * 2]; int cnt = 1; int head[MAXN]; int color[MAXN]; void add(int u, int v, int w) { edge[cnt].w = w; edge[cnt].e = v; edge[cnt].next = head[u]; head[u] = cnt++; edge[cnt].w = w; edge[cnt...
replace
7
8
7
8
0
p03044
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> using namespace std; int N; int color[100001]; vector<pair<int, int>> G[10000]; void hukasa(int i) { for (int j = 0; j < G[i].size(); j++) { if (color[G[i][j].first] == 0) { color[G[...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> using namespace std; int N; int color[100005]; vector<pair<int, int>> G[100005]; void hukasa(int i) { for (int j = 0; j < G[i].size(); j++) { if (color[G[i][j].first] == 0) { color[G...
replace
10
12
10
12
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MOD = (int)1e9 + 7; void dfs(vector<vector<pair<int, int>>> &graph, vector<int> &ans, int now, int parent, int color) { ans.at(now) = color; for (int i = 0; i < graph.at(now).size(); i++) { int next = graph.at(now).at(i).first; if (next == ...
#include <bits/stdc++.h> using namespace std; const int MOD = (int)1e9 + 7; void dfs(vector<vector<pair<int, int>>> &graph, vector<int> &ans, int now, int parent, int color) { ans.at(now) = color; for (int i = 0; i < graph.at(now).size(); i++) { int next = graph.at(now).at(i).first; if (next == ...
replace
24
25
24
25
0
p03044
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <st...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <st...
replace
66
67
66
67
0
p03044
C++
Runtime Error
// Ryo Kamoi #define DEBUG #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) typedef pair<int, int> pii; typedef long long ll; typedef pair<ll, ll> pll; int INF = 10000000...
// Ryo Kamoi #define DEBUG #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) typedef pair<int, int> pii; typedef long long ll; typedef pair<ll, ll> pll; int INF = 10000000...
replace
27
29
27
29
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vi = vector<int>; using vb = vector<bool>; using pll = pair<ll, ll>; using pii = pair<int, int>; using vpii = vector<pii>; using vpll = vector<pll>; const ll LINF = 1ll << 55; const ll INF = 0x3f3f3f3f; const ll MOD = 1e...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vi = vector<int>; using vb = vector<bool>; using pll = pair<ll, ll>; using pii = pair<int, int>; using vpii = vector<pii>; using vpll = vector<pll>; const ll LINF = 1ll << 55; const ll INF = 0x3f3f3f3f; const ll MOD = 1e...
replace
61
62
61
62
0
p03044
C++
Runtime Error
/* ───────────────────── ───────────████████── ──────────███▄███████ ──────────███████████ ──────────███████████ ──────────██████───── ──────────█████████── █───────███████────── ██────████████████─── ███──██████████──█─── ███████████████────── ███████████████────── ─█████████████─────── ──███████████──────── ────█████...
/* ───────────────────── ───────────████████── ──────────███▄███████ ──────────███████████ ──────────███████████ ──────────██████───── ──────────█████████── █───────███████────── ██────████████████─── ███──██████████──█─── ███████████████────── ███████████████────── ─█████████████─────── ──███████████──────── ────█████...
delete
120
126
120
120
-11
p03044
C++
Runtime Error
#include <cstring> #include <iostream> using namespace std; const int Maxv = 100005; struct edge { int next, to, w; } e[Maxv]; int head[Maxv], cnt = 0; void add_edge(int x, int y, int w) { cnt++; e[cnt].to = y; e[cnt].next = head[x]; e[cnt].w = w; head[x] = cnt; } int ans[Maxv]; void dfs(int v, int f) { ...
#include <cstring> #include <iostream> using namespace std; const int Maxv = 1000005; struct edge { int next, to, w; } e[Maxv]; int head[Maxv], cnt = 0; void add_edge(int x, int y, int w) { cnt++; e[cnt].to = y; e[cnt].next = head[x]; e[cnt].w = w; head[x] = cnt; } int ans[Maxv]; void dfs(int v, int f) {...
replace
4
5
4
5
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; #define ull unsigned long long #define ld long double #define vi vector<int> #define vll vector<ll> #define vc vector<char> #define vs vector<string> #define vpii ve...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; #define ull unsigned long long #define ld long double #define vi vector<int> #define vll vector<ll> #define vc vector<char> #define vs vector<string> #define vpii ve...
replace
46
47
46
47
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 1; i <= (n); i++) using ll = long long; typedef pair<int, int> P; int n, m; vector<vector<P>> dat(101); vector<int> col(10, -1); vector<bool> check(10, false); int main() { int n; cin >> n; col = vector<int>(n + 10, -1); check = vect...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 1; i <= (n); i++) using ll = long long; typedef pair<int, int> P; int n, m; vector<vector<P>> dat(101); vector<int> col(10, -1); vector<bool> check(10, false); int main() { int n; cin >> n; col = vector<int>(n + 10, -1); check = vect...
replace
33
34
33
34
0
p03044
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <unordered_map> #include <vector>...
#include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <unordered_map> #include <vector>...
replace
58
64
58
62
0
p03044
C++
Runtime Error
// https://atcoder.jp/contests/abc126/tasks/abc126_d #include "algorithm" #include "iostream" #include "queue" #include "set" #include "vector" #define rep(i, to) for (ll i = 0; i < (to); ++i) #define repf(i, from, to) for (ll i = from; i < (to); ++i) using namespace std; typedef long long ll; template <typename T> us...
// https://atcoder.jp/contests/abc126/tasks/abc126_d #include "algorithm" #include "iostream" #include "queue" #include "set" #include "vector" #define rep(i, to) for (ll i = 0; i < (to); ++i) #define repf(i, from, to) for (ll i = from; i < (to); ++i) using namespace std; typedef long long ll; template <typename T> us...
replace
108
111
108
109
-6
free(): invalid pointer
p03044
C++
Runtime Error
/* basic header */ #include <bits/stdc++.h> /* define */ #define ll long long #define dou double #define pb emplace_back #define mp make_pair #define sot(a, b) sort(a + 1, a + 1 + b) #define rep1(i, a, b) for (int i = a; i <= b; ++i) #define rep0(i, a, b) for (int i = a; i < b; ++i) #define eps 1e-8 #define int_inf 0x3...
/* basic header */ #include <bits/stdc++.h> /* define */ #define ll long long #define dou double #define pb emplace_back #define mp make_pair #define sot(a, b) sort(a + 1, a + 1 + b) #define rep1(i, a, b) for (int i = a; i <= b; ++i) #define rep0(i, a, b) for (int i = a; i < b; ++i) #define eps 1e-8 #define int_inf 0x3...
replace
22
23
22
23
0
p03044
C++
Runtime Error
// common include #include <bits/stdc++.h> using namespace std; // global variables #define debug(x) cout << #x << ": " << x << endl typedef long long ll; const int M = 1e9 + 7; const int INF = 1e9; // typedef typedef pair<int, int> P; // sort by P.first (asd) bool comPair(const P &firstElof, const P &secondElof) { ...
// common include #include <bits/stdc++.h> using namespace std; // global variables #define debug(x) cout << #x << ": " << x << endl typedef long long ll; const int M = 1e9 + 7; const int INF = 1e9; // typedef typedef pair<int, int> P; // sort by P.first (asd) bool comPair(const P &firstElof, const P &secondElof) { ...
replace
78
81
78
82
0
p03044
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, x, n) for (int i = x; i < n; i++) typedef long long ll; typedef pair<ll, ll> pl; typedef ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, x, n) for (int i = x; i < n; i++) typedef long long ll; typedef pair<ll, ll> pl; typedef ...
replace
64
65
64
65
0
p03044
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; typedef pair<int, int> ii; typedef long long ll; typedef pair<ll, ll> ...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; typedef pair<int, int> ii; typedef long long ll; typedef pair<ll, ll> ...
replace
48
49
48
49
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solve(long long N, std::vector<long long> u, std::vector<long long> v, std::vector<long long> w) { vector<bool> visited(N + 1, false); vector<ll> length(N + 1, 0); vector<vector<pair<ll, ll>>> link_list(N + 1); for (ll i = 0; i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; void solve(long long N, std::vector<long long> u, std::vector<long long> v, std::vector<long long> w) { vector<bool> visited(N + 1, false); vector<ll> length(N + 1, 0); vector<vector<pair<ll, ll>>> link_list(N + 1); for (ll i = 0; i...
replace
9
12
9
12
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #include <type_traits> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define ddrep(i, n) for (int i = n; i > 0; --i) #define srep(i, s, t) for (in...
#include <bits/stdc++.h> #include <type_traits> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define ddrep(i, n) for (int i = n; i > 0; --i) #define srep(i, s, t) for (in...
replace
103
104
103
104
0
p03044
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; vector<int> color; void dfs(int v, int dis, vector<vector<pair<int, int>>> G) { if (dis % 2 == 0) color.at(v) = 0; else color.at(v) = 1; for (auto k : G.at(v)) { int nv = k.first; int tmp = k.second; if (color.at(nv) != -1) continue; d...
#include <bits/stdc++.h> using namespace std; vector<int> color; void dfs(int v, int dis, vector<vector<pair<int, int>>> &G) { if (dis % 2 == 0) color.at(v) = 0; else color.at(v) = 1; for (auto k : G.at(v)) { int nv = k.first; int tmp = k.second; if (color.at(nv) != -1) continue; ...
replace
5
6
5
6
TLE
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, n) for (int i = n - 1; i >= 0; --i) #define fi first #define se second using namespace std; using lint = long long; using uint = unsigned int; using ulint = unsigned long long; using ldouble = long double; using pii = pair<int, int>;...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, n) for (int i = n - 1; i >= 0; --i) #define fi first #define se second using namespace std; using lint = long long; using uint = unsigned int; using ulint = unsigned long long; using ldouble = long double; using pii = pair<int, int>;...
replace
34
35
34
35
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #include <map> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define been(ix) (ix).begin(), (ix).end() using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<long long> vl; const ll INF = 1e18; #define foreach(ix, a) for (auto &(ix) : (a)) vect...
#include <bits/stdc++.h> #include <cmath> #include <map> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define been(ix) (ix).begin(), (ix).end() using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<long long> vl; const ll INF = 1e18; #define foreach(ix, a) for (auto &(ix) : (a)) vect...
replace
11
13
11
13
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAX_V 100000 #define MAX_E 100000 vector<pair<int, int>> G[MAX_V]; int color[MAX_V]; bool dfs(int v, int c) { // printf("%d %d\n", v, c); color[v] = c + 1; for (int i = 0; i < G[v].size(); i++) { if (color[G[v][i].first] == 0) // not visited { ...
#include <bits/stdc++.h> using namespace std; #define MAX_V 100001 #define MAX_E 100001 vector<pair<int, int>> G[MAX_V]; int color[MAX_V]; bool dfs(int v, int c) { // printf("%d %d\n", v, c); color[v] = c + 1; for (int i = 0; i < G[v].size(); i++) { if (color[G[v][i].first] == 0) // not visited { ...
replace
3
5
3
5
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long llint; typedef long double ld; #define inf 1e18 #define mod 1000000007 priority_queue<llint, vector<llint>, greater<llint>> que; priority_queue<llint> Que; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } re...
#include <bits/stdc++.h> using namespace std; typedef long long llint; typedef long double ld; #define inf 1e18 #define mod 1000000007 priority_queue<llint, vector<llint>, greater<llint>> que; priority_queue<llint> Que; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } re...
replace
31
32
31
32
-11
p03044
C++
Runtime Error
#include <algorithm> #include <bitset> #include <complex> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef long long int llint; #define MM 10...
#include <algorithm> #include <bitset> #include <complex> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef long long int llint; #define MM 10...
replace
55
56
55
56
0
p03044
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int n; long long u[110000], v[110000], w[110000]; cin >> n; bool isw[110000][3]; bool f = false; long count = 0; for (int i = 0; i < 10050; i++) // 初期化 { isw[i][0] = false; isw[i][1] = false; } isw...
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int n; long long u[110000], v[110000], w[110000]; cin >> n; bool isw[110000][3]; bool f = false; long count = 0; for (int i = 0; i < 10050; i++) // 初期化 { isw[i][0] = false; isw[i][1] = false; } isw...
insert
62
62
62
100
TLE
p03044
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long int ll; using namespace std; int dfs(int u, vector<vector<int>> G, vector<vector<int>> G_w, vector<int> &visit, vector<int> &nagasa) { visit[u] = 1; for (int i = 0; i < G[u].size(); i++) { int v = G[u][i]; if (visit[v] == 0) { nagasa[v] = (nagas...
#include <bits/stdc++.h> typedef long long int ll; using namespace std; int dfs(int u, vector<vector<int>> &G, vector<vector<int>> &G_w, vector<int> &visit, vector<int> &nagasa) { visit[u] = 1; for (int i = 0; i < G[u].size(); i++) { int v = G[u][i]; if (visit[v] == 0) { nagasa[v] = (nag...
replace
5
6
5
6
TLE
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll(i) = (0); (i) < (n); ++i) #define REV(i, n) for (ll(i) = (n)-1; (i) >= 0; --i) #define PB push_back #define EB emplace_back #define MP make_pair #define FI first #define SE second #define SHOW1d(v, n) ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll(i) = (0); (i) < (n); ++i) #define REV(i, n) for (ll(i) = (n)-1; (i) >= 0; --i) #define PB push_back #define EB emplace_back #define MP make_pair #define FI first #define SE second #define SHOW1d(v, n) ...
replace
33
34
33
34
0
p03044
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; #define fi first #define se second vector<pair<int, int>> adj[10001]; int color[10001]; bool visited[10001]; void dfs(pair<int, int> cur) { visited[cur.fi] = true; for (int i = 0; i < adj[cur.fi].size(); i++) { if (!visited[adj[cur.fi][i].fi]) { i...
#include <iostream> #include <vector> using namespace std; #define fi first #define se second vector<pair<int, int>> adj[100001]; int color[100001]; bool visited[100001]; void dfs(pair<int, int> cur) { visited[cur.fi] = true; for (int i = 0; i < adj[cur.fi].size(); i++) { if (!visited[adj[cur.fi][i].fi]) { ...
replace
5
8
5
8
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; void addEdge(vector<pair<int, int>> g[], int u, int v, int w) { // g[u].push_back({v, w}); // g[v].push_back({u, w}); g[u].push_back(make_pair(v, w)); g[v].push_back(make_pair(u, w)); } void dfs_util(vector<pair<int, int>> g[], int s, bool col[], int pcol, ...
#include <bits/stdc++.h> using namespace std; void addEdge(vector<pair<int, int>> g[], int u, int v, int w) { // g[u].push_back({v, w}); // g[v].push_back({u, w}); g[u].push_back(make_pair(v, w)); g[v].push_back(make_pair(u, w)); } void dfs_util(vector<pair<int, int>> g[], int s, bool col[], int pcol, ...
replace
40
41
40
41
0
p03044
C++
Runtime Error
/*Author: Gautam*/ #include <bits/stdc++.h> #define FastIO \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); using namespace s...
/*Author: Gautam*/ #include <bits/stdc++.h> #define FastIO \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); using namespace s...
replace
64
67
64
67
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; using Edge = pair<int, ll>; using Graph = vector<vector<Edge>>; int N; Graph G; vector<int> dir; void dfs(int v, int p, int c) { dir[v] = c; for (auto e : G[v]) { if (e.first == p) conti...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; using Edge = pair<int, ll>; using Graph = vector<vector<Edge>>; int N; Graph G; vector<int> dir; void dfs(int v, int p, int c) { dir[v] = c; for (auto e : G[v]) { if (e.first == p) conti...
replace
28
29
28
29
0
p03044
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #in...
#include <algorithm> #include <bitset> #include <cassert> #include <ciso646> #include <cmath> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #in...
replace
34
35
34
35
TLE
p03044
C++
Runtime Error
#include <bits/stdc++.h> template <typename InputIterator> typename InputIterator::value_type summation(InputIterator first, InputIterator last) { return std::accumulate(first, last, typename InputIterator::value_type()); } template <typename T> std::istream &operator>>(s...
#include <bits/stdc++.h> template <typename InputIterator> typename InputIterator::value_type summation(InputIterator first, InputIterator last) { return std::accumulate(first, last, typename InputIterator::value_type()); } template <typename T> std::istream &operator>>(s...
replace
31
32
31
32
0
p03044
C++
Runtime Error
#include "bits/stdc++.h" #include "math.h" using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<bool> vb; typedef vector<vb> vvb; typedef vector<int> vin; typedef pair<ll, ll> P; typedef vector<P> vp; #define rep(i, a, b) for (ll i = (a); i < (b); ++i) #define dre...
#include "bits/stdc++.h" #include "math.h" using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<bool> vb; typedef vector<vb> vvb; typedef vector<int> vin; typedef pair<ll, ll> P; typedef vector<P> vp; #define rep(i, a, b) for (ll i = (a); i < (b); ++i) #define dre...
replace
40
41
40
41
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; const int MAX = 100005; // 頂点番号と距離を記録したい. /* 方針 rootから見ていく。親との距離が偶数なら同じ色、違うなら違う色を塗れば よさそう。それで任意の組み合わせについて条件が達成されるが...? λ関数でdfsを実装するのは理由がわからないけど無理そう。なので外部に. */ vector<P> ale[MA...
#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; const int MAX = 100005; // 頂点番号と距離を記録したい. /* 方針 rootから見ていく。親との距離が偶数なら同じ色、違うなら違う色を塗れば よさそう。それで任意の組み合わせについて条件が達成されるが...? λ関数でdfsを実装するのは理由がわからないけど無理そう。なので外部に. */ vector<P> ale[MA...
replace
35
36
35
36
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ALL(a) (a).begin(), (a).end() using namespace std; using ll = long long; using P = pair<int, int>; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool ...
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ALL(a) (a).begin(), (a).end() using namespace std; using ll = long long; using P = pair<int, int>; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool ...
replace
33
34
33
34
0
p03044
C++
Runtime Error
#define FOR(i, begin, end) for (int i = (begin); i < (end); i++) #define REP(i, n) FOR(i, 0, n) #define SORT(a) sort(a.begin(), a.end()) #define SORTD(a) sort(a.rbegin(), a.rend()); #define ll long long #define INF 1000000000000000000 #define INT_MAX 2147483647 #include <algorithm> #include <cctype> #include <cmath> #...
#define FOR(i, begin, end) for (int i = (begin); i < (end); i++) #define REP(i, n) FOR(i, 0, n) #define SORT(a) sort(a.begin(), a.end()) #define SORTD(a) sort(a.rbegin(), a.rend()); #define ll long long #define INF 1000000000000000000 #define INT_MAX 2147483647 #include <algorithm> #include <cctype> #include <cmath> #...
replace
46
48
46
50
0
p03044
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> using namespace std; const int SIZE = 50010; int f[SIZE][20], d[SIZE], dist[SIZE]; int ver[2 * SIZE], Next[2 * SIZE], edge[2 * SIZE], head[SIZE]; int T, n, m, tot, t; queue<int> q; void add(int x, int y, int...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> using namespace std; const int SIZE = 100010; int f[SIZE][20], d[SIZE], dist[SIZE]; int ver[2 * SIZE], Next[2 * SIZE], edge[2 * SIZE], head[SIZE]; int T, n, m, tot, t; queue<int> q; void add(int x, int y, in...
replace
7
8
7
8
0
p03044
C++
Runtime Error
#include <bits/stdc++.h> #define all(X) (X).begin(), (X).end() #define rall(X) (X).rbegin(), (X).rend() #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define ff first #define ss second #define P 1000000007 #define in(x, a, b) (a <= x && x < b) using namespace std; using ll = l...
#include <bits/stdc++.h> #define all(X) (X).begin(), (X).end() #define rall(X) (X).rbegin(), (X).rend() #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define ff first #define ss second #define P 1000000007 #define in(x, a, b) (a <= x && x < b) using namespace std; using ll = l...
replace
24
25
24
25
0
p03044
C++
Time Limit Exceeded
// // Created by kuroneko on 2019-07-06. // #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> typedef long long ll; using namespace std; int d[100000]; int N; struct edge { int to; int cost; }; void dfs(int node, vector<vector<edge>> v, int p_color) { d[node] = p_col...
// // Created by kuroneko on 2019-07-06. // #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> typedef long long ll; using namespace std; int d[100000]; int N; struct edge { int to; int cost; }; void dfs(int node, const vector<vector<edge>> &v, int p_color) { d[node] ...
replace
21
22
21
22
TLE