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
p01767
C++
Runtime Error
#include <algorithm> #define REP(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; #include <cstdio> #include <queue> inline ll getLL() { ll s; scanf("%lld", &s); return s; } inline int getInt() { int s; scanf("%d", &s); return s; } #include <set> using namespace std; int main() { const ...
#include <algorithm> #define REP(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; #include <cstdio> #include <queue> inline ll getLL() { ll s; scanf("%lld", &s); return s; } inline int getInt() { int s; scanf("%d", &s); return s; } #include <set> using namespace std; int main() { const ...
replace
32
34
32
34
0
p01767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, M, b[300000]; long long Counter[1000001] = {}, c[300000]; cin >> N; for (int i = 0; i < N; i++) { int a; cin >> a; Counter[a] += a; } for (int i = 1; i < 1000001; i++) { Counter[i] += Counter[i - 1]; } cin >> M; for (in...
#include <bits/stdc++.h> using namespace std; int main() { int N, M, b[300000]; static long long Counter[1000001] = {}; long long c[300000]; cin >> N; for (int i = 0; i < N; i++) { int a; cin >> a; Counter[a] += a; } for (int i = 1; i < 1000001; i++) { Counter[i] += Counter[i - 1]; } ...
replace
5
6
5
7
-11
p01767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int64; class Fenwick_Tree { private: vector<int64> p; public: Fenwick_Tree(int size) { p.resize(size + 2, 0); } int64 sum(int x) { int64 ret = 0; for (++x; x > 0; x -= x & -x) ret += p[x]; return (ret); } void add(int k, int a...
#include <bits/stdc++.h> using namespace std; typedef long long int64; class Fenwick_Tree { private: vector<int64> p; public: Fenwick_Tree(int size) { p.resize(size + 2, 0); } int64 sum(int x) { int64 ret = 0; for (++x; x > 0; x -= x & -x) ret += p[x]; return (ret); } void add(int k, int a...
replace
24
25
24
25
0
p01768
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i < (int)b; i++) #define rep(i, n) REP(i, 0, n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define watch(a) ...
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i < (int)b; i++) #define rep(i, n) REP(i, 0, n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define watch(a) ...
replace
21
22
21
22
0
p01768
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; class UnionFind { vector<int> par, sz; public: UnionFind(int n) { par = sz = vector<int>(n); for (int i = 0; i < n; i++) { par[i] = i; sz[i] = 1; } } int find(int x) { if (par[x] == x) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; class UnionFind { vector<int> par, sz; public: UnionFind(int n) { par = sz = vector<int>(n); for (int i = 0; i < n; i++) { par[i] = i; sz[i] = 1; } } int find(int x) { if (par[x] == x) ...
replace
44
45
44
46
0
p01768
C++
Runtime Error
#include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <set> #include <string> using namespace std; map<string, int> cost; multimap<string, string> rule; set<string> his, his2; int flg; void update(string a) { his2.insert(a); multimap<string, string>::iterator it = rule.find(a); whil...
#include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <set> #include <string> using namespace std; map<string, int> cost; multimap<string, string> rule; set<string> his, his2; int flg; void update(string a) { his2.insert(a); multimap<string, string>::iterator it = rule.find(a); whil...
insert
30
30
30
31
0
p01768
C++
Time Limit Exceeded
#include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <string> #define f first #define s second using namespace std; typedef pair<string, int> P; map<string, P> mp; string find(string x) { if (mp[x].f != x) mp[x] = mp[find(mp[x].f)]; return mp[x].f; } bool unite(string x, string ...
#include <algorithm> #include <cstdlib> #include <iostream> #include <map> #include <string> #define f first #define s second using namespace std; typedef pair<string, int> P; map<string, P> mp; string find(string x) { if (mp[x].f != x) mp[x] = mp[find(mp[x].f)]; return mp[x].f; } bool unite(string x, string ...
replace
20
21
20
21
TLE
p01769
C++
Runtime Error
// include //-------------------------------------------------- #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <li...
// include //-------------------------------------------------- #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <li...
replace
113
114
113
114
0
p01769
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #...
replace
36
37
36
37
127
/tmp/992f28b9-45b3-49bb-a528-55d30e73c493.out: error while loading shared libraries: libc.so.6: failed to map segment from shared object
p01769
C++
Runtime Error
#include <algorithm> // other #include <bitset> #include <cassert> // c #include <complex> #include <fstream> #include <functional> #include <iomanip> #include <iostream> // io #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set> #include <sstream> #include <stack> #inclu...
#include <algorithm> // other #include <bitset> #include <cassert> // c #include <complex> #include <fstream> #include <functional> #include <iomanip> #include <iostream> // io #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set> #include <sstream> #include <stack> #inclu...
replace
228
231
228
229
0
p01769
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int dp[5010][5010]; signed main() { int n, l, p = 1000000007; cin >> n >> l; vector<int> x(n), a(n); for (int i = 0; i < n; i++) cin >> x[n - 1 - i]; for (int i = 0; i < n; i++) cin >> a[n - 1 - i]; if (a[0] == 0) dp[0][x[0]] ...
#include <bits/stdc++.h> using namespace std; #define int long long int dp[5010][5010]; signed main() { int n, l, p = 1000000007; cin >> n >> l; vector<int> x(n), a(n); for (int i = 0; i < n; i++) cin >> x[n - 1 - i]; for (int i = 0; i < n; i++) cin >> a[n - 1 - i]; if (a[0] == 0) dp[0][x[0]] ...
replace
22
27
22
25
-11
p01769
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, L; int x[5010], a[5010]; scanf("%d %d", &N, &L); for (int i = 0; i < N; i++) scanf("%d", x + i); for (int i = 0; i < N; i++) scanf("%d", a + i); int dp[2][5010] = {{0}}; int prev = 0, now = 1; dp[prev][L] = 1; for (int i =...
#include <bits/stdc++.h> using namespace std; int main() { int N, L; int x[5010], a[5010]; scanf("%d %d", &N, &L); for (int i = 0; i < N; i++) scanf("%d", x + i); for (int i = 0; i < N; i++) scanf("%d", a + i); int dp[2][5010] = {{0}}; int prev = 0, now = 1; dp[prev][L] = 1; for (int i =...
insert
26
26
26
28
TLE
p01769
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_DEPRECATE #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <ioman...
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_DEPRECATE #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <ioman...
replace
58
61
58
65
TLE
p01769
C++
Runtime Error
#include <algorithm> #include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; static const int MOD = 1000000007; static int dp[5001][5001]; int main() { ios_base::sync_with_stdio(false); int n, l; cin >> n >> l; vector<int> x(n), a(n); for (int i = 0; i < n; ++i) { ...
#include <algorithm> #include <cstring> #include <iostream> #include <string> #include <vector> using namespace std; static const int MOD = 1000000007; static int dp[5001][5001]; int main() { ios_base::sync_with_stdio(false); int n, l; cin >> n >> l; vector<int> x(n), a(n); for (int i = 0; i < n; ++i) { ...
replace
27
28
27
32
127
/tmp/6525004b-86ef-407c-94b0-66ee7ca97ed9.out: error while loading shared libraries: libc.so.6: failed to map segment from shared object
p01769
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <...
replace
65
67
65
67
0
p01769
C++
Memory Limit Exceeded
long long dp[5000][5000]; int main() { for (int i = 0; i < 5000; i++) for (int j = 0; j < 5000; j++) dp[i][j] = 1; }
#include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define all(c) begin(c), end(c) #define dump(x) cerr << __LINE__ << ":\t" #x " = " << (x) << endl const int MOD = 1000000007; int n, l; int x[5010], a[5010]; int dp[5010][5010]; sig...
replace
0
5
0
45
MLE
p01769
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define re...
#include <algorithm> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define re...
replace
131
136
131
145
0
p01769
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #incl...
#include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #incl...
replace
154
155
154
155
-11
p01769
C++
Time Limit Exceeded
#define REP(i, n) for (int i = 0; i < (int)(n); i++) #include <queue> typedef long long ll; #include <cstdio> inline int getInt() { int s; scanf("%d", &s); return s; } #include <set> using namespace std; const ll mod = 1000000007; class BIT { vector<ll> bit; public: BIT(int n) : bit(n + 1) {} void add...
#define REP(i, n) for (int i = 0; i < (int)(n); i++) #include <queue> typedef long long ll; #include <cstdio> inline int getInt() { int s; scanf("%d", &s); return s; } #include <set> using namespace std; const ll mod = 1000000007; class BIT { vector<ll> bit; public: BIT(int n) : bit(n + 1) {} void add...
replace
59
61
59
65
TLE
p01769
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> #define REP(i, N) for (int i = 0; i < N; ++i) #define REPA(i, N) for (int i = 1; i < N; ++i) #define MOD ((int)1e9 + 7) using namespace std; int main() { int N, L; cin >> N >> L; vector<int> sp(N), ran(N); REP(i, N) { cin >> sp[i]; } REP(i, N) { cin >...
#include <algorithm> #include <iostream> #include <vector> #define REP(i, N) for (int i = 0; i < N; ++i) #define REPA(i, N) for (int i = 1; i < N; ++i) #define MOD ((int)1e9 + 7) using namespace std; int main() { int N, L; cin >> N >> L; vector<int> sp(N), ran(N); REP(i, N) { cin >> sp[i]; } REP(i, N) { cin >...
insert
16
16
16
18
TLE
p01770
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; typedef pair<int, int> pii; static const int INF = 1000000000; static int g_dist[256][102][100]; int main() { ios_base::sync_with_stdio(false); int n, m, e, s, t, r; cin >> n >> ...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <utility> #include <vector> using namespace std; typedef pair<int, int> pii; static const int INF = 1000000000; static int g_dist[256][102][100]; int main() { ios_base::sync_with_stdio(false); int n, m, e, s, t, r; cin >> n >> ...
replace
20
21
20
21
0
p01770
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) using namespace std; struct Edge { int src, dst, bitmask; }; struct Data { int cur, weight, bitmask, step; bool operator<(const Data &data) const { return weight > data.weight; } }; const int MAX_V = 101; ...
#include <bits/stdc++.h> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) using namespace std; struct Edge { int src, dst, bitmask; }; struct Data { int cur, weight, bitmask, step; bool operator<(const Data &data) const { return weight > data.weight; } }; const int MAX_V = 101; ...
replace
53
54
53
54
0
p01770
C++
Time Limit Exceeded
// Template {{{ #include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef long long LL; template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; } template <typename T>...
// Template {{{ #include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef long long LL; template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; } template <typename T>...
replace
79
80
79
80
TLE
p01771
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define print(x) #endif const int inf = 1e9; const int64_t in...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define print(x) #endif const int inf = 1e9; const int64_t in...
replace
135
136
135
136
TLE
p01771
C++
Time Limit Exceeded
// http://rippro.org/event/ritscamp2015/F.pdf // http://tubo28.me/blog/post/2015/10/28/aoj2667/ #include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define DEBUG(x) cerr << #x << " = " << x << endl #define int long long struct LCA { int N, logN; vector<vector<int>> G; ...
// http://rippro.org/event/ritscamp2015/F.pdf // http://tubo28.me/blog/post/2015/10/28/aoj2667/ #include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define DEBUG(x) cerr << #x << " = " << x << endl #define int long long struct LCA { int N, logN; vector<vector<int>> G; ...
replace
116
117
116
117
TLE
p01772
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { string row; cin >> row; int f = 0, cnt = 0; // cout<<row.size(); for (int i = 0; row.size(); i++) { if (row[i] == 'A') f = 1; if (f == 1 && row[i] == 'Z') { cnt++; f = 0; } } if (cnt != 0) { for (int...
#include <iostream> #include <string> using namespace std; int main() { string row; cin >> row; int f = 0, cnt = 0; // cout<<row.size(); for (int i = 0; i < row.size(); i++) { if (row[i] == 'A') f = 1; if (f == 1 && row[i] == 'Z') { cnt++; f = 0; } } if (cnt != 0) { for ...
replace
9
10
9
10
-11
p01773
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> Pi; int main() { int a, n, m; scanf("%d", &a); vector<Pi> datas; for (int i = 0; i < a; i++) { int H1, H2, M1, M2; scanf("%d:%d-%d:%d", &H1, &M1, &H2, &M2); datas.push_back(make_pair(H1 * 60 + M1, H2 * 60 + M2)); } scanf("%d",...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> Pi; int main() { int a, n, m; scanf("%d", &a); vector<Pi> datas; for (int i = 0; i < a; i++) { int H1, H2, M1, M2; scanf("%d:%d-%d:%d", &H1, &M1, &H2, &M2); datas.push_back(make_pair(H1 * 60 + M1, H2 * 60 + M2)); } scanf("%d",...
replace
48
49
48
49
0
p01773
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; P s2p(string s) { return P(stoi(s.substr(0, 2)), stoi(s.substr(3, 2))); } bool contain(string c, string p) { P stc = s2p(c.substr(0, 5)); P enc = s2p(c.substr(6, 5)); P stp = s2p(p.substr(0, 5)); P enp = s2p(p.substr(6...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; P s2p(string s) { return P(stoi(s.substr(0, 2)), stoi(s.substr(3, 2))); } bool contain(string c, string p) { P stc = s2p(c.substr(0, 5)); P enc = s2p(c.substr(6, 5)); P stp = s2p(p.substr(0, 5)); P enp = s2p(p.substr(6...
replace
53
54
53
54
0
p01775
C++
Runtime Error
/* attention to overflow */ #include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define dump(x) cerr << #x << " = " << x << endl using namespace std; const int INF = 1 << 25; void io() { cin.tie(0); ios::sy...
/* attention to overflow */ #include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define dump(x) cerr << #x << " = " << x << endl using namespace std; const int INF = 1 << 25; void io() { cin.tie(0); ios::sy...
replace
71
72
71
72
0
p01777
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define MAX 114514 int n; vector<int> dat[MAX * 2 - 1]; int query(int a, int b, int u, int d, int k = 0, int l = 0, int r = n) { // cout<<a<<" "<<b<<" "<<k<<" "<<l<<" "<<r<<endl; if (r <= a || b <= l) return 0; if (a <= l && r <= b) { //...
#include <bits/stdc++.h> using namespace std; #define int long long #define MAX 414514 int n; vector<int> dat[MAX * 2 - 1]; int query(int a, int b, int u, int d, int k = 0, int l = 0, int r = n) { // cout<<a<<" "<<b<<" "<<k<<" "<<l<<" "<<r<<endl; if (r <= a || b <= l) return 0; if (a <= l && r <= b) { //...
replace
3
4
3
4
0
p01777
C++
Runtime Error
/* attention to overflow */ #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define dump(x) cerr << #x << " = " << x << endl using namespace std; const int INF = 1 << 25; void io() { cin....
/* attention to overflow */ #include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define dump(x) cerr << #x << " = " << x << endl using namespace std; const int INF = 1 << 25; void io() { cin....
replace
65
67
65
67
0
down = 1 up = 7 down = 6 up = 11 down = 5 up = 12 down = 1 up = 6 down = -2 up = 9
p01777
C++
Runtime Error
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #incl...
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #incl...
replace
43
44
43
44
0
p01777
C++
Runtime Error
#include <algorithm> #include <cfloat> #include <cmath> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std...
#include <algorithm> #include <cfloat> #include <cmath> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <string> #include <vector> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std...
replace
18
19
18
19
0
p01780
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define dump(x) #endif typedef long long int ll; typedef pair<...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define dump(x) #endif typedef long long int ll; typedef pair<...
replace
100
101
100
101
0
p01780
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < b; i++) typedef long long ll; int N; vector<pair<int, int>> E[101010]; class LCA { public: int NV; int logNV; vector<int> D; vector<long long> L; vector<vector<int>> P; LCA(int N) { NV = N; logNV = 0; while...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < b; i++) typedef long long ll; int N; vector<pair<int, int>> E[101010]; class LCA { public: int NV; int logNV; vector<int> D; vector<long long> L; vector<vector<int>> P; LCA(int N) { NV = N; logNV = 0; while...
insert
81
81
81
85
0
p01780
C++
Runtime Error
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #incl...
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #incl...
replace
64
65
64
65
0
p01780
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define maxn 100005 #define MOD 1000000007 #define hashm 17982571 using namespace std; ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define maxn 100005 #define MOD 1000000007 #define hashm 17982571 using namespace std; ...
replace
19
20
19
20
0
p01781
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; using P = pair<int, int>; constexpr ld EPS = 1e-12; constexpr int INF = numeric_limits<int>::max() / 2; constexpr int MOD = 1e9 + 7; ll X, Y, Z, A, B, C, N; ll cnt_x[1000], cnt_y[1000], cnt_z[1000], res[1000]; int main() { ...
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; using P = pair<int, int>; constexpr ld EPS = 1e-12; constexpr int INF = numeric_limits<int>::max() / 2; constexpr int MOD = 1e9 + 7; ll X, Y, Z, A, B, C, N; ll cnt_x[1000], cnt_y[1000], cnt_z[1000], res[1000]; int main() { ...
replace
34
35
34
40
TLE
p01785
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; typedef long long ll; #define pu push #define pb push_back #define mp make_pair #define rep(i, x) for (int i = 0; i < x; i++) typedef complex<double> pt; typedef pair<pt, pt> L; typedef vector<P> poly...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; typedef long long ll; #define pu push #define pb push_back #define mp make_pair #define rep(i, x) for (int i = 0; i < x; i++) typedef complex<double> pt; typedef pair<pt, pt> L; typedef vector<P> poly...
replace
98
99
98
99
TLE
p01786
C++
Runtime Error
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <valarray> #include <vector> using namespace ...
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <valarray> #include <vector> using namespace ...
replace
108
109
108
109
0
p01787
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define f first #define s second #define mp make_pair using namespace std; int main() { vector<pair<char, long long>> A, B, C; char c; int a; while (1) { cin >> c; if (c == '$') break; cin >> a; A.push_back(mp(c, a)); } while (1) { cin >> c; if (c == ...
#include <bits/stdc++.h> #define f first #define s second #define mp make_pair using namespace std; int main() { vector<pair<char, long long>> A, B, C; char c; int a; while (1) { cin >> c; if (c == '$') break; cin >> a; A.push_back(mp(c, a)); } while (1) { cin >> c; if (c == ...
replace
70
71
70
71
TLE
p01791
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl using namespace std; template <class S, class T>...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl using namespace std; template <class S, class T>...
replace
34
35
34
35
-11
p01794
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (int)(b); i++) #define rep(i, a) FOR(i, 0, a) #define all(a) (a).begin(), (a).end() #define pb push_back #define sz size() #define MP make_pair using namespace std; typedef long long ...
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (int)(b); i++) #define rep(i, a) FOR(i, 0, a) #define all(a) (a).begin(), (a).end() #define pb push_back #define sz size() #define MP make_pair using namespace std; typedef long long ...
delete
123
124
123
123
0
1
p01806
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; struct Dice { int x, y; int l, r, f, b, d, u; void RollF() { --y; int buff = d; d = f; f = u; u = b; b = buff; } void RollB() { ++y; int buff = d; d = b; b = u; u = f; f = buff; } void RollL() { --x; ...
#include <bits/stdc++.h> using namespace std; struct Dice { int x, y; int l, r, f, b, d, u; void RollF() { --y; int buff = d; d = f; f = u; u = b; b = buff; } void RollB() { ++y; int buff = d; d = b; b = u; u = f; f = buff; } void RollL() { --x; ...
replace
111
112
111
112
TLE
p01806
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; short p[4][6] = {{5, 4, 2, 3, 0, 1}, {4, 5, 2, 3, 1, 0}, {0, 1, 5, 4, 2, 3}, {0, 1, 4, 5, 3, 2}}; short n, C[20][6], cx[20], cy[20]; string px[20]; map<pair...
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; short p[4][6] = {{5, 4, 2, 3, 0, 1}, {4, 5, 2, 3, 1, 0}, {0, 1, 5, 4, 2, 3}, {0, 1, 4, 5, 3, 2}}; short n, C[20][6], cx[20], cy[20]; string px[20]; map<pair...
insert
64
64
64
65
MLE
p01806
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; enum { U, B, L, F, R, D }; struct Dice { int face[6]; Dice() { face[F] = 1; face[R] = 2; face[U] = 3; face[B] = 6; face[L] = 5; face[D] = 4; } int find_face(int f) { for (int i = 0; i < 6; i++) { if (face[i]...
#include <bits/stdc++.h> using namespace std; typedef long long ll; enum { U, B, L, F, R, D }; struct Dice { int face[6]; Dice() { face[F] = 1; face[R] = 2; face[U] = 3; face[B] = 6; face[L] = 5; face[D] = 4; } int find_face(int f) { for (int i = 0; i < 6; i++) { if (face[i]...
insert
139
139
139
141
TLE
p01809
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int main() { int p, q; cin >> p >> q; p = gcd(p, q); q /= p; set<int> s; for (int i = 2; i <= q;) { if (q % i == 0) { q /= i; s.insert(i); } else { i++; } } int r = 1; ...
#include <bits/stdc++.h> using namespace std; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int main() { int p, q; cin >> p >> q; p = gcd(p, q); q /= p; set<int> s; for (int i = 2; i <= q;) { if (i * i > q) { i = q; } if (q % i == 0) { q /= i; s.insert(i); } els...
insert
12
12
12
15
TLE
p01809
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define INF 1001000100010001000 #define MOD 1000000007 #define EPS 1e-10 #define int long long #define rep(i, N) for (int i = 0; i < N; i++) #define Rep(i, N) for (int i = 1; i < N; i++) #define For(i, a, b) for (int i = (a); i < (b); i++) #define pb push_back #define mp ...
#include <bits/stdc++.h> using namespace std; #define INF 1001000100010001000 #define MOD 1000000007 #define EPS 1e-10 #define int long long #define rep(i, N) for (int i = 0; i < N; i++) #define Rep(i, N) for (int i = 1; i < N; i++) #define For(i, a, b) for (int i = (a); i < (b); i++) #define pb push_back #define mp ...
replace
46
47
46
48
TLE
p01810
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define CH(N, A, B) (A <= N && N < B) #define REP(i, a, b) for (int i = a; i < b; i++) #define RREP(i, a, b) for (int i = (b...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define CH(N, A, B) (A <= N && N < B) #define REP(i, a, b) for (int i = a; i < b; i++) #define RREP(i, a, b) for (int i = (b...
replace
30
32
30
33
TLE
p01811
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n, N) for (int i = n; i < N; i++) #define p(S) cout << (S) << endl #define ck(a, b) (0 <= (a) && (a) < b) using namespace std; string abcgene(string anss) { queue<string> q; q.push(anss); string c[3] = {"A", "B", "C"}; map<string, bool> m; m[anss] = true; while (!q.e...
#include <bits/stdc++.h> #define REP(i, n, N) for (int i = n; i < N; i++) #define p(S) cout << (S) << endl #define ck(a, b) (0 <= (a) && (a) < b) using namespace std; string abcgene(string anss) { queue<string> q; q.push(anss); string c[3] = {"A", "B", "C"}; map<string, bool> m; m[anss] = true; while (!q.e...
replace
26
27
26
27
TLE
p01811
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; string s; int cnt[3]; bool ok(string s, int a, int b, int c) { if (s == "ABC") return true; string nxt; char to; int abc; if (a < b && a < c) to = 'A', abc = a, b -= a, c -= a; else if (b < a && b < c) to = 'B', abc...
#include <algorithm> #include <iostream> #include <string> using namespace std; string s; int cnt[3]; bool ok(string s, int a, int b, int c) { if (s == "ABC") return true; string nxt; char to; int abc; if (a < b && a < c) to = 'A', abc = a, b -= a, c -= a; else if (b < a && b < c) to = 'B', abc...
insert
20
20
20
22
0
p01811
C++
Memory Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string> #include <vector> // #include <boost/multiprecision/cpp_int.hpp> #include <functional> #define int long long #define inf 1000000007 #define pa pai...
#include <algorithm> #include <bits/stdc++.h> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string> #include <vector> // #include <boost/multiprecision/cpp_int.hpp> #include <functional> #define int long long #define inf 1000000007 #define pa pai...
replace
134
135
134
136
MLE
p01811
C++
Runtime Error
// テ・ツ淞コテヲツ慊ャテ」ツδ?」ツδウテ」ツδ療」ツδャテ」ツδシテ」ツδ?(テァツクツョテ・ツーツ湘ァツ可? #include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int(i) = (a); (i) < (n); (i)++) #define repq(i, a, n) for (int(i) = (a); (i) <= (n); (i)++) #define repr(i, a, n) for (int(i) = (a); (i) >= (n); (i)--) #define int long long template <type...
// テ・ツ淞コテヲツ慊ャテ」ツδ?」ツδウテ」ツδ療」ツδャテ」ツδシテ」ツδ?(テァツクツョテ・ツーツ湘ァツ可? #include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int(i) = (a); (i) < (n); (i)++) #define repq(i, a, n) for (int(i) = (a); (i) <= (n); (i)++) #define repr(i, a, n) for (int(i) = (a); (i) >= (n); (i)--) #define int long long template <type...
replace
59
60
59
60
0
p01811
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; int main() { string s; cin >> s; while (1) { if (s == "ABC") { cout << "Yes" << endl; return 0; } int n = s...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; int main() { string s; cin >> s; while (1) { if (s == "ABC") { cout << "Yes" << endl; return 0; } if (s.siz...
insert
18
18
18
22
TLE
p01811
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) bool f(const string &s) { // cout<< s<< endl; if (s == "ABC") return true; if (s.size() <= 3) return false; int n = s.size(); char c; if (s.substr(0, 3) == "ABC") c =...
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) bool f(const string &s) { // cout<< s<< endl; if (s == "ABC") return true; if (s.size() <= 3) return false; int n = s.size(); char c; if (s.substr(0, 3) == "ABC") c =...
insert
30
30
30
32
MLE
p01811
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; while (s != "ABC") { string t = ""; for (int i = 0; i < s.length() - 2; i++) { if (s.substr(i, 3) == "ABC") { for (int j = 0; j < 3; j++) s[i + j] = ' '; } } bool a = false, b...
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; if (s.length() < 3) { cout << "No" << endl; return 0; } while (s != "ABC") { string t = ""; for (int i = 0; i < s.length() - 2; i++) { if (s.substr(i, 3) == "ABC") { for (int j = 0; j < 3...
insert
7
7
7
11
0
p01811
C++
Time Limit Exceeded
#include <iostream> #include <map> #include <string> using namespace std; int main() { string S; cin >> S; map<char, int> M; while (S.size() > 3) { for (char c = 'A'; c < 'D'; ++c) M[c] = 0; int abc = 0; int l = S.size(); for (int i = 0; i < l; ++i) { M[S[i]] += 1; if (S[i] ==...
#include <iostream> #include <map> #include <string> using namespace std; int main() { string S; cin >> S; map<char, int> M; while (S.size() > 3) { if (!(S.size() % 2)) { cout << "No" << endl; return 0; } for (char c = 'A'; c < 'D'; ++c) M[c] = 0; int abc = 0; int l = S.si...
insert
10
10
10
14
TLE
p01811
C++
Runtime Error
#include <iostream> #include <queue> #include <string> #include <vector> using namespace std; bool check_encode(string str, char c, string sn) { string ss = ""; for (int i = 0; i < str.length(); ++i) { if (str[i] == c) { ss += "ABC"; } else { ss += str[i]; } } cout << str << " " << ss ...
#include <iostream> #include <queue> #include <string> #include <vector> using namespace std; bool check_encode(string str, char c, string sn) { string ss = ""; for (int i = 0; i < str.length(); ++i) { if (str[i] == c) { ss += "ABC"; } else { ss += str[i]; } } cout << str << " " << ss ...
replace
33
34
33
34
0
p01812
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; int x[101][101]; vector<int> D; int n, m, p, dp[100000]; queue<int> Q; int main() { cin >> n >> m >> p; for (int i = 0; i < m; i++) { int r; cin >> r; D.push_back(r); } for (int i = 1; i <= n; i++) { ...
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; int x[101][101]; vector<int> D; int n, m, p, dp[100000]; queue<int> Q; int main() { cin >> n >> m >> p; for (int i = 0; i < m; i++) { int r; cin >> r; D.push_back(r); } for (int i = 1; i <= n; i++) { ...
insert
25
25
25
26
TLE
p01812
C++
Runtime Error
#include <iostream> #include <map> #include <queue> #include <vector> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; vector<int> d(m); map<int, int> mp; int v[101][101] = {}; for (int i = 0; i < m; i++) { cin >> d[i]; d[i]--; mp[d[i]] = i; } for (int i = 0; i < n; i++) ...
#include <iostream> #include <map> #include <queue> #include <vector> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; vector<int> d(m); map<int, int> mp; int v[101][101] = {}; for (int i = 0; i < m; i++) { cin >> d[i]; d[i]--; mp[d[i]] = i; } for (int i = 0; i < n; i++) ...
replace
40
41
40
42
0
p01812
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) ...
replace
52
53
52
54
-11
p01812
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; vector<int> d(m); map<int, int> dark_map; for (int i = 0; i < m; i++) { cin >> d[i]; d[i]--; dark_map[d[i]] = i; } vector<vector<int>> v(n, vector<int>(k)); for (int i = 0; i < n; i++) for (int j...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, k; cin >> n >> m >> k; vector<int> d(m); map<int, int> dark_map; for (int i = 0; i < m; i++) { cin >> d[i]; d[i]--; dark_map[d[i]] = i; } vector<vector<int>> v(n, vector<int>(k)); for (int i = 0; i < n; i++) for (int j...
replace
28
29
28
31
TLE
p01820
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const string D = "^>v<"; const int dx[] = {0, 1, 0, -1}; const int dy[] = {-1, 0, 1, 0}; const int inf = 1 << 25; int fld[3000][3000], w, h; int ans; void compress(vector<int> &vec) { vector<int> temp = vec; sort(temp.begin(), temp.end()); temp.erase(unique(temp.be...
#include <bits/stdc++.h> using namespace std; const string D = "^>v<"; const int dx[] = {0, 1, 0, -1}; const int dy[] = {-1, 0, 1, 0}; const int inf = 1 << 25; int fld[3000][3000], w, h; int ans; void compress(vector<int> &vec) { vector<int> temp = vec; sort(temp.begin(), temp.end()); temp.erase(unique(temp.be...
replace
58
59
58
59
TLE
p01820
C++
Runtime Error
#include <bits/stdc++.h> #define MAX 2048 #define inf 1 << 29 #define linf 1e16 #define eps (1e-8) #define mod 1000000007 #define pi acos(-1) #define phi (1.0 + sqrt(5)) / 2.0 #define f first #define s second #define mp make_pair #define pb push_back #define all(a) (a).begin(), (a).end() #define pd(a) printf("%.10f\n",...
#include <bits/stdc++.h> #define MAX 3003 #define inf 1 << 29 #define linf 1e16 #define eps (1e-8) #define mod 1000000007 #define pi acos(-1) #define phi (1.0 + sqrt(5)) / 2.0 #define f first #define s second #define mp make_pair #define pb push_back #define all(a) (a).begin(), (a).end() #define pd(a) printf("%.10f\n",...
replace
1
2
1
2
0
p01825
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; using ld = long double; const ld eps = 1e-9; typedef ld Weight; struct Edge { int src, dest; int cap, rev; Weight weight; bool operator<(const Edge &rhs) const { return weight > rhs.weight; } }; /* ??????????????¬ */ #include <complex> typedef complex<ld> Point;...
#include "bits/stdc++.h" using namespace std; using ld = long double; const ld eps = 1e-9; typedef ld Weight; struct Edge { int src, dest; int cap, rev; Weight weight; bool operator<(const Edge &rhs) const { return weight > rhs.weight; } }; /* ??????????????¬ */ #include <complex> typedef complex<ld> Point;...
replace
629
630
629
631
TLE
p01825
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> P; #define EACH(i, a) for (auto &i : a) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--) #define REP(i, n) for (l...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> P; #define EACH(i, a) for (auto &i : a) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--) #define REP(i, n) for (l...
replace
79
80
79
81
TLE
p01829
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string S, res; cin >> S; ll n = S.size(), md = -1, MAX = 1, s = stoi(S); vector<int> digit = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; for (int i = 0; i < n; i++) { MAX *= 10; } do { ll val = 0; string v; for (int i = ...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string S, res; cin >> S; ll n = S.size(), md = -1, MAX = 1, s = stoll(S); vector<int> digit = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; for (int i = 0; i < n; i++) { MAX *= 10; } do { ll val = 0; string v; for (int i =...
replace
7
8
7
8
0
p01829
C++
Runtime Error
#include <cmath> #include <iomanip> #include <iostream> #include <string> using namespace std; using lint = long long; lint ten = 1; lint M; lint maxdiff = 0, ans = 0; void dfs(int N, int used, lint num) { if (N == 0) { lint diff = min(abs(num - M), ten - abs(num - M)); if (diff > maxdiff || (diff == maxdi...
#include <cmath> #include <iomanip> #include <iostream> #include <string> using namespace std; using lint = long long; lint ten = 1; lint M; lint maxdiff = 0, ans = 0; void dfs(int N, int used, lint num) { if (N == 0) { lint diff = min(abs(num - M), ten - abs(num - M)); if (diff > maxdiff || (diff == maxdi...
replace
34
35
34
35
0
p01840
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defin...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defin...
replace
27
29
27
29
0
p01840
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define PB push_back #define MP make_pair #define ALL(a) (a).begin(), (a).end() #define ll long long using namespace std; int main() { int n, m, t, a; int time[10100]; memset(time, 0, sizeof(time)); cin >> n >> m >> t; REP(i, n) { ci...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define PB push_back #define MP make_pair #define ALL(a) (a).begin(), (a).end() #define ll long long using namespace std; int main() { int n, m, t, a; int time[10100]; memset(time, 0, sizeof(time)); cin >> n >> m >> t; REP(i, n) { ci...
replace
15
16
15
16
0
p01840
C++
Runtime Error
#include <iostream> using namespace std; int main() { int N, M, T, t[100]; int imos[10001] = {0}; cin >> N >> M >> T; for (int i = 0; i < N; i++) { int t; cin >> t; imos[t - M]++, imos[t + M]--; } for (int i = 1; i <= T; i++) { imos[i] += imos[i - 1]; } int cnt = 0; for (int i = 0; ...
#include <iostream> using namespace std; int main() { int N, M, T, t[100]; int imos[30000] = {0}; cin >> N >> M >> T; for (int i = 0; i < N; i++) { int t; cin >> t; imos[t - M]++, imos[t + M]--; } for (int i = 1; i <= T; i++) { imos[i] += imos[i - 1]; } int cnt = 0; for (int i = 0; ...
replace
6
7
6
7
0
p01840
C++
Runtime Error
/* template.cpp {{{ */ #include <bits/stdc++.h> using namespace std; #define get_macro(a, b, c, d, name, ...) name #define rep(...) get_macro(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__) #define rrep(...) \ get_macro(__VA_ARGS__, rrep4, rrep3, rrep2, r...
/* template.cpp {{{ */ #include <bits/stdc++.h> using namespace std; #define get_macro(a, b, c, d, name, ...) name #define rep(...) get_macro(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__) #define rrep(...) \ get_macro(__VA_ARGS__, rrep4, rrep3, rrep2, r...
replace
42
43
42
43
0
p01840
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <utility> #include ...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <utility> #include ...
replace
42
43
42
43
0
p01840
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define INF 999999999 #define mod 1000000007 #define rep(i, n) for (int i = 0; i < int(n...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define INF 999999999 #define mod 1000000007 #define rep(i, n) for (int i = 0; i < int(n...
replace
37
39
37
39
0
p01840
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; signed main() { bool a[10001]{}; int b, c, d; cin >> b >> c >> d; for (int e = 0; e < b; e++) { int f; cin >> f; for (int g = f - c; g < f + c; g++) { a[g] = true; } } int s = 0; for (int h = 0; h < d; h++) { if (!a[h]) s++; ...
#include <bits/stdc++.h> using namespace std; signed main() { bool a[30000]{}; int b, c, d; cin >> b >> c >> d; for (int e = 0; e < b; e++) { int f; cin >> f; for (int g = f - c; g < f + c; g++) { a[g] = true; } } int s = 0; for (int h = 0; h < d; h++) { if (!a[h]) s++; ...
replace
4
5
4
5
0
p01840
C++
Runtime Error
#include <iostream> using namespace std; int a[10000], n, m, t, p; int main() { cin >> n >> m >> t; for (int i = 0; i < n; i++) { cin >> p; a[p - m]++; a[p + m]--; } for (int i = 1; i < t; i++) a[i] += a[i - 1]; int cnt = 0; for (int i = 0; i < t; i++) { if (a[i] == 0) cnt++; } ...
#include <iostream> using namespace std; int a[100000], n, m, t, p; int main() { cin >> n >> m >> t; for (int i = 0; i < n; i++) { cin >> p; a[p - m]++; a[p + m]--; } for (int i = 1; i < t; i++) a[i] += a[i - 1]; int cnt = 0; for (int i = 0; i < t; i++) { if (a[i] == 0) cnt++; } ...
replace
2
3
2
3
0
p01840
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m, t; cin >> n >> m >> t; int s[11451] = {}; for (int i = 0; i < n; i++) { int a; cin >> a; s[a - m + 1]++; s[a + m + 1]--; } for (int i = 1; i < 11450; i++) { s[i] += s[i - 1]; } int ans = 0; for (int i = 1; i <=...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, t; cin >> n >> m >> t; int s[114514] = {}; for (int i = 0; i < n; i++) { int a; cin >> a; s[a - m + 1]++; s[a + m + 1]--; } for (int i = 1; i < 11450; i++) { s[i] += s[i - 1]; } int ans = 0; for (int i = 1; i <...
replace
6
7
6
7
0
p01840
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { int n, m, t; int x; cin >> n >> m >> t; int b[10101] = {}; for (int i = 0; i < n; i++) { cin >> x; b[x - m]--; b[x + m]++; } int ans = 0; if (b[0] == 0) ans++; for (int i = 1; i < t; i++) { b[i] += b[i - 1]; if (b[i] ==...
#include <iostream> using namespace std; int main(void) { int n, m, t; int x; cin >> n >> m >> t; int b[10101] = {}; for (int i = 0; i < n; i++) { cin >> x; b[x - m]--; if (x + m <= t) b[x + m]++; } int ans = 0; if (b[0] == 0) ans++; for (int i = 1; i < t; i++) { b[i] += b[i...
replace
11
12
11
13
0
p01840
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n, N) for (int i = n; i < N; i++) #define p(S) cout << S << endl using namespace std; int main() { int N, M, T; cin >> N >> M >> T; int t[10001]; fill(t, t + 10001, 1); int let; int ans = 0; REP(i, 0, N) { cin >> let; REP(j, let - M + 1, let + M + 1) { t[j]...
#include <bits/stdc++.h> #define REP(i, n, N) for (int i = n; i < N; i++) #define p(S) cout << S << endl using namespace std; int main() { int N, M, T; cin >> N >> M >> T; int t[10001]; fill(t, t + 10001, 1); int let; int ans = 0; REP(i, 0, N) { cin >> let; REP(j, let - M + 1, let + M + 1) { ...
replace
14
15
14
19
0
p01840
C++
Runtime Error
// // main.cpp // Delivery to a Luxurious House // // Created by x15071xx on 2017/06/19. // Copyright ?? 2017??´ AIT. All rights reserved. // #include <iostream> #include <vector> using namespace std; int main(int argc, const char *argv[]) { int n, m, t, taroSc[10000] = {0}, time = 0; vector<int> cometime; ...
// // main.cpp // Delivery to a Luxurious House // // Created by x15071xx on 2017/06/19. // Copyright ?? 2017??´ AIT. All rights reserved. // #include <iostream> #include <vector> using namespace std; int main(int argc, const char *argv[]) { int n, m, t, taroSc[100000] = {0}, time = 0; vector<int> cometime; ...
replace
14
15
14
15
0
p01840
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) #define REAP(i, a, n) for (int i = (a); i < (n); i++) #define YES cout << "Yes" << endl #define NO cout << "No" << endl #define fr first #define sc second #define pb push_back #define All(v) v.begin(), v.end() typedef long lo...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) #define REAP(i, a, n) for (int i = (a); i < (n); i++) #define YES cout << "Yes" << endl #define NO cout << "No" << endl #define fr first #define sc second #define pb push_back #define All(v) v.begin(), v.end() typedef long lo...
replace
21
22
21
22
0
p01840
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; long long int mod = 1000000007; int main(void) { int n, m, t; cin >> n >> m >> t; vector<bool> a(10000 + 5, false); for (int...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; long long int mod = 1000000007; int main(void) { int n, m, t; cin >> n >> m >> t; vector<bool> a(10000 + 5, false); for (int...
replace
22
23
22
23
0
p01840
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <tuple> #include <vec...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <tuple> #include <vec...
replace
33
34
33
34
0
p01841
C++
Runtime Error
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; struct Node { int l, r; int num; Node() { l = r = -1; } }; int number(str...
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; struct Node { int l, r; int num; Node() { l = r = -1; } }; int number(str...
replace
65
66
65
66
0
p01841
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 rep2(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define rrep2(i, a, b) for (int i = (a)-1; i >= b; i--) #define all(...
#include <bits/stdc++.h> using namespace std; #define int long long // <-----!!!!!!!!!!!!!!!!!!! #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define rrep2(i, a, b) for (int i = (a)-1; i >= b; i--) #define all(...
replace
126
132
126
131
TLE
p01842
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG_MODE #define DBG(n) n; #else #define DBG(n) ; #endif #define REP(i, n) for (ll(i) = (0); (i) < (n); ++i) #define rep(i, s, g) for (ll(i) = (s); (i) < (g); ++i) #define rrep(i, s, g) for (ll(i) = (s); i >= (g); --(i)) #define PB push_back #define MP make_pair ...
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG_MODE #define DBG(n) n; #else #define DBG(n) ; #endif #define REP(i, n) for (ll(i) = (0); (i) < (n); ++i) #define rep(i, s, g) for (ll(i) = (s); (i) < (g); ++i) #define rrep(i, s, g) for (ll(i) = (s); i >= (g); --(i)) #define PB push_back #define MP make_pair ...
insert
64
64
64
66
TLE
p01842
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = int64_t; using PLL = pair<ll, ll>; template <typename T> using V = vector<T>; template <typename T> using VV = V<V<T>>; ll memo[2][50][50][50][50][2]; bool calced[2][50][50][50][50][2]; V<ll> decka, deckb; ll pass_turn(ll player, ll rest_a, ll rest_b, ll stack_...
#include <bits/stdc++.h> using namespace std; using ll = int64_t; using PLL = pair<ll, ll>; template <typename T> using V = vector<T>; template <typename T> using VV = V<V<T>>; ll memo[2][55][55][55][55][2]; bool calced[2][55][55][55][55][2]; V<ll> decka, deckb; ll pass_turn(ll player, ll rest_a, ll rest_b, ll stack_...
replace
7
9
7
9
-11
p01845
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int r, w, c, R; while (1) { int count = 0; cin >> r >> w >> c >> R; if (r == 0) break; while (1) { if ((double)(r + count * R) / w == c) { break; } else if ((double)(r + count * R) / w < c) { count++; } el...
#include <iostream> using namespace std; int main() { int r, w, c, R; while (1) { int count = 0; cin >> r >> w >> c >> R; if (r == 0) break; if (w * c <= r) { } else if ((w * c - r) % R == 0) { count = (w * c - r) / R; } else count = (w * c - r) / R + 1; cout << count ...
replace
10
19
10
15
TLE
p01845
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int r, w, c, R; while (cin >> r >> w >> c >> R) { int ans = (w * c - r) / R; if ((w * c - r) % R) ++ans; if (w * c <= r) ans = 0; cout << ans << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int r, w, c, R; while (cin >> r >> w >> c >> R, r) { int ans = (w * c - r) / R; if ((w * c - r) % R) ++ans; if (w * c <= r) ans = 0; cout << ans << endl; } return 0; }
replace
6
7
6
7
-8
p01845
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { double R0, W0, C, R; while (cin >> R0 >> W0 >> C >> R, R0 + W0 + C + R != 0) { int ans = 0; while (!(R0 / W0 == C)) { if (R0 / W0 > C) { W0 += 1.0; } else if (R0 / W0 < C) { R0 += R; ans++; } } cout ...
#include <bits/stdc++.h> using namespace std; int main() { double R0, W0, C, R; while (cin >> R0 >> W0 >> C >> R, R0 + W0 + C + R != 0) { int ans = 0; while (R0 / W0 < C) { R0 += R; ans++; } cout << ans << endl; } return 0; }
replace
6
13
6
9
TLE
p01846
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; inline std::vector<std::string> split(const std::string &str, char sep) { std::vector<std::string> v; std::stringstream ss(str); std::string buffer; while (std::getline(ss, buffer, sep)) { v.push_back(buffer); } return v; } int w = 0, h = 0; inline string...
#include <bits/stdc++.h> using namespace std; inline std::vector<std::string> split(const std::string &str, char sep) { std::vector<std::string> v; std::stringstream ss(str); std::string buffer; while (std::getline(ss, buffer, sep)) { v.push_back(buffer); } return v; } int w = 0, h = 0; inline string...
replace
203
204
203
204
TLE
p01849
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define fi first #define sc second #define rep(i, x) for (int i = 0; i < x; i++)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<int, P> P1; typedef pair<P, P> P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define fi first #define sc second #define rep(i, x) for (int i = 0; i < x; i++)...
replace
18
19
18
19
0
p01849
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int INF = 1001001; int n, m; int s[15]; int d[101]; int dp[1 << 15][101]; int calc(int bit) { // cout << bit << endl; // 探索済みなら値return if (dp[bit][m] != INF) return dp[bit][m]; // 全部使った時のぬくもり int warm = 0; for (int i = 0; i < n; i++) { if (bit ...
#include <bits/stdc++.h> using namespace std; const int INF = 100100000001; int n, m; int s[15]; int d[101]; int dp[1 << 15][101]; int calc(int bit) { // cout << bit << endl; // 探索済みなら値return if (dp[bit][m] != INF) return dp[bit][m]; // 全部使った時のぬくもり int warm = 0; for (int i = 0; i < n; i++) { if ...
replace
2
3
2
3
TLE
p01849
C++
Runtime Error
#include <algorithm> #include <cfloat> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0...
#include <algorithm> #include <cfloat> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0...
replace
25
26
25
26
0
p01854
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(a) begin(a), end(a) #define MS(m, v) memset(m, v, sizeof(m)) #define D10 fixed << setprecision(10) typedef vector<int> vi; typedef vector<string> vs; typedef pair<int, char> P; t...
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(a) begin(a), end(a) #define MS(m, v) memset(m, v, sizeof(m)) #define D10 fixed << setprecision(10) typedef vector<int> vi; typedef vector<string> vs; typedef pair<int, char> P; t...
insert
28
28
28
30
TLE
p01856
C++
Runtime Error
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; int D[523][523]; int g[523][523]; int cnt, fx, fy; void find(int y, int x) { if (D[y][x]) { fy = y + 1; fx = x + 1; cnt += D[y][x]; int p = D[y][x]; g[fy][fx] = p; for (int i = 0; i < 3; i++) ...
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; int D[523][523]; int g[523][523]; int cnt, fx, fy; void find(int y, int x) { if (D[y][x]) { fy = y + 1; fx = x + 1; cnt++; int p = D[y][x]; g[fy][fx] = p; for (int i = 0; i < 3; i++) { f...
replace
15
16
15
16
0
p01858
C++
Runtime Error
#include <algorithm> #include <array> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <un...
#include <algorithm> #include <array> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <un...
replace
97
98
97
98
0
p01861
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define dump(...) cout << "# " << #__VA_ARGS__ << '=' << (__VA_ARGS__) << endl #define repi(i, a, b) for (int i = int(a); i < int(b); i++) #define peri(i, a, b) for (int i = int(b); i-- > int(a);) #define rep(i, n) repi(i, 0, n) #define per(i, n) peri(i, 0, n) #define all(...
#include <bits/stdc++.h> using namespace std; #define dump(...) cout << "# " << #__VA_ARGS__ << '=' << (__VA_ARGS__) << endl #define repi(i, a, b) for (int i = int(a); i < int(b); i++) #define peri(i, a, b) for (int i = int(b); i-- > int(a);) #define rep(i, n) repi(i, 0, n) #define per(i, n) peri(i, 0, n) #define all(...
replace
62
63
62
63
TLE
p01863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; struct SuffixArray { vector<int> SA; string s; void Build_SA(const string &str) { s = str; SA.resize(s.size()); iota(begin(SA), end(SA), 0); sort(begin(SA), end(SA), [&](const int &a, const int &b) { if (s[a] == s[b])...
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; struct SuffixArray { vector<int> SA; string s; void Build_SA(const string &str) { s = str; SA.resize(s.size()); iota(begin(SA), end(SA), 0); sort(begin(SA), end(SA), [&](const int &a, const int &b) { if (s[a] == s[b])...
replace
158
159
158
159
0
p01863
C++
Runtime Error
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; const ld eps = 1e-9; using ll = long long int; using ha = pair<ll, ll>; struct RollingHash { static const ll mul0 = 10009, mul1 = 10007; static const ll add0 = 100...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; const ld eps = 1e-9; using ll = long long int; using ha = pair<ll, ll>; struct RollingHash { static const ll mul0 = 10009, mul1 = 10007; static const ll add0 = 100...
replace
78
86
78
88
0