problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p02678
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> using namespace std; int mark[10005]; vector<int> m[10005]; int main() { int n, md; queue<int> q; cin >> n >> md; for (int i = 0; i < md; i++) { int a, b; cin >> a >> b; m[a].push_back(b); m[b].push_back(a); } q.push(1); while (!...
#include <iostream> #include <queue> #include <vector> using namespace std; int mark[100005]; vector<int> m[100005]; int main() { int n, md; queue<int> q; cin >> n >> md; for (int i = 0; i < md; i++) { int a, b; cin >> a >> b; m[a].push_back(b); m[b].push_back(a); } q.push(1); while ...
replace
6
8
6
8
0
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { long N, M; cin >> N >> M; vector<long> data(N, INT_MAX); vector<vector<long>> path(N, vector<long>(N)); long a, b; for (int i = 0; i < M; i++) { cin >> a >> b; path.at(a - 1).push_back(b - 1); path.at(b - 1).push_back(a - 1); } queue...
#include <bits/stdc++.h> using namespace std; int main() { long N, M; cin >> N >> M; vector<long> data(N, INT_MAX); vector<vector<long>> path(N, vector<long>()); long a, b; for (int i = 0; i < M; i++) { cin >> a >> b; path.at(a - 1).push_back(b - 1); path.at(b - 1).push_back(a - 1); } queue<...
replace
6
7
6
7
TLE
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int nodes, edges; cin >> nodes >> edges; vector<int> adj[nodes + 1]; vector<bool> visited(nodes + 1); vector<int> ans(nodes + 1); for (int i = 1; i <= edges; i++) { int u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); ...
#include <bits/stdc++.h> using namespace std; int main() { int nodes, edges; cin >> nodes >> edges; vector<int> adj[nodes + 1]; vector<bool> visited(nodes + 1); vector<int> ans(nodes + 1); for (int i = 1; i <= edges; i++) { int u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); ...
replace
24
25
24
25
TLE
p02678
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define MOD 1000000007 // #define MOD 998244353 const double EPS = 1e-9; #define INF (1LL << 60) #define D double #define fs first #define sc second #define int long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define RFOR(i, a, b) for (int i = (int)...
#include "bits/stdc++.h" using namespace std; #define MOD 1000000007 // #define MOD 998244353 const double EPS = 1e-9; #define INF (1LL << 60) #define D double #define fs first #define sc second #define int long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define RFOR(i, a, b) for (int i = (int)...
replace
51
52
51
52
0
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = int64_t; #define int int64_t /* ==== declarations ====== */ // functions void solve(); void getInput(); // global variables int N, M; vector<vector<int>> AL; vector<int> D; vector<int> ans; const int INF = 1e9; /* ======================== */ void getInput()...
#include <bits/stdc++.h> using namespace std; using ll = int64_t; #define int int64_t /* ==== declarations ====== */ // functions void solve(); void getInput(); // global variables int N, M; vector<vector<int>> AL; vector<int> D; vector<int> ans; const int INF = 1e9; /* ======================== */ void getInput()...
replace
55
56
55
56
TLE
p02678
C++
Runtime Error
// Author: pankaj_m05 // Problem: D // Created: 17.05.2020 18:20:52 #include <bits/stdc++.h> #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define f_in(file) freopen(file, "r", stdin) #d...
// Author: pankaj_m05 // Problem: D // Created: 17.05.2020 18:20:52 #include <bits/stdc++.h> #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define f_in(file) freopen(file, "r", stdin) #d...
replace
31
33
31
33
0
p02678
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> using namespace std; const int INF = 1001001001; vector<int> to[10005]; // 行き先 int main(void) { int N, M; cin >> N >> M; for (int i = 0; i < M; i++) { int A, B; cin >> A >> B; --A; --B; // 部屋番号を1ずらす to[A].push_back(B); to[B].push_bac...
#include <iostream> #include <queue> #include <vector> using namespace std; const int INF = 1001001001; vector<int> to[100005]; // 行き先 int main(void) { int N, M; cin >> N >> M; for (int i = 0; i < M; i++) { int A, B; cin >> A >> B; --A; --B; // 部屋番号を1ずらす to[A].push_back(B); to[B].push_ba...
replace
6
7
6
7
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> #define int long long #define rng(i, l, r) for (size_t i = (l); i < (r); ++i) #define rep(i, n) rng(i, 0, n) #define gnr(i, l, r) for (size_t i = (r)-1; i >= (l); i--) #define per(i, b) gnr(i, 0, b) #define ALL(obj) (obj).begin(), (obj).end() // 1,2,3,... #define rALL(obj) (obj).rbegin(), (o...
#include <bits/stdc++.h> #define int long long #define rng(i, l, r) for (size_t i = (l); i < (r); ++i) #define rep(i, n) rng(i, 0, n) #define gnr(i, l, r) for (size_t i = (r)-1; i >= (l); i--) #define per(i, b) gnr(i, 0, b) #define ALL(obj) (obj).begin(), (obj).end() // 1,2,3,... #define rALL(obj) (obj).rbegin(), (o...
replace
18
20
18
20
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define M0D 998244353; vector<int> G[100009]; int ans[100009]; queue<int> test; void answww(int num, int sup) { test.pop(); for (int j = 0; j < G[num].size(); j++) { if (ans[G[num][j]] == 0) { test.push(G[num][j]); ans[G[num][j]] = num; } } answ...
#include <bits/stdc++.h> using namespace std; #define M0D 998244353; vector<int> G[100009]; int ans[100009]; queue<int> test; void answww(int num, int sup) { test.pop(); for (int j = 0; j < G[num].size(); j++) { if (ans[G[num][j]] == 0) { test.push(G[num][j]); ans[G[num][j]] = num; } } if (...
replace
15
16
15
17
-11
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; bool vis[10005]; pair<int, int> dist[10005]; const int INF = 1e9; void bfs(vector<vector<int>> graph) { dist[0].first = 0; vis[0] = true; queue<int> q; q.push(0); while (!q.empty()) { int v = q.front(); q.pop(); for (auto u : graph[v]) { if (!v...
#include <bits/stdc++.h> using namespace std; bool vis[100005]; pair<int, int> dist[100005]; const int INF = 1e9; void bfs(vector<vector<int>> graph) { dist[0].first = 0; vis[0] = true; queue<int> q; q.push(0); while (!q.empty()) { int v = q.front(); q.pop(); for (auto u : graph[v]) { if (...
replace
3
5
3
5
0
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // 総数を1000000007(素数)で割った余り 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 vec...
#include <bits/stdc++.h> using namespace std; // 総数を1000000007(素数)で割った余り 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 vec...
replace
45
46
45
46
TLE
p02678
C++
Runtime Error
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; // constexpr ll MOD = 998244353; constexpr ll MOD = 1000000007...
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; // constexpr ll MOD = 998244353; constexpr ll MOD = 1000000007...
replace
85
86
85
86
0
p02678
C++
Time Limit Exceeded
#include <cstdio> #include <queue> #include <vector> using namespace std; int main() { int n, m; vector<vector<int>> nodes; vector<int> length; vector<int> parents; scanf("%d%d", &n, &m); nodes.resize(n); length.resize(n); parents.resize(n); for (int i = 0; i < n; ++i) { length[i] = ((i == 0)...
#include <cstdio> #include <queue> #include <vector> using namespace std; int main() { int n, m; vector<vector<int>> nodes; vector<int> length; vector<int> parents; scanf("%d%d", &n, &m); nodes.resize(n); length.resize(n); parents.resize(n); for (int i = 0; i < n; ++i) { length[i] = ((i == 0)...
replace
44
45
44
45
TLE
p02678
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> #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; int a, b; vector<vector<int>> to(m, vector<int>()); rep(i, m) { cin >> a >> b; a--; ...
#include <iostream> #include <queue> #include <vector> #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; int a, b; vector<vector<int>> to(n, vector<int>()); rep(i, m) { cin >> a >> b; a--; ...
replace
12
13
12
13
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; void bfs(vector<vector<int>> &G, vector<int> &dist, vector<int> &prev, int start) { dist[start] = 0; queue<int> q; q.push(start); while (!q.empty()) { int v = q.front(); q.pop(); for (int next_v : G[v]) { if (dist[next_v] != -1) c...
#include <bits/stdc++.h> using namespace std; void bfs(vector<vector<int>> &G, vector<int> &dist, vector<int> &prev, int start) { dist[start] = 0; queue<int> q; q.push(start); while (!q.empty()) { int v = q.front(); q.pop(); for (int next_v : G[v]) { if (dist[next_v] != -1) c...
replace
24
25
24
25
0
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<vector<int>> G(N, vector<int>(N)); for (int i = 0; i < M; ++i) { int a, b; cin >> a >> b; --a; --b; G[a].push_back(b); G[b].push_back(a); } vector<int> ans(N); using P = pair<int, int>; q...
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<vector<int>> G(N, vector<int>()); for (int i = 0; i < M; ++i) { int a, b; cin >> a >> b; --a; --b; G[a].push_back(b); G[b].push_back(a); } vector<int> ans(N); using P = pair<int, int>; qu...
replace
6
7
6
7
TLE
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef pair<long long, long long> pll; int main() { long long n, m, a, b; cin >> n >> m; vector<vector<long long>> adj(n, vector<long long>()); while (m--) { cin >> a >> b; a--; b--; adj[a].push_back(b); adj[b].pu...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef pair<long long, long long> pll; int main() { long long n, m, a, b; cin >> n >> m; vector<vector<long long>> adj(n, vector<long long>()); while (m--) { cin >> a >> b; a--; b--; adj[a].push_back(b); adj[b].pu...
replace
44
51
44
46
TLE
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 0x3f3f3f3f; const int N = 1e5 + 5; struct Edge { int to, w, next; } edge[N]; struct node { int id, d; node(int x, int y) { id = x; d = y; } bool operator<(const node &a) const { return d > a.d; } }; int head[N]; int ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 0x3f3f3f3f; const int N = 5e5 + 5; struct Edge { int to, w, next; } edge[N]; struct node { int id, d; node(int x, int y) { id = x; d = y; } bool operator<(const node &a) const { return d > a.d; } }; int head[N]; int ...
replace
4
5
4
5
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // ダイクストラ // 負の重みの辺を含むグラフには適用できない int N, M; const int INF = 1000000000; vector<int> p; vector<vector<pair<int, int>>> G; // first : 頂点, second : 有向辺の重み void dijkstra(int r) { // first : スタート地点からのコスト, second : 頂点 priority_queue<pair<int, int>, vector<pair<int, int>>, ...
#include <bits/stdc++.h> using namespace std; // ダイクストラ // 負の重みの辺を含むグラフには適用できない int N, M; const int INF = 1000000000; vector<int> p; vector<vector<pair<int, int>>> G; // first : 頂点, second : 有向辺の重み void dijkstra(int r) { // first : スタート地点からのコスト, second : 頂点 priority_queue<pair<int, int>, vector<pair<int, int>>, ...
replace
48
49
48
49
0
p02678
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; int read() { int ans = 0, f = 1; char c = getchar(); while (c > '9' || c < '0') { if (c...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; int read() { int ans = 0, f = 1; char c = getchar(); while (c > '9' || c < '0') { if (c...
replace
29
30
29
30
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i < (n + 1); ++i) using namespace std; using ll = long long; const ll INF = +10010010000; typedef pair<ll, ll> P; const int mod = 1e9 + 7; struct mint { ll x; mint(ll x = 0) : x((x % m...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i < (n + 1); ++i) using namespace std; using ll = long long; const ll INF = +10010010000; typedef pair<ll, ll> P; const int mod = 1e9 + 7; struct mint { ll x; mint(ll x = 0) : x((x % m...
replace
73
82
73
74
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; using Graph = vector<vector<int>>; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; queue<int> U; vector<int> dist; vector<int> d(10101); void dfs(const Graph &G, int v) { U.push(v); dist[v] = 0; while (!U.empty()) { int v_2...
#include <bits/stdc++.h> #include <iostream> using namespace std; using Graph = vector<vector<int>>; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; queue<int> U; vector<int> dist; vector<int> d(101010); void dfs(const Graph &G, int v) { U.push(v); dist[v] = 0; while (!U.empty()) { int v_...
replace
8
9
8
9
0
p02678
C++
Runtime Error
// main.cpp // ABC168D #include <iostream> #include <queue> #include <vector> using namespace std; const int INF = 1001001001; int main(int argc, const char *argv[]) { int n, m; cin >> n >> m; vector<int> r[m + 1]; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; r[a].push_back(b); r[b]...
// main.cpp // ABC168D #include <iostream> #include <queue> #include <vector> using namespace std; const int INF = 1001001001; int main(int argc, const char *argv[]) { int n, m; cin >> n >> m; vector<int> r[100005]; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; r[a].push_back(b); r[b...
replace
11
12
11
12
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> i_i; #define reps(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) reps(i, 0, n) #define ALL(v) v.begin(), v.end() #define SZ(x) ((ll)(x).size()) const double PI = acos(-1.0); const double EPS = 1e...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> i_i; #define reps(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) reps(i, 0, n) #define ALL(v) v.begin(), v.end() #define SZ(x) ((ll)(x).size()) const double PI = acos(-1.0); const double EPS = 1e...
replace
33
34
33
34
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define all(v) v.begin(), v.end() typedef long long ll; typedef pair<ll, ll> P; typedef vector<ll> vec; typedef vector<vec> mat; int V, d[200001], r[200001], z[200001]; vector<int> G[200001]; int bfs(int s) { rep(i, V + 1) d[i]...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define all(v) v.begin(), v.end() typedef long long ll; typedef pair<ll, ll> P; typedef vector<ll> vec; typedef vector<vec> mat; int V, d[200001], r[200001], z[200001]; vector<int> G[200001]; void bfs(int s) { rep(i, V + 1) d[i...
replace
10
11
10
11
0
p02678
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define ll long long #define rep(i, n) for (ll i = 0; i < (n); ++i) using namespace std; int main() { ll N, M, count, m; cin >> N >> M; vector<ll> A(M), B(M), X(N, -1), v; vector<vector<ll>> Y(N)...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define ll long long #define rep(i, n) for (ll i = 0; i < (n); ++i) using namespace std; int main() { ll N, M, count, m; cin >> N >> M; vector<ll> A(M), B(M), X(N, -1), v; vector<vector<ll>> Y(N)...
replace
21
28
21
24
TLE
p02678
C++
Runtime Error
#include "bits/stdc++.h" #define int long long #define endl '\n' using namespace std; typedef long long ll; #define db(x) cerr << #x << ": " << x << '\n'; #define read(a) \ int a; \ ...
#include "bits/stdc++.h" #define int long long #define endl '\n' using namespace std; typedef long long ll; #define db(x) cerr << #x << ": " << x << '\n'; #define read(a) \ int a; \ ...
replace
70
72
70
72
0
p02678
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> // #include <boost/multiprecision/cpp_int.hpp...
#include <algorithm> #include <bitset> #include <cassert> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> // #include <boost/multiprecision/cpp_int.hpp...
replace
85
86
85
86
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; using pli = pair<ll, int>; using pil = pair<int, ll>; using uint = unsigned int; template <typename T> using Graph = vector<vector<T>>; const ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; using pli = pair<ll, int>; using pil = pair<int, ll>; using uint = unsigned int; template <typename T> using Graph = vector<vector<T>>; const ...
replace
21
22
21
22
0
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; using vvll = vector<vector<ll>>; using vll = vector<ll>; #define ordered_set \ tree<...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; using vvll = vector<vector<ll>>; using vll = vector<ll>; #define ordered_set \ tree<...
insert
121
121
121
122
TLE
p02678
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> int N, M; // std::vector<int> A, B; int A, B; std::vector<std::vector<int>> adj_list; std::vector<int> sign; std::queue<int> que; int main() { std::cin >> N >> M; // A.assign(M, 0); // B.assign(M, 0); ...
#include <algorithm> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> int N, M; // std::vector<int> A, B; int A, B; std::vector<std::vector<int>> adj_list; std::vector<int> sign; std::queue<int> que; int main() { std::cin >> N >> M; // A.assign(M, 0); // B.assign(M, 0); ...
replace
18
19
18
19
0
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); ++(i)) #define REPV(iter, v) \ for (auto(iter) = (v).begin(); (iter) != (v).end(); ++(iter)) #define ALL(v) (v).begin(), (v).end() #define MOD 1000000007 using namespace std; typedef lon...
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); ++(i)) #define REPV(iter, v) \ for (auto(iter) = (v).begin(); (iter) != (v).end(); ++(iter)) #define ALL(v) (v).begin(), (v).end() #define MOD 1000000007 using namespace std; typedef lon...
replace
37
38
37
38
TLE
p02678
C++
Runtime Error
#include <bits/stdc++.h> typedef long long lint; using namespace std; lint gcd(lint x, lint y) { if (x == 0) { return y; } else { return gcd(y % x, x); } } lint lcm(lint x, lint y) { return abs(x - y) / gcd(x, y); } int main() { lint n, m; cin >> n >> m; vector<lint> a(m, 0), b(m, 0); for (lint...
#include <bits/stdc++.h> typedef long long lint; using namespace std; lint gcd(lint x, lint y) { if (x == 0) { return y; } else { return gcd(y % x, x); } } lint lcm(lint x, lint y) { return abs(x - y) / gcd(x, y); } int main() { lint n, m; cin >> n >> m; vector<lint> a(m, 0), b(m, 0); for (lint...
replace
22
23
22
23
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> #ifdef _PRINTDEBUG #include "lib/printdebug.hpp" #else #define printdebug(...) 1 #endif #define I_1000000007 (1000000007) #define I_998244353 (998244353) #define I_INF (1 << 28) #define L_INF (1LL << 60) #define rep(i, n) REP(i, 0, (n)) #define repc(i, n) REPC(i, 0, (n)) #define REP(i, n, m) f...
#include <bits/stdc++.h> #ifdef _PRINTDEBUG #include "lib/printdebug.hpp" #else #define printdebug(...) 1 #endif #define I_1000000007 (1000000007) #define I_998244353 (998244353) #define I_INF (1 << 28) #define L_INF (1LL << 60) #define rep(i, n) REP(i, 0, (n)) #define repc(i, n) REPC(i, 0, (n)) #define REP(i, n, m) f...
replace
45
46
45
46
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define endl '\n' typedef pair<int, int> P; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; vector<vector<int>> v(n); rep(i, n) { int a, ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define endl '\n' typedef pair<int, int> P; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; vector<vector<int>> v(n); rep(i, m) { int a, ...
replace
13
14
13
14
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; typedef long long ll; struct Edge { int to, next; } e[N]; int n, m, cnt, first[N], s[N], h, r, q[N << 2]; void add(int u, int v) { e[++cnt] = (Edge){v, first[u]}; first[u] = cnt; } int main() { cout << "Yes" << endl; cin >> n >> m; for...
#include <bits/stdc++.h> using namespace std; const int N = 4e5 + 5; typedef long long ll; struct Edge { int to, next; } e[N]; int n, m, cnt, first[N], s[N], h, r, q[N << 2]; void add(int u, int v) { e[++cnt] = (Edge){v, first[u]}; first[u] = cnt; } int main() { cout << "Yes" << endl; cin >> n >> m; for...
replace
3
4
3
4
0
p02678
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int n, m, a, b; cin >> n >> m; vector<vector<int>> G(m + 1); for (int i = 0; i < m; i++) { cin >> a >> b; G[a].push_back(b); G[b].push_back(a); } vector<int> ans(n + 1, -1); queue<int> q; q.push(1); ...
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int n, m, a, b; cin >> n >> m; vector<vector<int>> G(n + 1); for (int i = 0; i < m; i++) { cin >> a >> b; G[a].push_back(b); G[b].push_back(a); } vector<int> ans(n + 1, -1); queue<int> q; q.push(1); ...
replace
9
10
9
10
0
p02678
C++
Runtime Error
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; using ll = long long int; using pii = pair<int, int>; using pll = pair<ll, ll>; #define rep(i, N) for (ll i = 0; i < (N); ++i) int mai...
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; using ll = long long int; using pii = pair<int, int>; using pll = pair<ll, ll>; #define rep(i, N) for (ll i = 0; i < (N); ++i) int mai...
replace
22
23
22
23
0
p02678
C++
Runtime Error
/* @uthor: Amit Kumar user --> CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus; */ #include <bits/stdc++.h> #include <chrono> using namespace std; using namespace std::chrono; // #include <boost/multiprecision/cpp_int.hpp> // namespace mp = boost::multiprecision; // #define ln mp::cp...
/* @uthor: Amit Kumar user --> CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus; */ #include <bits/stdc++.h> #include <chrono> using namespace std; using namespace std::chrono; // #include <boost/multiprecision/cpp_int.hpp> // namespace mp = boost::multiprecision; // #define ln mp::cp...
replace
33
34
33
34
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, m; cin >> n >> m; vector<vector<int>> to(m); rep(i, m) { int a, b; cin >> a >> b; a--; b--; to[a].push_back(b); to[b].push_ba...
#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>; int main() { int n, m; cin >> n >> m; vector<vector<int>> to(n); rep(i, m) { int a, b; cin >> a >> b; a--; b--; to[a].push_back(b); to[b].push_ba...
replace
9
10
9
10
0
p02678
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; const int inf = 1001001001; int main() { int n, m; cin >> n >> m; vector<int> to[10005]; rep(i, m) { int a, b; cin >> a >> b; a--; b--; to[a].push_back(b); to[b].push_back...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int inf = 1001001001; int main() { int n, m; cin >> n >> m; vector<int> to[100005]; rep(i, m) { int a, b; cin >> a >> b; a--; b--; to[a].push_back(b); to[b].push_bac...
replace
9
10
9
10
0
p02678
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, a, b) for (int i = (a); i < (b); i++) #define per(i, a, b) for (int i = (b)-1; i >= (a); i--) #define pb push_back #define mp make_pair #define ...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, a, b) for (int i = (a); i < (b); i++) #define per(i, a, b) for (int i = (b)-1; i >= (a); i--) #define pb push_back #define mp make_pair #define ...
replace
27
28
27
28
0
p02678
C++
Runtime Error
#include <algorithm> #include <array> #include <cassert> // assert #include <cmath> // abs など #include <functional> // greater など #include <iostream> #include <numeric> // accumulate など #include <queue> #include <set> #include <stdexcept> #include <string> #include <tuple> #include <vector> using namespace std;...
#include <algorithm> #include <array> #include <cassert> // assert #include <cmath> // abs など #include <functional> // greater など #include <iostream> #include <numeric> // accumulate など #include <queue> #include <set> #include <stdexcept> #include <string> #include <tuple> #include <vector> using namespace std;...
replace
37
38
37
38
0
p02678
C++
Time Limit Exceeded
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<vector<int>> Map(N); vector<int> Ans(N - 1, -1); for (int i = 0; i < M; i++) { int A, B; cin >> A >> B; Map[A - 1].push_back(B - 1); Map[B - 1].push_back(A - 1); } queu...
#include <iostream> #include <queue> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; vector<vector<int>> Map(N); vector<int> Ans(N - 1, -1); for (int i = 0; i < M; i++) { int A, B; cin >> A >> B; Map[A - 1].push_back(B - 1); Map[B - 1].push_back(A - 1); } queu...
replace
28
29
28
30
TLE
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m, a, b; cin >> n >> m; vector<vector<int>> r(m + 1); vector<int> answer(n + 1); for (int i = 0; i < m; i++) { cin >> a >> b; r.at(a).push_back(b); r.at(b).push_back(a); } vector<bool> checked(n + 1, false); queue<int> q; q...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, a, b; cin >> n >> m; vector<vector<int>> r(n + 1); vector<int> answer(n + 1); for (int i = 0; i < m; i++) { cin >> a >> b; r.at(a).push_back(b); r.at(b).push_back(a); } vector<bool> checked(n + 1, false); queue<int> q; q...
replace
6
7
6
7
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define per(i, a, b) for (int i = (a); i >= (b); i--) #define rush() \ int T; \ scanf("%d", &T); ...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define per(i, a, b) for (int i = (a); i >= (b); i--) #define rush() \ int T; \ scanf("%d", &T); ...
replace
29
30
29
30
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; const int INF = 10000000; int main() { int n, m; cin >> n >> m; vector<int> to[1000001000]; rep(i, m) { int a, b; cin >> a >> b; a--; b--; to[a].push_back(b); to[b].push_back(a); } queu...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; const int INF = 10000000; int main() { int n, m; cin >> n >> m; vector<int> to[100005]; rep(i, m) { int a, b; cin >> a >> b; a--; b--; to[a].push_back(b); to[b].push_back(a); } queue<in...
replace
9
10
9
10
-11
p02678
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; const long long LI...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; const long long LI...
replace
31
32
31
32
0
p02678
C++
Time Limit Exceeded
#include <deque> #include <iostream> #include <vector> struct BFS { size_t N; size_t M; std::vector<std::vector<size_t>> Graph; std::vector<size_t> dist; std::vector<std::vector<size_t>> distMap; std::deque<size_t> que; std::vector<size_t> arrow; BFS() { std::cin >> N; std::cin >> M; Grap...
#include <deque> #include <iostream> #include <vector> struct BFS { size_t N; size_t M; std::vector<std::vector<size_t>> Graph; std::vector<size_t> dist; std::vector<std::vector<size_t>> distMap; std::deque<size_t> que; std::vector<size_t> arrow; BFS() { std::cin >> N; std::cin >> M; Grap...
replace
50
63
50
51
TLE
p02678
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> using namespace std; #define node_num 10005 #define edge_num 40005 #define INF 100000000 class node { public: // 这里的dis并不是主要的dis,只是用来比较,完善pq的 int id, dis; bool operator<(const node &a) const { return a.dis < dis; } }; int pre[edge_num]; i...
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> using namespace std; #define node_num 100005 #define edge_num 400005 #define INF 100000000 class node { public: // 这里的dis并不是主要的dis,只是用来比较,完善pq的 int id, dis; bool operator<(const node &a) const { return a.dis < dis; } }; int pre[edge_num];...
replace
5
7
5
7
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define rep(i, a, n) for (int i = a; i <= n; i++) #define per(i, n, a) for (int i = n; i >= a; i--) #define endl '\n' #define mem(a, b) memset(a, b, sizeof(a)) #define IO \ ios::sync_with_stdio(false); ...
#include <bits/stdc++.h> #define ll long long #define rep(i, a, n) for (int i = a; i <= n; i++) #define per(i, n, a) for (int i = n; i >= a; i--) #define endl '\n' #define mem(a, b) memset(a, b, sizeof(a)) #define IO \ ios::sync_with_stdio(false); ...
replace
13
14
13
14
0
p02678
C++
Runtime Error
// #include <bits/stdc++.h> using namespace std; typedef long long ll; // const int INF = 2147483647; // const ll INF = 9223372036854775807; // const ll MOD = 1e9 + 7; struct Node { vector<int> neighbors; bool visited = false; }; int N, M; Node nodes[2000]; map<int, int> signs; // 道しるべ void bfs(int start) { ...
// #include <bits/stdc++.h> using namespace std; typedef long long ll; // const int INF = 2147483647; // const ll INF = 9223372036854775807; // const ll MOD = 1e9 + 7; struct Node { vector<int> neighbors; bool visited = false; }; int N, M; Node nodes[100000]; map<int, int> signs; // 道しるべ void bfs(int start) {...
replace
16
17
16
17
0
p02678
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> #include <queue> using namespace std; const int N = 100001, M = 200002; const int INF = 0x7f7f7f7f; struct node { int i, value; friend bool operator<(node a, node b) { return a.value > b.value; } }; struct edge { int to, value; int next; } mem[M]; priorit...
#include <cstdio> #include <cstring> #include <iostream> #include <queue> using namespace std; const int N = 100001, M = 400004; const int INF = 0x7f7f7f7f; struct node { int i, value; friend bool operator<(node a, node b) { return a.value > b.value; } }; struct edge { int to, value; int next; } mem[M]; priorit...
replace
5
6
5
6
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define P pair<ll, ll> #define FOR(I, A, B) for (ll I = ll(A); I < ll(B); ++I) #define FORR(I, A, B) for (ll I = ll((B)-1); I >= ll(A); --I) #define TO(x, t, f) ((x) ? (t) : (f)) #define SORT(x) (sort(x.begin(), x.end())) // 0 2 2 3 4 5 8 9 #define POS...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define P pair<ll, ll> #define FOR(I, A, B) for (ll I = ll(A); I < ll(B); ++I) #define FORR(I, A, B) for (ll I = ll((B)-1); I >= ll(A); --I) #define TO(x, t, f) ((x) ? (t) : (f)) #define SORT(x) (sort(x.begin(), x.end())) // 0 2 2 3 4 5 8 9 #define POS...
replace
65
66
65
66
0
p02678
C++
Time Limit Exceeded
#include <iostream> using namespace std; #include <algorithm> #include <map> #include <string> #include <vector> typedef long long ll; #include <cmath> #include <iomanip> #include <queue> #include <set> const int MOD = 1000000007; ll POWER(ll x, ll y) { ll ret = 1; ll p = x; for (ll i = y; i > 0; i /= 2) { i...
#include <iostream> using namespace std; #include <algorithm> #include <map> #include <string> #include <vector> typedef long long ll; #include <cmath> #include <iomanip> #include <queue> #include <set> const int MOD = 1000000007; ll POWER(ll x, ll y) { ll ret = 1; ll p = x; for (ll i = y; i > 0; i /= 2) { i...
replace
58
59
58
59
TLE
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll LINF = 1e18; const int INF = 1e9; const ll MOD = 1000000007; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool...
#include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll LINF = 1e18; const int INF = 1e9; const ll MOD = 1000000007; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool...
replace
28
29
28
29
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; // #define ordered_set tree<int, null_type,less<int>, // r...
#include <bits/stdc++.h> using namespace std; #pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; // #define ordered_set tree<int, null_type,less<int>, // r...
replace
42
43
42
43
0
p02678
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include ...
#include <algorithm> #include <assert.h> #include <bitset> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include ...
replace
51
52
51
52
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAXN = 200010; int u, v, n, m, flag, cnt; int fa[MAXN], head[MAXN]; struct edge { int v, next; } e[MAXN]; void add(int u, int v) { e[++cnt].v = v; e[cnt].next = head[u]; head[u] = cnt; } void bfs() { queue<int> q; q.push(1); while (!q.empty()) { ...
#include <bits/stdc++.h> using namespace std; const int MAXN = 200010; int u, v, n, m, flag, cnt; int fa[MAXN], head[MAXN]; struct edge { int v, next; } e[MAXN << 1]; void add(int u, int v) { e[++cnt].v = v; e[cnt].next = head[u]; head[u] = cnt; } void bfs() { queue<int> q; q.push(1); while (!q.empty()) {...
replace
7
8
7
8
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; struct Edge { int next, to; } edge[N]; int fi[N], se, pre[N], que[N], s, t; inline void add_edge(int u, int v) { edge[++se] = {fi[u], v}, fi[u] = se; } inline void add(int u, int v) { add_edge(u, v), add_edge(v, u); } int main() { int n, m, u, v; ...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; struct Edge { int next, to; } edge[N * 2]; int fi[N], se, pre[N], que[N], s, t; inline void add_edge(int u, int v) { edge[++se] = {fi[u], v}, fi[u] = se; } inline void add(int u, int v) { add_edge(u, v), add_edge(v, u); } int main() { int n, m, u,...
replace
5
6
5
6
0
p02678
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int vis[maxn], pre[maxn]; int head[maxn], tot; struct Edge { int to, next; } e[maxn << 1]; void addedge(int from, int to) { e[tot].to = to; e[tot].next = head[from]; head[from] = tot++; } void bfs(int u) { memset(vis, 0, sizeof(vis))...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; int vis[maxn], pre[maxn]; int head[maxn], tot; struct Edge { int to, next; } e[maxn << 1]; void addedge(int from, int to) { e[tot].to = to; e[tot].next = head[from]; head[from] = tot++; } void bfs(int u) { memset(vis, 0, sizeof(vis))...
replace
2
3
2
3
0
p02678
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 #define pi 3.14159265358979323846 int main() { int n, m; cin >> n >> m; vector<vector<int>> G(n); for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--; b--; G[a].push_back(b); G[b].push_back(...
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 #define pi 3.14159265358979323846 int main() { int n, m; cin >> n >> m; vector<vector<int>> G(n); for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--; b--; G[a].push_back(b); G[b].push_back(...
insert
27
27
27
29
TLE
p02678
C++
Runtime Error
/* #region Head */ #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pll = pair<ll, ll>; template <class T> using vc = vector<T>; template <class T> using vvc = vc<vc<T>>; using vll = vc<ll>; using vvll = vvc<ll>; using vld = vc<ld>; usin...
/* #region Head */ #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pll = pair<ll, ll>; template <class T> using vc = vector<T>; template <class T> using vvc = vc<vc<T>>; using vll = vc<ll>; using vvll = vvc<ll>; using vld = vc<ld>; usin...
replace
236
237
236
237
0
p02679
C++
Time Limit Exceeded
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <iostream> #include <map> #include <queue> #include <string> #include <unordered_map> #include <vector> #include <bits/stdc++.h> #include <cmath> #include <limits> using namespace std; #define MAX 200002 long long MOD = 1000000...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <iostream> #include <map> #include <queue> #include <string> #include <unordered_map> #include <vector> #include <bits/stdc++.h> #include <cmath> #include <limits> using namespace std; #define MAX 200002 long long MOD = 1000000...
replace
94
99
94
95
TLE
p02679
C++
Time Limit Exceeded
// #define TIMER_ #include <bits/stdc++.h> using namespace std; #define rep(i, r) for (int i = 0; i < (r); i++) #define pb push_back #define ALL(a) a.begin(), a.end() #define fastio \ ios::sync_with_stdio(0); ...
// #define TIMER_ #include <bits/stdc++.h> using namespace std; #define rep(i, r) for (int i = 0; i < (r); i++) #define pb push_back #define ALL(a) a.begin(), a.end() #define fastio \ ios::sync_with_stdio(0); ...
replace
24
26
24
26
TLE
p02679
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (ll i = (x); i < (y); i++) #define rrep(i, x, y) for (ll i = (ll)(y)-1; i >= (x); i--) #define all(x) (x).begin(), (x).end() #ifdef LOCAL #define debug(x) \ cerr << #x << " = " << (x) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (ll i = (x); i < (y); i++) #define rrep(i, x, y) for (ll i = (ll)(y)-1; i >= (x); i--) #define all(x) (x).begin(), (x).end() #ifdef LOCAL #define debug(x) \ cerr << #x << " = " << (x) ...
replace
122
123
122
124
TLE
p02679
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; constexpr auto MOD = 1000000007LL; // a^n mod m を計算する(繰り返し二乗法,二分累乗法:O(logn)) (再帰版) long long modpow(long long a, long long n) { return n ? modpow(a * a % MOD, n / 2) * (n % 2 ? a : 1) % MOD : 1; } // // MOD考慮power関数 // inline long long modpow(long long a,long long n) ...
#include <bits/stdc++.h> using namespace std; constexpr auto MOD = 1000000007LL; // a^n mod m を計算する(繰り返し二乗法,二分累乗法:O(logn)) (再帰版) long long modpow(long long a, long long n) { return n ? modpow(a * a % MOD, n / 2) * (n % 2 ? a : 1) % MOD : 1; } // // MOD考慮power関数 // inline long long modpow(long long a,long long n) ...
replace
23
31
23
29
0
p02679
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--) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #define EPS (1e-10) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MOD2 = 998244353; ...
#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--) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #define EPS (1e-10) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MOD2 = 998244353; ...
replace
26
28
26
28
0
p02679
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; long long gcd(long long a, long long b) { if (a % b == 0) { return b; } else { return gcd(b, a % b); } } int main(int, char **) { int n; cin >> n; long long cnt0 = mod - 1; map<pair<long long, long long>, pair<long...
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } int main(int, char **) { int n; cin >> n; long long cnt0 = mod - 1; map<pair<long long, long long>, pair<long long, long long>> cnt; long long pw[202020...
replace
6
13
6
7
0
p02679
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, n) for (int i = 1; i <= (n); i++) #define all(x) (x).begin(), (x).end() #define uniq(x) (x).erase(unique(all(x)), end(x)) #define bit(n) (1LL << (n)) #define cdiv(a, b) (((a)-1) / (b) + 1...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, n) for (int i = 1; i <= (n); i++) #define all(x) (x).begin(), (x).end() #define uniq(x) (x).erase(unique(all(x)), end(x)) #define bit(n) (1LL << (n)) #define cdiv(a, b) (((a)-1) / (b) + 1...
delete
203
204
203
203
TLE
p02679
C++
Runtime Error
#include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; long long pow(long long a, long long b, long long mod) { if (b == 0) { return 1; } else { if (b % 2 == 0) { return pow(a * a % mod, b / 2, mod); } else { return pow(a * a % mod, b ...
#include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; long long pow(long long a, long long b, long long mod) { if (b == 0) { return 1; } else { if (b % 2 == 0) { return pow(a * a % mod, b / 2, mod); } else { return pow(a * a % mod, b ...
insert
42
42
42
46
0
p02679
C++
Time Limit Exceeded
#include <iostream> #include <map> #include <utility> using namespace std; const long long MOD = 1000000007; long long euclid_gcd(long long a, long long b) { if (a < b) { return euclid_gcd(b, a); } if (b == 0) { return a; } long long r; while ((r = a % b)) { a = b; b = r; } return b; ...
#include <iostream> #include <map> #include <utility> using namespace std; const long long MOD = 1000000007; long long euclid_gcd(long long a, long long b) { if (a < b) { return euclid_gcd(b, a); } if (b == 0) { return a; } long long r; while ((r = a % b)) { a = b; b = r; } return b; ...
delete
86
90
86
86
TLE
p02679
C++
Time Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS #pragma target("avx") #pragma optimize("O3") #pragma optimize("unroll-loops") #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #include <functional> #inc...
#define _CRT_SECURE_NO_WARNINGS #pragma target("avx") #pragma optimize("O3") #pragma optimize("unroll-loops") #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #include <functional> #inc...
replace
286
288
286
290
TLE
p02679
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <math.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const ll mod = 1000000007; const ll INF = 1001001001; const ll LINF = 1001001001001001001; void prvec(vector<ll> vec) { // for debug ll n = vec.size(); co...
#include <bits/stdc++.h> #include <math.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const ll mod = 1000000007; const ll INF = 1001001001; const ll LINF = 1001001001001001001; void prvec(vector<ll> vec) { // for debug ll n = vec.size(); co...
replace
40
42
40
42
TLE
p02679
C++
Runtime Error
#include <bits/stdc++.h> #include <math.h> #include <vector> using namespace std; #define MAX 100005 #define MOD 1000000007 long long arr[MAX]; map<pair<long long, long long>, int> M; set<pair<long long, long long>> S; long long gcd(long long a, long long b) { if (b == 0) return a; else return gcd(b, a % b)...
#include <bits/stdc++.h> #include <math.h> #include <vector> using namespace std; #define MAX 200005 #define MOD 1000000007 long long arr[MAX]; map<pair<long long, long long>, int> M; set<pair<long long, long long>> S; long long gcd(long long a, long long b) { if (b == 0) return a; else return gcd(b, a % b)...
replace
4
5
4
5
0
p02679
C++
Runtime Error
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> llP; ll mod(ll a, ll b) { ll ret = a % b; if (ret < 0) ret += b; return ret; } ll modpow(ll a, ll b, ll c) { ll res = 1; while (b > 0) { if (b & 1) res = mod(r...
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> llP; ll mod(ll a, ll b) { ll ret = a % b; if (ret < 0) ret += b; return ret; } ll modpow(ll a, ll b, ll c) { ll res = 1; while (b > 0) { if (b & 1) res = mod(r...
replace
91
92
91
92
0
p02679
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <tuple> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (n); i++...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <tuple> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (n); i++...
replace
112
113
112
113
0
p02679
C++
Runtime Error
#include <algorithm> #include <cassert> #include <iostream> #include <vector> struct vec { long long x, y; vec(long long _x, long long _y) : x(_x), y(_y) {} __int128 dot(const vec &o) { return (__int128)x * (__int128)o.x + (__int128)y * (__int128)o.y; } __int128 cross(const vec &o) { return (__int...
#include <algorithm> #include <cassert> #include <iostream> #include <vector> struct vec { long long x, y; vec(long long _x, long long _y) : x(_x), y(_y) {} __int128 dot(const vec &o) { return (__int128)x * (__int128)o.x + (__int128)y * (__int128)o.y; } __int128 cross(const vec &o) { return (__int...
replace
22
23
22
23
0
p02679
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; const int mod = 1000000007; ll gcd(ll a, ll b) { while (b) { ll c = a % b; a = b; b = c; } return a; } in...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; const int mod = 1000000007; ll gcd(ll a, ll b) { while (b) { ll c = a % b; a = b; b = c; } return a; } in...
replace
34
36
34
35
0
p02679
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll(i) = 0; (i) < (ll)(n); ++(i)) #define REPN(i, m, n) for (ll(i) = m; (i) < (ll)(n); ++(i)) #define REP_REV(i, n) for (ll(i) = (ll)(n)-1; (i) >= 0; --(i)) #define REPN_REV(i, m, n) for (ll(i) = (ll)(n)-1; (i) >= m; --(i)) #define ALL(x) (x).begin(),...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll(i) = 0; (i) < (ll)(n); ++(i)) #define REPN(i, m, n) for (ll(i) = m; (i) < (ll)(n); ++(i)) #define REP_REV(i, n) for (ll(i) = (ll)(n)-1; (i) >= 0; --(i)) #define REPN_REV(i, m, n) for (ll(i) = (ll)(n)-1; (i) >= m; --(i)) #define ALL(x) (x).begin(),...
insert
119
119
119
121
0
p02679
C++
Runtime Error
// #define _GLIBCXX_DEBUG // for STL debug (optional) #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #inc...
// #define _GLIBCXX_DEBUG // for STL debug (optional) #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #inc...
replace
173
174
173
174
1
p02679
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #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 ALL(obj) (obj).begin(), (obj).end() #define INF 1e9 typedef long long ll; #include <bits/stdc++.h> using namespace std; #...
#include <bits/stdc++.h> using namespace std; #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 ALL(obj) (obj).begin(), (obj).end() #define INF 1e9 typedef long long ll; #include <bits/stdc++.h> using namespace std; #...
insert
145
145
145
148
0
p02679
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<long long, long long> pll; long long A[200005]; long long B[200005]; long long C[200005]; long long D[200005]; long long pow2[200005]; const long long MOD = 1e9 + 7; map<pll, long long> map1; void insert1(long long a, long long b, int i) { if (b == 0 && ...
#include <bits/stdc++.h> using namespace std; typedef pair<long long, long long> pll; long long A[200005]; long long B[200005]; long long C[200005]; long long D[200005]; long long pow2[200005]; const long long MOD = 1e9 + 7; map<pll, long long> map1; void insert1(long long a, long long b, int i) { if (b == 0 && ...
replace
55
58
55
56
0
p02679
C++
Runtime Error
#pragma GCC optimize("O3") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef __int128 lll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp...
#pragma GCC optimize("O3") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef __int128 lll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp...
replace
84
87
84
87
0
p02679
C++
Runtime Error
// #include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using n...
// #include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using n...
replace
263
264
263
270
0
p02679
C++
Runtime Error
/* AB=0,0はコーナーケースこれらを足した上で, 省いて普通の分析につなげる S, Tに対して, それぞれの集合は直線上で sとtは直行 この時, SかTかのどっちかのみ選べる 選び方は2^|S|+2^|T|-1(空集合に注意) これをS[i]で掛け合わせればいい 問題はS[i]の分類, どうやって同じ直線上の点を検出するか 角度に直して分析? doubleだと誤差がだるそう 最大公約数で割り算? logAなのでいけそう */ #include <bits/stdc++.h> using namespace std; typedef pair<long, long> P; #define Q 1000000007 l...
/* AB=0,0はコーナーケースこれらを足した上で, 省いて普通の分析につなげる S, Tに対して, それぞれの集合は直線上で sとtは直行 この時, SかTかのどっちかのみ選べる 選び方は2^|S|+2^|T|-1(空集合に注意) これをS[i]で掛け合わせればいい 問題はS[i]の分類, どうやって同じ直線上の点を検出するか 角度に直して分析? doubleだと誤差がだるそう 最大公約数で割り算? logAなのでいけそう */ #include <bits/stdc++.h> using namespace std; typedef pair<long, long> P; #define Q 1000000007 l...
replace
81
83
81
83
0
p02679
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long gcd(long long x, long long y) { return (x % y) ? gcd(y, x % y) : y; } const long long MOD = 1000000007; int main() { int N; cin >> N; vector<long long> pw(200010); pw[0] = 1; for (int i = 1; i < 200010; ++i) pw[i] = (pw[i - 1] * 2) % MOD; map...
#include <bits/stdc++.h> using namespace std; long long gcd(long long x, long long y) { return (y) ? gcd(y, x % y) : x; } const long long MOD = 1000000007; int main() { int N; cin >> N; vector<long long> pw(200010); pw[0] = 1; for (int i = 1; i < 200010; ++i) pw[i] = (pw[i - 1] * 2) % MOD; map<pai...
replace
3
4
3
4
0
p02679
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> constexpr lon...
#include <algorithm> #include <climits> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> constexpr lon...
replace
46
47
46
47
0
p02680
C++
Runtime Error
#include <algorithm> #include <array> #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 <random> #...
#include <algorithm> #include <array> #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 <random> #...
replace
73
74
73
74
0
p02680
C++
Runtime Error
// READ & UNDERSTAND // ll, int overflow, array bounds, memset(0) // special cases (n=1?), n+1 (1-index) // do smth instead of nothing & stay organized // WRITE STUFF DOWN #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #defi...
// READ & UNDERSTAND // ll, int overflow, array bounds, memset(0) // special cases (n=1?), n+1 (1-index) // do smth instead of nothing & stay organized // WRITE STUFF DOWN #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #defi...
replace
25
26
25
26
0
p02680
C++
Runtime Error
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define HUGE_NUM 1000000000000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; #define SIZE 1005 struct Line { ll A, B, C; }; struct Info { Info() { x = y = 0; } Info(ll ...
#include <bits/stdc++.h> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define HUGE_NUM 1000000000000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; #define SIZE 2005 struct Line { ll A, B, C; }; struct Info { Info() { x = y = 0; } Info(ll ...
replace
9
10
9
10
0
p02680
C++
Time Limit Exceeded
/* coordinate_compress_2D.cpp 2Dの座標圧縮を行う verified: [AOJ] DSL_4_A Union of Rectangles http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_4_A&lang=ja */ #include <bits/stdc++.h> using namespace std; // 1次元 vector template <class T> ostream &operator<<(ostream &s, vector<T> vec) { for (int i ...
/* coordinate_compress_2D.cpp 2Dの座標圧縮を行う verified: [AOJ] DSL_4_A Union of Rectangles http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_4_A&lang=ja */ #include <bits/stdc++.h> using namespace std; // 1次元 vector template <class T> ostream &operator<<(ostream &s, vector<T> vec) { for (int i ...
replace
35
43
35
39
TLE
p02680
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <numeric> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; using PII = pair<int, int>; const int inf = 2e9; const vector<int> dx = {1, 0, -1, 0}; const vector<int> dy = {0, ...
#include <algorithm> #include <cstdio> #include <iostream> #include <numeric> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; using PII = pair<int, int>; const int inf = 2e9; const vector<int> dx = {1, 0, -1, 0}; const vector<int> dy = {0, ...
replace
102
103
102
103
0
..................... ..................... ......#.............. ......#.............. ......#.......#...... ......#.......#...... ..###############.... ......#OOOOOOO#...... ......#OOO###O#...... ......#OOO#.#O#...... ......#O###.#O#...... ......#O#...#O#...... ......#O#####O#...... ......#OOO#OOO#...... ....########...
p02680
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T, class U> using Pa = pair<T, U>; template <class T> using vec = vector<T>; template <class T> using vvec = vector<vec<T>>; template <class T> class Compress { int N; map<T, int> idx; map<int, T> value; vec<T> v; vec<T> cmp;...
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T, class U> using Pa = pair<T, U>; template <class T> using vec = vector<T>; template <class T> using vvec = vector<vec<T>>; template <class T> class Compress { int N; map<T, int> idx; map<int, T> value; vec<T> v; vec<T> cmp;...
delete
137
138
137
137
0
p02680
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, a, n) for (int i = (a); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define FOR(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define ALLOF(c) (c).begin(), (c)....
#include <bits/stdc++.h> using namespace std; #define REP(i, a, n) for (int i = (a); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define FOR(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define ALLOF(c) (c).begin(), (c)....
replace
25
26
25
26
0
p02680
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define INF (1LL << 59) #define MV 200001 #define LMV 21 #define ff first #define ss second #define pb push_back #define eb emplace_back #define emp emplace #define mp ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define INF (1LL << 59) #define MV 200001 #define LMV 21 #define ff first #define ss second #define pb push_back #define eb emplace_back #define emp emplace #define mp ...
replace
106
108
106
108
0
Time taken: 0.0002430
p02680
C++
Runtime Error
#include <bits/stdc++.h> #define ref(i, n) for (int i = 0; i < n; i++) using namespace std; #define INF 1111111111 int n, m; int a[1001], b[1001], c[1000], d[1000], e[1000], f[1000]; int U[3000][3000], L[3000][3000]; typedef pair<int, int> P; vector<vector<bool>> vis; typedef long long ll; int id(vector<ll> h, ll a) ...
#include <bits/stdc++.h> #define ref(i, n) for (int i = 0; i < n; i++) using namespace std; #define INF 1111111111 int n, m; int a[1001], b[1001], c[1000], d[1000], e[1000], f[1000]; int U[4000][4000], L[4000][4000]; typedef pair<int, int> P; vector<vector<bool>> vis; typedef long long ll; int id(vector<ll> h, ll a) ...
replace
7
8
7
8
0
p02680
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p_ll; template <class T> void debug(T itr1, T itr2) { auto now = itr1; while (now < itr2) { cout << *now << " "; now++; } cout << endl; } #define repr(i, from, to) for (int i = (int)from; i < (int)to; i++) #define...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p_ll; template <class T> void debug(T itr1, T itr2) { auto now = itr1; while (now < itr2) { cout << *now << " "; now++; } cout << endl; } #define repr(i, from, to) for (int i = (int)from; i < (int)to; i++) #define...
replace
145
146
145
171
0
p02680
C++
Runtime Error
#ifdef _MSC_VER #include <__msvc_all_public_headers.hpp> #undef min #undef max #else #include <bits/stdc++.h> #endif using namespace std; using large = long long; struct Point { int x, y; }; struct Bar { Point a, b; }; int main() { int n, m; cin >> n >> m; auto vertical_bars = vector<Bar>(n); auto hori...
#ifdef _MSC_VER #include <__msvc_all_public_headers.hpp> #undef min #undef max #else #include <bits/stdc++.h> #endif using namespace std; using large = long long; struct Point { int x, y; }; struct Bar { Point a, b; }; int main() { int n, m; cin >> n >> m; auto vertical_bars = vector<Bar>(n); auto hori...
replace
63
64
63
64
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02680
C++
Runtime Error
#include <bits/stdc++.h> // #include "bits/stdc++.h" #include <algorithm> #include <array> #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsign...
#include <bits/stdc++.h> // #include "bits/stdc++.h" #include <algorithm> #include <array> #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsign...
replace
2,267
2,269
2,267
2,268
-11