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
p02761
Python
Runtime Error
N, M = map(int, input().split()) sc = [tuple(map(int, input().split())) for _ in range(M)] for i in range(1000): t = str(i) if len(t) != N: continue ok = True for s, c in sc: if t[int(s)] != int(c): ok = False break if ok: print(i) exit() prin...
N, M = map(int, input().split()) sc = [tuple(map(int, input().split())) for _ in range(M)] for i in range(1000): t = str(i) if len(t) != N: continue ok = True for s, c in sc: if int(t[s - 1]) != c: ok = False break if ok: print(i) exit() print...
replace
9
10
9
10
0
p02761
C++
Runtime Error
/* * Created by solzard on 2020-03-05. * C - Guess The Number */ #include <iostream> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int GuessNumber(int n, int m, const std::vector<int> &s, const std::vector<int> &c) { int res = -1; for (int num = 999; n...
/* * Created by solzard on 2020-03-05. * C - Guess The Number */ #include <iostream> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int GuessNumber(int n, int m, const std::vector<int> &s, const std::vector<int> &c) { int res = -1; for (int num = 999; n...
replace
34
35
34
35
-11
p02761
C++
Runtime Error
/* URL https:// SCORE 0 AC false WA false TLE false MLE false TASK_TYPE FAILURE_TYPE NOTES */ #include <algorithm> #include <cstdint> #include <experimental/optional> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include...
/* URL https:// SCORE 0 AC false WA false TLE false MLE false TASK_TYPE FAILURE_TYPE NOTES */ #include <algorithm> #include <cstdint> #include <experimental/optional> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include...
insert
967
967
967
970
0
p02761
C++
Runtime Error
// Ruthless Coding #include <bits/stdc++.h> #define uni(x) (x).resize(unique(all(x)) - (x).begin()) #define fprint(v) \ for (auto x : v) \ cout << x << ' ' #define ALL(x) (x).begin(), (x).end() ...
// Ruthless Coding #include <bits/stdc++.h> #define uni(x) (x).resize(unique(all(x)) - (x).begin()) #define fprint(v) \ for (auto x : v) \ cout << x << ' ' #define ALL(x) (x).begin(), (x).end() ...
insert
77
77
77
79
-11
p02761
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; int dx[4] = {0, 0, 1, -1}; int dy[4] = {1, -...
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; int dx[4] = {0, 0, 1, -1}; int dy[4] = {1, -...
insert
91
91
91
101
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long int; using str = string; using P = pair<int, int>; using Pll = pair<ll, ll>; const double PI = 3.141592653589793238; const ll mod = 1000000007; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define REP(i, m, n) for (int i = m; i < (int)n; i++) #def...
#include <bits/stdc++.h> using namespace std; using ll = long long int; using str = string; using P = pair<int, int>; using Pll = pair<ll, ll>; const double PI = 3.141592653589793238; const ll mod = 1000000007; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define REP(i, m, n) for (int i = m; i < (int)n; i++) #def...
replace
23
24
23
24
0
p02761
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; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1;...
#include <bits/stdc++.h> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; typedef long long ll; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1;...
replace
51
52
51
55
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, m; cin >> n >> m; vector<P> p(m); rep(i, m) cin >> p[i].first >> p[i].second; rep(x, 1000) { int keta = 1; int nx = x / 10; vector...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, m; cin >> n >> m; vector<P> p(m); rep(i, m) cin >> p[i].first >> p[i].second; rep(x, 1000) { int keta = 1; int nx = x / 10; vector...
replace
18
19
18
19
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02761
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> s(m), c(m); for (int i = 0; i < m; i++) { cin >> s[i] >> c[i]; } // sが同じでcが違うようなものが存在すれば-1 for (int i = 0; i < m; i++) { for (int j = i + 1; j < m; j++) { // iとjを比べる if (s[i] ...
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> s(m), c(m); for (int i = 0; i < m; i++) { cin >> s[i] >> c[i]; } // sが同じでcが違うようなものが存在すれば-1 for (int i = 0; i < m; i++) { for (int j = i + 1; j < m; j++) { // iとjを比べる if (s[i] ...
replace
24
25
24
25
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N, M, s, c, Ans = 0; cin >> N >> M; vector<int> vec(3); vec.at(0) = -1; vec.at(1) = -1; vec.at(2) = -1; rep(i, M) { cin >> s >> c; if (vec.at(s - 1) == -1 || vec.at(s - 1) == c) { ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N, M, s, c, Ans = 0; cin >> N >> M; vector<int> vec(3); vec.at(0) = -1; vec.at(1) = -1; vec.at(2) = -1; rep(i, M) { cin >> s >> c; if (vec.at(s - 1) == -1 || vec.at(s - 1) == c) { ...
replace
27
28
27
28
0
p02761
C++
Runtime Error
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; const int INF = 1e9 + 5; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<int> s(m); vector<int> c(m); for (int i = 0; i < m; i++) cin >> s[i] >> c[i]; for (int i = 1; i < m; i++) { for (int j = 0; j < i; j++...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; const int INF = 1e9 + 5; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<int> s(m); vector<int> c(m); for (int i = 0; i < m; i++) cin >> s[i] >> c[i]; if (m == 0) { if (n == 1) { cout << 0 << endl; ...
insert
14
14
14
28
0
p02761
C++
Runtime Error
#include <iomanip> #include <iostream> #include <utility> #include <vector> using namespace std; const long INF = 1e9; const long MOD = 1e9 + 7; #define repi(i, n, init) for (int i = init; i < int(n); i++) int power(int n, int t) { int s = 1; repi(i, t, 0) { s *= n; } return s; } int main() { int n, m, ans = ...
#include <iomanip> #include <iostream> #include <utility> #include <vector> using namespace std; const long INF = 1e9; const long MOD = 1e9 + 7; #define repi(i, n, init) for (int i = init; i < int(n); i++) int power(int n, int t) { int s = 1; repi(i, t, 0) { s *= n; } return s; } int main() { int n, m, ans = ...
replace
25
26
25
26
0
p02761
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> ke(n, -1), c(m), s(m); ...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> ke(n, -1), c(m), s(m); ...
insert
18
18
18
23
0
p02761
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; typedef pair<int, int> P; int main() { int n, m; cin >> n >> m; vector<int> s(m); vector<int> c(m); rep(i, m) { cin >> s.at(i) >> c.at(i); } vector<int> t(m); rep(i, n) t[i] = -1; rep(j,...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; typedef pair<int, int> P; int main() { int n, m; cin >> n >> m; vector<int> s(m); vector<int> c(m); rep(i, m) { cin >> s.at(i) >> c.at(i); } vector<int> t(n); rep(i, n) t[i] = -1; rep(j,...
replace
14
15
14
15
0
p02761
C++
Runtime Error
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <numeric> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), ...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <numeric> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), ...
replace
28
29
28
29
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; // int/long: -2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31) // long/long long: -9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 // (-2^63 <= long < 2^63) // lower_bound(A.begin(), A.end(), N) // upper_bound(... // A.erase(unique(A.begin...
#include <bits/stdc++.h> using namespace std; typedef long long ll; // int/long: -2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31) // long/long long: -9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 // (-2^63 <= long < 2^63) // lower_bound(A.begin(), A.end(), N) // upper_bound(... // A.erase(unique(A.begin...
replace
84
85
84
85
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int times10(int n) { int output = 1; for (int i = 0; i < n; i++) { output *= 10; } return output; } int main() { // enter int N, M; cin >> N >> M; vector<int> s(M); vector<int> c(M); for (int i = 0; i < M; i++) { cin >> s[i] >> c[i]; s[i]-...
#include <bits/stdc++.h> using namespace std; int times10(int n) { int output = 1; for (int i = 0; i < n; i++) { output *= 10; } return output; } int main() { // enter int N, M; cin >> N >> M; vector<int> s(M); vector<int> c(M); for (int i = 0; i < M; i++) { cin >> s[i] >> c[i]; s[i]-...
replace
34
36
34
36
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define ll long long int #define N 200100 int a[5]; void solve() { int n, m; cin >> n >> m; memset(a, -1, sizeof a); int sum = 0; while (m--) { int s, c; cin >> s >> c; if (a[s] == -1 || a[s] == c) { sum += c; a[s] = ...
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define ll long long int #define N 200100 int a[5]; void solve() { int n, m; cin >> n >> m; memset(a, -1, sizeof a); int sum = 0; while (m--) { int s, c; cin >> s >> c; if (a[s] == -1 || a[s] == c) { sum += c; a[s] = ...
delete
41
45
41
41
-11
p02761
Python
Runtime Error
n, m = map(int, input().split()) s, c = [], [] for i in range(m): _s, _c = map(int, input().split()) s.append(_s) c.append(_c) for i in range(1000): (*t,) = map(int, list(str(i))) if len(t) != n: continue ok = True for j in range(m): if t[s[j]] != c[j]: ok = Fa...
n, m = map(int, input().split()) s, c = [], [] for i in range(m): _s, _c = map(int, input().split()) s.append(_s - 1) c.append(_c) for i in range(1000): (*t,) = map(int, list(str(i))) if len(t) != n: continue ok = True for j in range(m): if t[s[j]] != c[j]: ok ...
replace
4
5
4
5
IndexError: list index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02761/Python/s786393396.py", line 16, in <module> if t[s[j]] != c[j]: IndexError: list index out of range
p02761
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <functional> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int N, M, x = 100, y = 0, z = 0, ans; cin >> N >> M; vector<int> s(M); vector<int> c(M); vector<int> d(3, 10); rep(i, M) cin >> s[i] >> c[i]; if (N == ...
#include <algorithm> #include <bits/stdc++.h> #include <functional> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int N, M, x = 100, y = 0, z = 0, ans; cin >> N >> M; vector<int> s(M); vector<int> c(M); vector<int> d(3, 10); rep(i, M) cin >> s[i] >> c[i]; if (N == ...
replace
18
19
18
24
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fi first #define endl "\n" #define se second #define ls(s) (s & (-s)) #define ll long long #define inf 0x3f3f3f3f const ll N = 500030; #define rep(i, begin, end) \ for (__typeof(end) i = (begin) - ((begin) > (en...
#include <bits/stdc++.h> using namespace std; #define fi first #define endl "\n" #define se second #define ls(s) (s & (-s)) #define ll long long #define inf 0x3f3f3f3f const ll N = 500030; #define rep(i, begin, end) \ for (__typeof(end) i = (begin) - ((begin) > (en...
replace
30
31
30
34
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> kazu(n); int f = 0; int g = 0; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; if (a == 1) { g = 1; } if (kazu.at(a - 1) != 0 && kazu.at(a - 1) != b) { f = -1; } else {...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> kazu(n); int f = 0; int g = 0; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; if (a == 1) { g = 1; } if (kazu.at(a - 1) != 0 && kazu.at(a - 1) != b) { f = -1; } else {...
replace
21
23
21
23
0
p02761
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; int main() { int n, m; cin >> n >> m; vector<pair<int, int>> a; rep(i, m) { cin >> a[i].first >> a[i].second; } rep(x, 1000) { int keta = 1; vector<int> d(1, x % 10); int xx = x / 10...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; vector<pair<int, int>> a(m); rep(i, m) { cin >> a[i].first >> a[i].second; } rep(x, 1000) { int keta = 1; vector<int> d(1, x % 10); int xx = x /...
replace
8
9
8
9
-11
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { #ifndef ONLINE_JUDGE // for getting input from input.txt freopen("input.txt", "r", stdin); // for writing output to output.txt freopen("output.txt", "w", stdout); #endif ll n, m; cin >> n >> m; ll s[m], c[m]; for (int i = ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, m; cin >> n >> m; ll s[m], c[m]; for (int i = 1; i <= m; ++i) { cin >> s[i] >> c[i]; } map<ll, ll> mp; for (int i = 1; i <= n; ++i) { mp[i] = -1; } for (int i = 1; i <= m; ++i) { if (c[i] == 0 && s[i]...
replace
5
11
5
6
-11
p02761
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define FOR(i, s, n) for (int i = s; i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(n) (...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define FOR(i, s, n) for (int i = s; i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(n) (...
insert
42
42
42
43
TLE
p02761
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #i...
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #i...
insert
40
40
40
52
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> s(M); vector<char> c(M); for (int i = 0; i < M; i++) cin >> s.at(i) >> c.at(i); if (N == 1) { bool flag = true; for (int i = 0; i < M - 1; i++) if (c.at(i) != c.at(i + 1)) flag = false...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> s(M); vector<char> c(M); for (int i = 0; i < M; i++) cin >> s.at(i) >> c.at(i); if (M == 0) { if (N == 1) cout << 0 << endl; else cout << pow(10, N - 1) << endl; return 0; } if ...
insert
10
10
10
18
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i < n + 1; i++) #define sort(A) sort(A.begin(), A.end()) #define reverse(A) reverse(A.begin(), A.end()) typedef long long ll; typedef pair<int, int> P; int main() { int n, m; cin >> n >> m...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i < n + 1; i++) #define sort(A) sort(A.begin(), A.end()) #define reverse(A) reverse(A.begin(), A.end()) typedef long long ll; typedef pair<int, int> P; int main() { int n, m; cin >> n >> m...
replace
30
33
30
43
0
p02761
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<pair<int, char>> P(M); int i; if (N == 1) { i = 0; } else if (N == 2) { i = 10; } else { i = 100; } for (int j = 0; j < M; j++) { cin >> P.at(j).first >> P.at(j).second; } // cout<<1<<P.at(0...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<pair<int, char>> P(M); int i; if (N == 1) { i = 0; } else if (N == 2) { i = 10; } else { i = 100; } for (int j = 0; j < M; j++) { cin >> P.at(j).first >> P.at(j).second; } // cout<<1<<P.at(0...
insert
31
31
31
35
TLE
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int fuka = 0; int N, M; cin >> N >> M; vector<int> s(M); vector<int> c(M); for (int i = 0; i < M; i++) { cin >> s.at(i) >> c.at(i); } // 1keta no toki if (N == 1) { sort(c.begin(), c.end()); if (c.at(0) != c.at(M - 1)) { ...
#include <bits/stdc++.h> using namespace std; int main() { int fuka = 0; int N, M; cin >> N >> M; vector<int> s(M); vector<int> c(M); for (int i = 0; i < M; i++) { cin >> s.at(i) >> c.at(i); } // 1keta no toki if (N == 1 && M == 0) { cout << 0 << endl; } if (N == 1 && M > 0) { sort(...
replace
14
16
14
18
0
p02761
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> s(m); vector<char> c(m); for (int i = 0; i < m; i++) { cin >> s[i] >> c[i]; s[i]--; } int upper, lower; sw...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> s(m); vector<char> c(m); for (int i = 0; i < m; i++) { cin >> s[i] >> c[i]; s[i]--; } int upper, lower; sw...
replace
41
42
41
42
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int j; int M; cin >> M; vector<int> ans(N); long answer; answer = 0; int i; long jousuu; vector<int> s(M); vector<int> c(M); for (i = 0; i < M; i++) { cin >> s.at(i); // cout << s.at(i); cin >> c.at(i); ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int j; int M; cin >> M; vector<int> ans(N); long answer; answer = 0; int i; long jousuu; vector<int> s(M); vector<int> c(M); for (i = 0; i < M; i++) { cin >> s.at(i); // cout << s.at(i); cin >> c.at(i); ...
replace
70
73
70
78
0
p02761
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> s(m); vector<char> c(m); rep(i, m) { cin >> s[i] >> c[i]; s[i]--; } int ans = -1; for (int i = pow(10, n - 1); i < pow(10, n); i++)...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) using ll = long long; int main() { int n, m; cin >> n >> m; vector<int> s(m); vector<char> c(m); rep(i, m) { cin >> s[i] >> c[i]; s[i]--; } int ans = -1; int st = pow(10, n - 1); if (n == 1) st = 0...
replace
15
18
15
19
TLE
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int N, M; cin >> N >> M; vector<int> s(M), c(M); for (int i = 0; i < M; i++) cin >> s[i] >> c[i]; if (N == 1) { for (int i = 1; i < M; i++) { if (c[i] != c[0]) { cout << -1 << endl; return 0; }...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int N, M; cin >> N >> M; if (M == 0) { if (N == 1) cout << 0 << endl; else if (N == 2) cout << 10 << endl; else cout << 100 << endl; return 0; } vector<int> s(M), c(M); for (int i = 0; i < M; i...
insert
7
7
7
16
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using int64 = long long; const int mod = 1e9 + 7; const int64 infll = (1LL << 58) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); cerr << fixed << setpre...
#include <bits/stdc++.h> using namespace std; using int64 = long long; const int mod = 1e9 + 7; const int64 infll = (1LL << 58) - 1; const int inf = (1 << 30) - 1; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); cerr << fixed << setpre...
replace
86
87
86
87
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #include <boost/algorithm/string/join.hpp> // using boost::algorithm::join; // // #include "boost/multi_array.hpp" // boost::multi_array<int, 3> dp; // dp.resize(boost::extents[10][9][8]); // // #include <boost/multiprecision/cpp_dec_float.hpp> // quite slowly // #incl...
#include <bits/stdc++.h> using namespace std; // #include <boost/algorithm/string/join.hpp> // using boost::algorithm::join; // // #include "boost/multi_array.hpp" // boost::multi_array<int, 3> dp; // dp.resize(boost::extents[10][9][8]); // // #include <boost/multiprecision/cpp_dec_float.hpp> // quite slowly // #incl...
replace
93
96
93
100
0
p02761
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <sstream> #include <stdio.h> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); i++) // ABC157_C int main() { ...
#include <algorithm> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <sstream> #include <stdio.h> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); i++) // ABC157_C int main() { ...
replace
21
23
21
23
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<int> vec(3, -1); rep(i, n) { int d, v; cin >> d...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define INF 2e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; vector<int> vec(3, -1); rep(i, m) { int d, v; cin >> d...
replace
11
12
11
12
0
p02761
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> std::vector<int> split(int x) { if (x == 0) return {0}; std::vector<int> ans; while (x) ans.push_back(x % 10), x /= 10; std::reverse(ans.begin(), ans.end()); return ans; } int main() { int n, m; std::cin >> n >> m; std::vector<std::pai...
#include <algorithm> #include <iostream> #include <vector> std::vector<int> split(int x) { if (x == 0) return {0}; std::vector<int> ans; while (x) ans.push_back(x % 10), x /= 10; std::reverse(ans.begin(), ans.end()); return ans; } int main() { int n, m; std::cin >> n >> m; std::vector<std::pai...
replace
17
18
17
18
-11
p02761
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; typedef long long llong; typedef unsigned long long ullong; // -2.1e-9 <= int <= 2.1e9 // 0 <= unsigned int <= 4.2e9 int main() { size_t N, M; cin >> N >> ...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; typedef long long llong; typedef unsigned long long ullong; // -2.1e-9 <= int <= 2.1e9 // 0 <= unsigned int <= 4.2e9 int main() { size_t N, M; cin >> N >> ...
replace
19
20
19
20
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; int main() { int N, M; cin >> N >> M; string num(M, '.'); for (int i = 0; i < M; i++) { int c, s; cin >> s >> c; if (N > 1 && s == 1 && c == 0) { cout << -1 << endl; return 0; } if (n...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; int main() { int N, M; cin >> N >> M; string num(N, '.'); for (int i = 0; i < M; i++) { int c, s; cin >> s >> c; if (N > 1 && s == 1 && c == 0) { cout << -1 << endl; return 0; } if (n...
replace
8
9
8
9
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> #define cout16 cout << setprecision(16) #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) *max_element(A.begin(), A.end()) #define MIN(A) *min_element(A.begin(), A.end()) #define SORT(A) sort(A.begin(), A.end()) #define REV(A) reverse...
#include <bits/stdc++.h> #define cout16 cout << setprecision(16) #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) *max_element(A.begin(), A.end()) #define MIN(A) *min_element(A.begin(), A.end()) #define SORT(A) sort(A.begin(), A.end()) #define REV(A) reverse...
insert
24
24
24
34
0
p02761
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; int main() { int n, m; cin >> n >> m; vector<P> p(m); rep(i, m) cin >> p[i].first >> p[i].second; rep(x, 1000) { int keta = 1; int nx = x / 10; ...
#include <algorithm> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; int main() { int n, m; cin >> n >> m; vector<P> p(m); rep(i, m) cin >> p[i].first >> p[i].second; rep(x, 1000) { int keta = 1; int nx = x / 10; ...
replace
25
26
25
26
0
p02761
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using ll = long long; using namespace std; int main() { int N, M; cin >> N >> M; vector<int> s(M); vector<int> c(M); for (int i = 0; i < M; i++) { cin >> s[i] >> c[i]; } int st = 1; for (int i = 1; i < N; i++) { st *= 10; } int ed = s...
#include <iostream> #include <string> #include <vector> using ll = long long; using namespace std; int main() { int N, M; cin >> N >> M; vector<int> s(M); vector<int> c(M); for (int i = 0; i < M; i++) { cin >> s[i] >> c[i]; } int st = 1; for (int i = 1; i < N; i++) { st *= 10; } int ed = s...
insert
27
27
27
30
0
p02761
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> s(m), c(m), a(n + 1); for (int i = 0; i < m; i++) { cin >> s[i] >> c[i]; a[s[i]] = c[i]; } for (int i = 0; i < m; i++) { if (a[s[i]] != c[i] || (n > 1 && s[i] == 1 && c[i] == 0)) { cout << -1;...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> s(m), c(m), a(n + 1); for (int i = 0; i < m; i++) { cin >> s[i] >> c[i]; a[s[i]] = c[i]; } for (int i = 0; i < m; i++) { if (a[s[i]] != c[i] || (n > 1 && s[i] == 1 && c[i] == 0)) { cout << -1;...
replace
18
20
18
20
0
p02761
Python
Runtime Error
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10**7) n, m = map(int, readline().split()) if m == 0: if n == 1: print(0) else: print("1" + "0" * (n - 1)) sc = [list(map(int, readline().split())) for i in...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10**7) n, m = map(int, readline().split()) if m == 0: if n == 1: print(0) else: print("1" + "0" * (n - 1)) exit() sc = [list(map(int, readline().split()...
insert
13
13
13
14
0
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define inf 1000000007 using namespace std; int n, m, k, fa[100009], num[100009]; vector<int> w[100009]; vector<int> w1[100009]; int findl(int x) { return fa[x] == x ? x : findl(fa[x]); } int main() { scanf("%d%d%d", &n, &m, &k); for (int i = 1; i <= n; i++) fa[i] =...
#include <bits/stdc++.h> #define ll long long #define inf 1000000007 using namespace std; int n, m, k, fa[100009], num[100009]; vector<int> w[100009]; vector<int> w1[100009]; int findl(int x) { return fa[x] == x ? x : fa[x] = findl(fa[x]); } int main() { scanf("%d%d%d", &n, &m, &k); for (int i = 1; i <= n; i++) ...
replace
7
8
7
8
TLE
p02762
Python
Runtime Error
class UnionFind: def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x self.parents[x] = self.find(self.parents[x]) return self.parents[x] def unite(self, x, y): x = self.find(x) y =...
class UnionFind: def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x self.parents[x] = self.find(self.parents[x]) return self.parents[x] def unite(self, x, y): x = self.find(x) y =...
replace
17
18
17
18
0
p02762
Python
Runtime Error
# https://atcoder.jp/contests/abc157/submissions/10475457 import sys readline = sys.stdin.readine N, M, K = map(int, readline().split()) F = [[] for _ in range(N + 1)] for _ in range(M): a, b = map(int, readline().split()) F[a].append(b) F[b].append(a) B = [[] for _ in range(N + 1)] for _ in range(K): ...
# https://atcoder.jp/contests/abc157/submissions/10475457 import sys readline = sys.stdin.readline N, M, K = map(int, readline().split()) F = [[] for _ in range(N + 1)] for _ in range(M): a, b = map(int, readline().split()) F[a].append(b) F[b].append(a) B = [[] for _ in range(N + 1)] for _ in range(K):...
replace
4
5
4
5
AttributeError: '_io.TextIOWrapper' object has no attribute 'readine'. Did you mean: 'readline'?
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02762/Python/s918712039.py", line 4, in <module> readline = sys.stdin.readine AttributeError: '_io.TextIOWrapper' object has no attribute 'readine'. Did you mean: 'readline'?
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; void Main() { int n, m, k; cin >> n >> m >> k; vector<int> frig(n); // friend group tree vector<int> numf(n); // number of friend vector<int> numb(n); // number of ban vector<int> numc(n); // size of group for (int i = 0; i < n; i++) { frig[i] = i; } ...
#include <bits/stdc++.h> using namespace std; void Main() { int n, m, k; cin >> n >> m >> k; vector<int> frig(n); // friend group tree vector<int> numf(n); // number of friend vector<int> numb(n); // number of ban vector<int> numc(n); // size of group for (int i = 0; i < n; i++) { frig[i] = i; } ...
insert
27
27
27
29
TLE
p02762
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define ALL(a) (a).begin(), (a).end() using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<long long, long long> Pll; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<long long> vll; typedef vector<vector<long long>> vvll; template <typename T...
#include <bits/stdc++.h> #define ALL(a) (a).begin(), (a).end() using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<long long, long long> Pll; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<long long> vll; typedef vector<vector<long long>> vvll; template <typename T...
delete
84
85
84
84
MLE
p02762
C++
Runtime Error
#include <bits/stdc++.h> #define FILE #define fr first #define se second using namespace std; const long long N = 2e5 + 7; const long long inf = 1e9 + 7; const long long mod = 1e9 + 7; int n; int m; int k; int x; int y; int c; vector<int> g[N]; vector<int> num(N, 0); vector<int> comp(N, -1); void dfs(int v, int c) ...
#include <bits/stdc++.h> #define FILE #define fr first #define se second using namespace std; const long long N = 2e5 + 7; const long long inf = 1e9 + 7; const long long mod = 1e9 + 7; int n; int m; int k; int x; int y; int c; vector<int> g[N]; vector<int> num(N, 0); vector<int> comp(N, -1); void dfs(int v, int c) ...
replace
22
23
22
23
-11
p02762
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define mfill(x, y) memset(x, y, sizeof(x)) #define all(v) v.begin(), v.end() #define in(x, y, h, w) if (0 <= x && x < h && 0 <= y && y < w) #define y0 y12345 #define y1 y54321 #ifdef LOCAL #define debug(...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define mfill(x, y) memset(x, y, sizeof(x)) #define all(v) v.begin(), v.end() #define in(x, y, h, w) if (0 <= x && x < h && 0 <= y && y < w) #define y0 y12345 #define y1 y54321 #ifdef LOCAL #define debug(...
replace
115
116
115
117
TLE
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (l...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (l...
replace
64
76
64
68
TLE
p02762
Python
Runtime Error
# 同じ木に属する(==そこまでたどりつけるかどうか)の判定にunionfind # 同じ木に属しているノードはあとで数えることができる(そうだね) # 除外するやつが出てくる。直の友達+ブロック関係にあるやつ(と自分) # 同じ木に属しているノードの総数 - (直の友達+ブロック関係+自分自身)が答え n, m, k = map(int, input().split()) par = [i for i in range(n)] ans = [0 for _ in range(n)] def root(x): if x == par[x]: return x y = root(par[x]) ...
# 同じ木に属する(==そこまでたどりつけるかどうか)の判定にunionfind # 同じ木に属しているノードはあとで数えることができる(そうだね) # 除外するやつが出てくる。直の友達+ブロック関係にあるやつ(と自分) # 同じ木に属しているノードの総数 - (直の友達+ブロック関係+自分自身)が答え from sys import setrecursionlimit setrecursionlimit(10**8) n, m, k = map(int, input().split()) par = [i for i in range(n)] ans = [0 for _ in range(n)] def root(x): ...
insert
4
4
4
7
0
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; void textIO() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } void fastIO() { ios_base::sync_with_stdio(0); cin.tie(0); } struct ps { long long par, sz; }; #define N 1e5 + 5 vector<ps> par(N); long long Fin...
#include <bits/stdc++.h> using namespace std; void textIO() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } void fastIO() { ios_base::sync_with_stdio(0); cin.tie(0); } struct ps { long long par, sz; }; #define N 1e5 + 5 vector<ps> par(N); long long Fin...
replace
39
40
39
40
-11
p02762
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define sqr(x) ((x) * (x)) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() typedef long long ll; const int MOD = 1000000007; const int INF = 1000000007; const ll INFLL = 1000000000000000007LL; struct UnionFind { vec...
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define sqr(x) ((x) * (x)) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() typedef long long ll; const int MOD = 1000000007; const int INF = 1000000007; const ll INFLL = 1000000000000000007LL; struct UnionFind { vec...
replace
22
23
22
23
TLE
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep2(i, n) for (int i = 0; i <= n; i++) #define repr(i, a, n) for (int i = a; i < n; i++) #define all(a) a.begin(), a.end() #define P pair<long long, ...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep2(i, n) for (int i = 0; i <= n; i++) #define repr(i, a, n) for (int i = a; i < n; i++) #define all(a) a.begin(), a.end() #define P pair<long long, ...
replace
75
76
75
76
0
p02762
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> typedef long long ll; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> typedef long long ll; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const...
replace
49
50
49
50
TLE
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; class UnionFind { private: vector<int> par; public: UnionFind(int N) { par.resize(N); for (int i = 0; i < N; i++) par[i] = i; } int root(int x) { return (x == par[x]) ? x : (par[x] = root(par[x...
#include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; class UnionFind { private: vector<int> par; public: UnionFind(int N) { par.resize(N); for (int i = 0; i < N; i++) par[i] = i; } int root(int x) { return (x == par[x]) ? x : (par[x] = root(par[x...
replace
30
31
30
31
0
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define ff first #define ss second #define all(x) (x).begin(), (x).end() #define ll long long #define ii pair<int, int> #define vi vector<int> #define vll vector<ll> #define vii vector<ii> const int maxn = 1e5 + 10; const int mod = 1e9 + 7; using nam...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define ff first #define ss second #define all(x) (x).begin(), (x).end() #define ll long long #define ii pair<int, int> #define vi vector<int> #define vll vector<ll> #define vii vector<ii> const int maxn = 1e5 + 10; const int mod = 1e9 + 7; using nam...
insert
49
49
49
51
TLE
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int id; vector<int> cc_id; void dfs(vector<vector<int>> G, int v, int &cnt) { cc_id[v] = id; cnt++; for (auto i : G[v]) { if (cc_id[i] != -1) continue; dfs(G, i, cnt); } } int main() { int N, M, K; ci...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int id; vector<int> cc_id; void dfs(vector<vector<int>> &G, int v, int &cnt) { cc_id[v] = id; cnt++; for (auto i : G[v]) { if (cc_id[i] != -1) continue; dfs(G, i, cnt); } } int main() { int N, M, K; c...
replace
5
6
5
6
TLE
p02762
C++
Runtime Error
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < n; i++)...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < n; i++)...
replace
63
64
63
64
-11
p02762
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> #define N 100005 using namespace std; int n, m, k, a[N], b[N], pr[N], cp[N], cm[N]; int fnd(int p) { return pr[p] == p ? p : fnd(pr[p]); } int main() { int i, x, y; cin >> n >> m >> k; for (i = 1; i <= n; i++) pr[i] = i, cp[i] = 1; while (m--) { scanf("%d%d", &x,...
#include <cstdio> #include <iostream> #define N 100005 using namespace std; int n, m, k, a[N], b[N], pr[N], cp[N], cm[N]; int fnd(int p) { return pr[p] == p ? p : pr[p] = fnd(pr[p]); } int main() { int i, x, y; cin >> n >> m >> k; for (i = 1; i <= n; i++) pr[i] = i, cp[i] = 1; while (m--) { scanf("%d...
replace
7
8
7
8
TLE
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> // #include<iostream> using namespace std; const int N = 1e5 + 5; int pa[N], cnt[N], fr[N]; int n, m, k; int search(int x) { return pa[x] == x ? x : search(pa[x]); } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n >> m >> k; // while(cin>>n>>m>>k) ...
#include <bits/stdc++.h> // #include<iostream> using namespace std; const int N = 1e5 + 5; int pa[N], cnt[N], fr[N]; int n, m, k; int search(int x) { // return pa[x]==pa[pa[x]]?pa[x]:pa[x]=search(pa[x]); if (pa[x] != pa[pa[x]]) pa[x] = search(pa[x]); return pa[x]; } int main() { ios_base::sync_with_stdio(fa...
replace
6
7
6
12
TLE
p02762
Python
Runtime Error
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import defaultdict def main(): n, m, k = map(int, input().split()) fr_ed_c = defaultdict(int) # node -> count parents = {} # node -> parent_node root_2_nc = {} # node -> count for i in range(m): a, b = map(int, input()....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import defaultdict def main(): n, m, k = map(int, input().split()) fr_ed_c = defaultdict(int) # node -> count parents = {} # node -> parent_node root_2_nc = {} # node -> count for i in range(m): a, b = map(int, input()....
replace
49
50
49
50
0
p02762
Python
Runtime Error
class UnionFind: def __init__(self, n_nodes): self.parent = [i for i in range(n_nodes)] self.rank = [0] * n_nodes self.size = [1] * n_nodes def find(self, x): if x == self.parent[x]: return x else: self.parent[x] = self.find(self.parent[x]) ...
import sys sys.setrecursionlimit(10**6) class UnionFind: def __init__(self, n_nodes): self.parent = [i for i in range(n_nodes)] self.rank = [0] * n_nodes self.size = [1] * n_nodes def find(self, x): if x == self.parent[x]: return x else: self.p...
insert
0
0
0
5
0
p02762
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; struct UnionFind { vector<int> par; UnionFind(int N) : par(N) { for (int i = 0; i < N; i++) par[i] = i; } int root(int x) { if (par[x] == x) return x; retu...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; struct UnionFind { vector<int> par; UnionFind(int N) : par(N) { for (int i = 0; i < N; i++) par[i] = i; } int root(int x) { if (par[x] == x) return x; retu...
replace
61
67
61
70
TLE
p02762
C++
Runtime Error
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 50010 struct uftree { int cnt; int rank; int parent; } set[MAX]; int fr[100000 + 5]; void make_set(int n) { int i; for (i = 0; i <= n; i++) { set[i].cnt = 1; set[i].rank = 0; set[i].parent = i; } } int set_find(int x) { if ...
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 100010 struct uftree { int cnt; int rank; int parent; } set[MAX]; int fr[100000 + 5]; void make_set(int n) { int i; for (i = 0; i <= n; i++) { set[i].cnt = 1; set[i].rank = 0; set[i].parent = i; } } int set_find(int x) { if...
replace
3
4
3
4
0
p02762
C++
Runtime Error
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~= * * WRITER:kakitamasziru/OxOmisosiru * * ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/ #ifdef LOCAL_JUDGE #define _GLIBCXX_DEBUG // FOR THE DEBUG! COMMENT OUT THIS WHEN SUBMITTING! #endif #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <cstdin...
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~= * * WRITER:kakitamasziru/OxOmisosiru * * ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/ #ifdef LOCAL_JUDGE #define _GLIBCXX_DEBUG // FOR THE DEBUG! COMMENT OUT THIS WHEN SUBMITTING! #endif #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <cstdin...
replace
104
107
104
107
-11
p02762
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define ll long long #define P pair<int, int> #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define ll long long #define P pair<int, int> #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
replace
83
84
83
84
0
p02762
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define SZ(x) ((int)(x).size()) #define rep(i, m, n) for (int i = (m); i < (n); ++i) #define fore(i, a) for (auto &i : a) #define Yes cout << "Yes" << endl; #define No cout << "No" << endl; #define answ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define SZ(x) ((int)(x).size()) #define rep(i, m, n) for (int i = (m); i < (n); ++i) #define fore(i, a) for (auto &i : a) #define Yes cout << "Yes" << endl; #define No cout << "No" << endl; #define answ...
replace
48
51
48
51
-11
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rp(i, k, n) for (int i = k; i < n; i++) typedef long long ll; typedef double ld; template <class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, const T &b) { if (b < a...
#include <bits/stdc++.h> using namespace std; #define rp(i, k, n) for (int i = k; i < n; i++) typedef long long ll; typedef double ld; template <class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, const T &b) { if (b < a...
replace
36
37
36
37
0
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; void dfs(int &m, int p, int t, vector<vector<int>> frd, vector<bool> &ald, vector<int> &group) { if (ald[p] == true) { return; } ald[p] = true; m++; group[p] = t; for (int x : frd[p]) { dfs(m, x, t, frd, ald, group); } return; } // DFS  in...
#include <bits/stdc++.h> using namespace std; void dfs(int &m, int p, int t, const vector<vector<int>> &frd, vector<bool> &ald, vector<int> &group) { if (ald[p] == true) { return; } ald[p] = true; m++; group[p] = t; for (int x : frd[p]) { dfs(m, x, t, frd, ald, group); } return; } // D...
replace
3
5
3
5
TLE
p02762
Python
Runtime Error
import sys sys.setrecursionlimit(10**6) INF = float("inf") MOD = 10**9 + 7 def input(): return sys.stdin.readline().strip() class UnionFind: def __init__(self, n_nodes): self.n_nodes = n_nodes # self.parents[x] < 0 の時,xが根である. # また,xが根の時,(-1) * (同一グループの要素数) が格納されるようになる. self...
import sys sys.setrecursionlimit(10**6) INF = float("inf") MOD = 10**9 + 7 def input(): return sys.stdin.readline().strip() class UnionFind: def __init__(self, n_nodes): self.n_nodes = n_nodes # self.parents[x] < 0 の時,xが根である. # また,xが根の時,(-1) * (同一グループの要素数) が格納されるようになる. self...
replace
80
81
80
81
0
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; // #define int ll typedef vector<int> vi; typedef vector<bool> vb; typedef pair<int, int> pii; typedef vector<pair<int, int>> vpii; typedef vector<vector<bool>> vvb; typedef map<int, bool> mib; typedef long long ll; typedef vector<long long> vl; type...
#include <bits/stdc++.h> using namespace std; using ll = long long; // #define int ll typedef vector<int> vi; typedef vector<bool> vb; typedef pair<int, int> pii; typedef vector<pair<int, int>> vpii; typedef vector<vector<bool>> vvb; typedef map<int, bool> mib; typedef long long ll; typedef vector<long long> vl; type...
replace
115
117
115
117
0
p02762
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 1000000007, INF = 1010101010; constex...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 1000000007, INF = 1010101010; constex...
replace
72
73
72
73
0
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct UnionFind { vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 UnionFind(int N) : par(N) { // 最初は全てが根であるとして初期化 for (int i = 0; i < N; i++) par[i] = i; } int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根} if (...
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct UnionFind { vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2 UnionFind(int N) : par(N) { // 最初は全てが根であるとして初期化 for (int i = 0; i < N; i++) par[i] = i; } int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根} if (...
replace
44
45
44
45
0
p02762
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const int INF = 1 << 30; const long long LINF = 1LL << 60; const long long MOD = (long long)1e9 + 7; struct Union_find { vector<int> par; vector<int> cnt; Union_find(int p) { par = vector<int>(p + 1); cnt = vector<int>(p + 1, 1); ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const int INF = 1 << 30; const long long LINF = 1LL << 60; const long long MOD = (long long)1e9 + 7; struct Union_find { vector<int> par; vector<int> cnt; Union_find(int p) { par = vector<int>(p + 1); cnt = vector<int>(p + 1, 1); ...
delete
46
47
46
46
MLE
p02762
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define printVec(v) \ printf("{"); \ for (const auto &i : v) { \ ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define printVec(v) \ printf("{"); \ for (const auto &i : v) { \ ...
replace
52
53
52
53
0
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define P pair<int, int> #define PI 3.141592653589793 const int INF = 1000000; struct Unionfind { vector<int> parent; Unionfind(int N) { parent = vector<int>(N, -1); } int root(int x) { // 親の...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define P pair<int, int> #define PI 3.141592653589793 const int INF = 1000000; struct Unionfind { vector<int> parent; Unionfind(int N) { parent = vector<int>(N, -1); } int root(int x) { // 親の...
replace
68
69
68
69
0
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <list> #include <unordered_map> #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 1e9 using namespace std; typedef long long ll; // class to represent a disjoint set class DisjointSet { unordered_map<int, int> parent; public...
#include <bits/stdc++.h> #include <list> #include <unordered_map> #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 1e9 using namespace std; typedef long long ll; // class to represent a disjoint set class DisjointSet { unordered_map<int, int> parent; public...
replace
29
31
29
31
TLE
p02762
Python
Time Limit Exceeded
import sys sys.setrecursionlimit(10**8) input = sys.stdin.readline class UnionFind: def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) ...
import sys sys.setrecursionlimit(10**8) input = sys.stdin.readline class UnionFind: def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) ...
replace
78
79
78
79
TLE
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; void dfs(int group_num, int now, vector<vector<int>> fr, vector<int> &group) { /*深さ有線探索 group_num:見る頂点のグループ番号 now:見る頂点の頂点番号 fr:友人関係のグラフの隣接リスト表現 group:頂点のグループ番号を格納した配列 */ group.at(now) = group_num; for (auto p : fr.at(now)) { // now...
#include <bits/stdc++.h> using namespace std; typedef long long ll; void dfs(int group_num, int now, vector<vector<int>> &fr, vector<int> &group) { /*深さ有線探索 group_num:見る頂点のグループ番号 now:見る頂点の頂点番号 fr:友人関係のグラフの隣接リスト表現 group:頂点のグループ番号を格納した配列 */ group.at(now) = group_num; for (auto p : fr.at(now)) { // no...
replace
4
5
4
5
TLE
p02762
C++
Time Limit Exceeded
// #include <bits/stdc++.h> #include <algorithm> #include <iostream> #include <array> #include <bitset> #include <complex> #include <cstring> #include <deque> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include...
// #include <bits/stdc++.h> #include <algorithm> #include <iostream> #include <array> #include <bitset> #include <complex> #include <cstring> #include <deque> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include...
replace
228
229
228
229
TLE
p02762
C++
Runtime Error
// --------------------<optimizations>-------------------- #pragma GCC optimize("O3") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\ #pragma comment(linker, "/stack:200000000") //(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\ #pragma GCC optimize("unroll-loops") #pragma GCC optimize("Ofast") #pragma GCC tar...
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define mp make_pair #define pb push_back #define eb emplace_back #define pii pair<ll, ll> #define vpii vector<pair<ll, ll>> #define F first #define S second #define ld long double #define built __builtin_popcountll #define mst(a...
delete
0
11
0
0
0
p02762
C++
Runtime Error
#include <cmath> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; using ll = long long int; struct UnionFind { vector<int> d; UnionFind(int n) : d(n, -1) {} int root(int x) { if (d[x] < 0) return x; return d[x] = root...
#include <cmath> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; using ll = long long int; struct UnionFind { vector<int> d; UnionFind(int n) : d(n, -1) {} int root(int x) { if (d[x] < 0) return x; return d[x] = root...
replace
34
35
34
35
0
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int par[100003], fz[100005], bz[100005], cnt, dsz[100005]; vector<int> adj[100005], bdj[100005]; int dfs(int src, int pr) { par[src] = pr; int sz = fz[src]; cnt++; for (int lp = 0; lp < sz; lp++) { int u = adj[src][lp]; if (par[u] == 0) { dfs(u, pr...
#include <bits/stdc++.h> using namespace std; int par[100003], fz[100005], bz[100005], cnt, dsz[100005]; vector<int> adj[100005], bdj[100005]; void dfs(int src, int pr) { par[src] = pr; int sz = fz[src]; cnt++; for (int lp = 0; lp < sz; lp++) { int u = adj[src][lp]; if (par[u] == 0) { dfs(u, p...
replace
6
7
6
7
0
p02762
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> const int MAX_N = 100001; int par[MAX_N]; int rank[MAX_N]; int nele[MAX_N]; void init() { for (int i = 0; i < MAX_N; ++i) { par[i] = i; rank[i] = 0; nele[i] = 1; } } int root(int x) { if (par[x] == x) return x; else return par[x]...
#include <algorithm> #include <iostream> #include <vector> const int MAX_N = 100001; int par[MAX_N]; int rank[MAX_N]; int nele[MAX_N]; void init() { for (int i = 0; i < MAX_N; ++i) { par[i] = i; rank[i] = 0; nele[i] = 1; } } int root(int x) { if (par[x] == x) return x; else return par[x]...
replace
73
78
73
74
TLE
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using llint = long long int; #define rep(i, c) for (int i = 0; i < (int)c; ++i) // c 回繰り返す //////////////////////////クラス構造体/////////////////////////// class UnionFind { // UnionFind木 Nの数に注意 0=<x<N まで作られる private: vector<int> par; public: UnionFind(int N) : par(N, -1...
#include <bits/stdc++.h> using namespace std; using llint = long long int; #define rep(i, c) for (int i = 0; i < (int)c; ++i) // c 回繰り返す //////////////////////////クラス構造体/////////////////////////// class UnionFind { // UnionFind木 Nの数に注意 0=<x<N まで作られる private: vector<int> par; public: UnionFind(int N) : par(N, -1...
replace
45
46
45
46
0
p02762
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; struct UnionFind { vector<int> d; UnionFind(int n = 0) : d(n, -1) {} int find(int x) { if (d[x] < 0) return x; return d[x] = find(d[x]); } bool unite(int x, int y) { x = find(...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; struct UnionFind { vector<int> d; UnionFind(int n = 0) : d(n, -1) {} int find(int x) { if (d[x] < 0) return x; return d[x] = find(d[x]); } bool unite(int x, int y) { x = find(...
replace
28
30
28
30
0
p02762
C++
Time Limit Exceeded
#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse4") #include "bits/stdc++.h" using namespace std; #define sz(x) (int)(x).size(); inline int in() { int x; scanf("%d", &x); return x; } vector<int> siz; vector<int> par; vector<set<int>> f; vector<int> b; int find(int node) { ...
#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse4") #include "bits/stdc++.h" using namespace std; #define sz(x) (int)(x).size(); inline int in() { int x; scanf("%d", &x); return x; } vector<int> siz; vector<int> par; vector<set<int>> f; vector<int> b; int find(int node) { ...
replace
26
30
26
33
TLE
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; struct UnionFind { vector<int> par, rank; UnionFind(int s) { par.resize(s); rank.resize(s, 0); for (int i = 0; i < s; ++i) par[i] = i; } int root(int x) { return par[x] == x ? x : par[x] = root(par[x]); } bool same(int x, i...
#include <bits/stdc++.h> using namespace std; using ll = long long; struct UnionFind { vector<int> par, rank; UnionFind(int s) { par.resize(s); rank.resize(s, 0); for (int i = 0; i < s; ++i) par[i] = i; } int root(int x) { return par[x] == x ? x : par[x] = root(par[x]); } bool same(int x, i...
replace
29
30
29
30
0
p02762
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #defi...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #defi...
replace
55
56
55
56
0
p02762
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define P pair<int, int> using ll = int64_t; using namespace std; // UnionFind Template template <class T> struct UnionFind { // 構造体の定義 vector<T> d; // メンバ変数 UnionFind(T n = 0) : d(n, -1) { } // コンストラクタ(構造体が呼ばれた...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define P pair<int, int> using ll = int64_t; using namespace std; // UnionFind Template template <class T> struct UnionFind { // 構造体の定義 vector<T> d; // メンバ変数 UnionFind(T n = 0) : d(n, -1) { } // コンストラクタ(構造体が呼ばれた...
replace
35
36
35
36
0
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define P pair<ll, ll> vector<int> to[10010]; vector<int> group; vector<int> block; void dfs(int i, int gr, vector<int> &vec) { if (group[i] != -1) return; vec[gr]++; group[i] = gr; for...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define P pair<ll, ll> vector<int> to[100010]; vector<int> group; vector<int> block; void dfs(int i, int gr, vector<int> &vec) { if (group[i] != -1) return; vec[gr]++; group[i] = gr; fo...
replace
6
7
6
7
0
p02762
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using llong = long long; //=== struct UnionFind { int n; v...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using llong = long long; //=== struct UnionFind { int n; v...
replace
59
60
59
60
0
p02762
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define all(x) (x).begin(), (x).end() #define sz(x) int(x.size()) #define get_unique(x) x.erase(unique(all(x)), x.end()); typedef long long ll; typedef complex<do...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define all(x) (x).begin(), (x).end() #define sz(x) int(x.size()) #define get_unique(x) x.erase(unique(all(x)), x.end()); typedef long long ll; typedef complex<do...
replace
53
54
53
54
0
p02762
C++
Runtime Error
#include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> using namespace std; #defi...
#include <algorithm> #include <cmath> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> using namespace std; #defi...
replace
132
137
132
137
0
p02762
C++
Time Limit Exceeded
#include <bits/stdc++.h> #pragma GCC optimize("O2") using namespace std; template <typename T> inline void read(T &x) { x = 0; int f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') x = x * 10 + (ch ^ 48), ch =...
#include <bits/stdc++.h> #pragma GCC optimize("O2") using namespace std; template <typename T> inline void read(T &x) { x = 0; int f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') x = x * 10 + (ch ^ 48), ch =...
replace
38
39
38
39
TLE