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
p00741
C++
Time Limit Exceeded
#include <cstdio> #define f(n) for (int i = 0; i < n; i++) #define s(w) scanf("%d", &w) int a, n, m, d[99][99]; int u[16] = {-1, -1, -1, 0, 0, 1, 1, 1, -1, 0, 1, -1, 1, -1, 0, 1}; void k(int x, int y) { if (d[x][y]) { d[x][y] = 0; f(8) k(x + u[i], y + u[i + 8]); } } int main() { a = 0; s(n); s(m); f(9801) d[0][i] = 0; f(n * m) s(d[i / n + 1][i % n + 1]); f(n * m) if (d[i / n + 1][i % n + 1]) a++, k(i / n + 1, i % n + 1); printf("%d\n", a); main(); }
#include <cstdio> #define f(n) for (int i = 0; i < n; i++) #define s(w) scanf("%d", &w) int a, n, m, d[99][99]; int u[16] = {-1, -1, -1, 0, 0, 1, 1, 1, -1, 0, 1, -1, 1, -1, 0, 1}; void k(int x, int y) { if (d[x][y]) { d[x][y] = 0; f(8) k(x + u[i], y + u[i + 8]); } } int main() { a = 0; s(n); s(m); if (n == 0) return 0; f(9801) d[0][i] = 0; f(n * m) s(d[i / n + 1][i % n + 1]); f(n * m) if (d[i / n + 1][i % n + 1]) a++, k(i / n + 1, i % n + 1); printf("%d\n", a); main(); }
insert
15
15
15
17
TLE
p00741
C++
Runtime Error
// 41 #include <iostream> using namespace std; int w, h; bool imap[50][50]; void ff(int y, int x) { imap[y][x] = false; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { if (imap[y + i][x + j]) { ff(y + i, x + j); } } } } int main() { for (; cin >> w >> h, w | h;) { fill_n(&imap[0][0], 50 * 50, false); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { cin >> imap[y][x]; } } int ans = 0; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { if (imap[y][x]) { ans++; ff(y, x); } } } cout << ans << endl; } return 0; }
// 41 #include <iostream> using namespace std; int w, h; bool imap[50][50]; void ff(int y, int x) { imap[y][x] = false; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { int ny = y + i, nx = x + j; if (0 <= ny && ny < h && 0 <= nx && nx < w && imap[ny][nx]) { ff(ny, nx); } } } } int main() { for (; cin >> w >> h, w | h;) { fill_n(&imap[0][0], 50 * 50, false); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { cin >> imap[y][x]; } } int ans = 0; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { if (imap[y][x]) { ans++; ff(y, x); } } } cout << ans << endl; } return 0; }
replace
12
14
12
15
TLE
p00741
C++
Runtime Error
#include <iostream> #include <queue> using namespace std; int map[20][20]; typedef pair<int, int> pxy; int h, w, ans = 0; const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[] = {0, 1, 0, -1, -1, 1, 1, -1}; void bfs(int sx, int sy) { queue<pxy> q; q.push(pxy(sx, sy)); while (!q.empty()) { int x, y; x = q.front().first; y = q.front().second; q.pop(); if (map[x][y]) { map[x][y] = 0; for (int i = 0; i < 8; i++) { int next_x = x + dx[i], next_y = y + dy[i]; if (map[next_x][next_y] && next_x < w && next_x >= 0 && next_y < h && next_y >= 0) { q.push(pxy(next_x, next_y)); } } } } } int main() { while (1) { cin >> w >> h; if (w == 0 && h == 0) { break; } else { for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) cin >> map[j][i]; for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) if (map[j][i]) { ans++; bfs(j, i); } cout << ans << endl; ans = 0; } } }
#include <iostream> #include <queue> using namespace std; int map[50][50]; typedef pair<int, int> pxy; int h, w, ans = 0; const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[] = {0, 1, 0, -1, -1, 1, 1, -1}; void bfs(int sx, int sy) { queue<pxy> q; q.push(pxy(sx, sy)); while (!q.empty()) { int x, y; x = q.front().first; y = q.front().second; q.pop(); if (map[x][y]) { map[x][y] = 0; for (int i = 0; i < 8; i++) { int next_x = x + dx[i], next_y = y + dy[i]; if (map[next_x][next_y] && next_x < w && next_x >= 0 && next_y < h && next_y >= 0) { q.push(pxy(next_x, next_y)); } } } } } int main() { while (1) { cin >> w >> h; if (w == 0 && h == 0) { break; } else { for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) cin >> map[j][i]; for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) if (map[j][i]) { ans++; bfs(j, i); } cout << ans << endl; ans = 0; } } }
replace
4
5
4
5
0
p00741
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; const double eps = 1e-10; const int dy[] = {-1, -1, 0, 1, 1, 1, 0, -1}; const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1}; int main() { int w, h; while (cin >> w >> h, w) { vector<vector<int>> table(h, vector<int>(w)); int res = 0; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) cin >> table[y][x]; } queue<pair<int, int>> q; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (table[i][j] == 0) continue; res++; q.push(make_pair(i, j)); while (!q.empty()) { pair<int, int> p = q.front(); q.pop(); int y = p.first, x = p.second; table[y][x] = 0; for (int k = 0; k < 8; k++) { int nx = x + dx[k], ny = y + dy[k]; if (0 <= nx && nx < w && 0 <= ny && ny < h && table[ny][nx] == 1) q.push(make_pair(ny, nx)); } } } } cout << res << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; const double eps = 1e-10; const int dy[] = {-1, -1, 0, 1, 1, 1, 0, -1}; const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1}; int main() { int w, h; while (cin >> w >> h, w) { vector<vector<int>> table(h, vector<int>(w)); int res = 0; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) cin >> table[y][x]; } queue<pair<int, int>> q; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (table[i][j] == 0) continue; res++; q.push(make_pair(i, j)); while (!q.empty()) { pair<int, int> p = q.front(); q.pop(); int y = p.first, x = p.second; // cout<<y<<" "<<x<<endl; if (table[y][x] == 0) continue; table[y][x] = 0; for (int k = 0; k < 8; k++) { int nx = x + dx[k], ny = y + dy[k]; if (0 <= nx && nx < w && 0 <= ny && ny < h && table[ny][nx] == 1) q.push(make_pair(ny, nx)); } } } } cout << res << endl; } return 0; }
insert
48
48
48
53
0
p00741
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <sstream> #include <string> #include <utility> #include <vector> #define REP(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; typedef vector<ll> vl; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef vector<string> vs; int a[50][50] = {}; int w, h; void island(int x, int y) { a[x][y] = 0; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; y++) { if (y + j < 0 || y + j > h - 1 || x + i > w - 1 || x + i < 0) { continue; } if (a[x + i][y + j] == 1) { island(x + i, y + j); } } } } int main() { while (cin >> w >> h, !(w == 0 && h == 0)) { REP(i, h) { REP(j, w) { cin >> a[j][i]; } } int ans(0); REP(i, h) { REP(j, w) { if (a[j][i] == 1) { island(j, i); ans++; } } } cout << ans << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <sstream> #include <string> #include <utility> #include <vector> #define REP(i, n) for (int i = 0; i < n; i++) typedef long long ll; using namespace std; typedef vector<ll> vl; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef vector<string> vs; int a[50][50] = {}; int w, h; void island(int x, int y) { a[x][y] = 0; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (y + j < 0 || y + j > h - 1 || x + i > w - 1 || x + i < 0) { continue; } if (a[x + i][y + j] == 1) { island(x + i, y + j); } } } } int main() { while (cin >> w >> h, !(w == 0 && h == 0)) { REP(i, h) { REP(j, w) { cin >> a[j][i]; } } int ans(0); REP(i, h) { REP(j, w) { if (a[j][i] == 1) { island(j, i); ans++; } } } cout << ans << endl; } return 0; }
replace
23
24
23
24
TLE
p00741
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, p, n) for (int i = (int)p; i < (int)n; i++) #define repp(i, p, n) for (int i = (int)p; i >= (int)n; i--) #define Sort(x) sort(x.begin(), x.end()) #define PSort(x) sort(begin(x), end(x), pairCompare) #define ll long long #define INF 2000000000 #define pb push_back #define mp make_pair #define PI 3.14159265358979 int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1}; using namespace std; vector<vector<int>> v; int w, h; void dfs(int y, int x) { if (v[y][x] == 1) v[y][x] = 0; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { int nx = x + i, ny = y + j; if (!(nx < 0 || ny < 0 || nx >= w || ny >= h) && v[ny][nx] == 1) dfs(ny, nx); } } return; } int main() { while (1) { int ans = 0; cin >> w >> h; if (w == 0 && h == 0) break; v.resize(h, vector<int>(w)); rep(i, 0, h) { rep(j, 0, w) { cin >> v[i][j]; } } rep(i, 0, h) { rep(j, 0, w) { if (v[i][j] == 1) { ans++; dfs(i, j); } } } cout << ans << endl; } return 0; }
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, p, n) for (int i = (int)p; i < (int)n; i++) #define repp(i, p, n) for (int i = (int)p; i >= (int)n; i--) #define Sort(x) sort(x.begin(), x.end()) #define PSort(x) sort(begin(x), end(x), pairCompare) #define ll long long #define INF 2000000000 #define pb push_back #define mp make_pair #define PI 3.14159265358979 int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1}; using namespace std; vector<vector<int>> v; int w, h; void dfs(int y, int x) { if (v[y][x] == 1) v[y][x] = 0; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { int nx = x + i, ny = y + j; if (!(nx < 0 || ny < 0 || nx >= w || ny >= h) && v[ny][nx] == 1) dfs(ny, nx); } } return; } int main() { while (1) { int ans = 0; cin >> w >> h; if (w == 0 && h == 0) break; v.resize(h, vector<int>(w)); rep(i, 0, h) { rep(j, 0, w) { cin >> v[i][j]; } } rep(i, 0, h) { rep(j, 0, w) { if (v[i][j] == 1) { ans++; dfs(i, j); } } } cout << ans << endl; v.clear(); } return 0; }
insert
71
71
71
72
0
p00741
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using pq_int = priority_queue<int, vector<int>, greater<int>>; const ll LINF = 0x3fffffffffffffff; const ll MOD = 1000000007; const ll MODD = 0x3b800001; const int INF = 0x3fffffff; const double DINF = numeric_limits<double>::infinity(); #define _overload4(_1, _2, _3, _4, name, ...) name #define _overload3(_1, _2, _3, name, ...) name #define _rep1(n) _rep2(i, n) #define _rep2(i, n) _rep3(i, 0, n) #define _rep3(i, a, b) for (ll i = a; i < b; ++i) #define _rep4(i, a, b, c) for (ll i = a; i < b; i += c) #define rep(...) \ _overload4(__VA_ARGS__, _rep4, _rep3, _rep2, _rep1)(__VA_ARGS__) #define _rrep1(n) _rrep2(i, n) #define _rrep2(i, n) _rrep3(i, 0, n) #define _rrep3(i, a, b) for (ll i = b - 1; i >= a; i--) #define _rrep4(i, a, b, c) for (ll i = a + (b - a - 1) / c * c; i >= a; i -= c) #define rrep(...) \ _overload4(__VA_ARGS__, _rrep4, _rrep3, _rrep2, _rrep1)(__VA_ARGS__) #define each(i, a) for (auto &&i : a) #define sum(...) accumulate(range(__VA_ARGS__), 0LL) #define _range(i) (i).begin(), (i).end() #define _range2(i, k) (i).begin(), (i).begin() + k #define _range3(i, a, b) (i).begin() + a, (i).begin() + b #define range(...) \ _overload3(__VA_ARGS__, _range3, _range2, _range)(__VA_ARGS__) #define Yes(i) out(i ? "Yes" : "No") #define YES(i) out(i ? "YES" : "NO") // #define START auto start=system_clock::now() // #define END auto // end=system_clock::now();cerr<<duration_cast<milliseconds>(end-start).count()<<" // ms\n" #define elif else if #define unless(a) if (!(a)) #define INT(...) \ int __VA_ARGS__; \ in(__VA_ARGS__) #define LL(...) \ ll __VA_ARGS__; \ in(__VA_ARGS__) #define STR(...) \ string __VA_ARGS__; \ in(__VA_ARGS__) #define CHR(...) \ char __VA_ARGS__; \ in(__VA_ARGS__) #define DBL(...) \ double __VA_ARGS__; \ in(__VA_ARGS__) #define vec(type, name, ...) vector<type> name(__VA_ARGS__) #define VEC(type, name, size) \ vector<type> name(size); \ in(name) #define vv(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define VV(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)); \ in(name) __attribute__((constructor)) void SETTINGS() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15); }; template <class T> inline constexpr T gcd(T a, T b) { if (a == b) return a; else return gcd(b, (a - 1) % b + 1); } template <class T> inline constexpr T min(vector<T> &v) { return *min_element(range(v)); } inline char min(string &v) { return *min_element(range(v)); } template <class T> inline constexpr T max(vector<T> &v) { return *max_element(range(v)); } inline char max(string &v) { return *max_element(range(v)); } template <typename T> inline bool update_min(T &mn, const T &cnt) { if (mn > cnt) { mn = cnt; return 1; } else return 0; } template <typename T> inline bool update_max(T &mx, const T &cnt) { if (mx < cnt) { mx = cnt; return 1; } else return 0; } inline void in() {} template <class T> istream &operator>>(istream &is, vector<T> &vec); template <class T, size_t size> istream &operator>>(istream &is, array<T, size> &vec); template <class T, class L> istream &operator>>(istream &is, pair<T, L> &p); template <class T> ostream &operator<<(ostream &os, vector<T> &vec); template <class T, class L> ostream &operator<<(ostream &os, pair<T, L> &p); template <class T> istream &operator>>(istream &is, vector<T> &vec) { for (T &x : vec) is >> x; return is; } template <class T, class L> istream &operator>>(istream &is, pair<T, L> &p) { is >> p.first; is >> p.second; return is; } template <class T> ostream &operator<<(ostream &os, vector<T> &vec) { os << vec[0]; rep(i, 1, vec.size()) { os << ' ' << vec[i]; } return os; } template <class T> ostream &operator<<(ostream &os, deque<T> &deq) { os << deq[0]; rep(i, 1, deq.size()) { os << ' ' << deq[i]; } return os; } template <class T, class L> ostream &operator<<(ostream &os, pair<T, L> &p) { os << p.first << " " << p.second; return os; } template <class Head, class... Tail> inline void in(Head &&head, Tail &&...tail) { cin >> head; in(move(tail)...); } template <class T> inline void out(T t) { cout << t << '\n'; } inline void out() { cout << '\n'; } template <class Head, class... Tail> inline void out(Head head, Tail... tail) { cout << head << ' '; out(move(tail)...); } template <class T> inline void err(T t) { cerr << t << '\n'; } inline void err() { cerr << '\n'; } template <class Head, class... Tail> inline void err(Head head, Tail... tail) { cerr << head << ' '; out(move(tail)...); } signed main() { ll w, h; while (in(w, h), w + h) { VV(ll, c, h, w); ll cnt = 0; rep(h) rep(j, w) if (c[i][j]) { cnt++; queue<pll> q; q.push({i, j}); while (!q.empty()) { ll x = q.front().first, y = q.front().second; q.pop(); c[x][y] = 0; vector<ll> dx = {1, 1, 1, 0, -1, -1, -1, 0}, dy = {1, 0, -1, -1, -1, 0, 1, 1}; rep(8) { try { if (c.at(x + dx[i]).at(y + dy[i])) q.push({x + dx[i], y + dy[i]}); } catch (...) { } } } } out(cnt); } }
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using pq_int = priority_queue<int, vector<int>, greater<int>>; const ll LINF = 0x3fffffffffffffff; const ll MOD = 1000000007; const ll MODD = 0x3b800001; const int INF = 0x3fffffff; const double DINF = numeric_limits<double>::infinity(); #define _overload4(_1, _2, _3, _4, name, ...) name #define _overload3(_1, _2, _3, name, ...) name #define _rep1(n) _rep2(i, n) #define _rep2(i, n) _rep3(i, 0, n) #define _rep3(i, a, b) for (ll i = a; i < b; ++i) #define _rep4(i, a, b, c) for (ll i = a; i < b; i += c) #define rep(...) \ _overload4(__VA_ARGS__, _rep4, _rep3, _rep2, _rep1)(__VA_ARGS__) #define _rrep1(n) _rrep2(i, n) #define _rrep2(i, n) _rrep3(i, 0, n) #define _rrep3(i, a, b) for (ll i = b - 1; i >= a; i--) #define _rrep4(i, a, b, c) for (ll i = a + (b - a - 1) / c * c; i >= a; i -= c) #define rrep(...) \ _overload4(__VA_ARGS__, _rrep4, _rrep3, _rrep2, _rrep1)(__VA_ARGS__) #define each(i, a) for (auto &&i : a) #define sum(...) accumulate(range(__VA_ARGS__), 0LL) #define _range(i) (i).begin(), (i).end() #define _range2(i, k) (i).begin(), (i).begin() + k #define _range3(i, a, b) (i).begin() + a, (i).begin() + b #define range(...) \ _overload3(__VA_ARGS__, _range3, _range2, _range)(__VA_ARGS__) #define Yes(i) out(i ? "Yes" : "No") #define YES(i) out(i ? "YES" : "NO") // #define START auto start=system_clock::now() // #define END auto // end=system_clock::now();cerr<<duration_cast<milliseconds>(end-start).count()<<" // ms\n" #define elif else if #define unless(a) if (!(a)) #define INT(...) \ int __VA_ARGS__; \ in(__VA_ARGS__) #define LL(...) \ ll __VA_ARGS__; \ in(__VA_ARGS__) #define STR(...) \ string __VA_ARGS__; \ in(__VA_ARGS__) #define CHR(...) \ char __VA_ARGS__; \ in(__VA_ARGS__) #define DBL(...) \ double __VA_ARGS__; \ in(__VA_ARGS__) #define vec(type, name, ...) vector<type> name(__VA_ARGS__) #define VEC(type, name, size) \ vector<type> name(size); \ in(name) #define vv(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define VV(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)); \ in(name) __attribute__((constructor)) void SETTINGS() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15); }; template <class T> inline constexpr T gcd(T a, T b) { if (a == b) return a; else return gcd(b, (a - 1) % b + 1); } template <class T> inline constexpr T min(vector<T> &v) { return *min_element(range(v)); } inline char min(string &v) { return *min_element(range(v)); } template <class T> inline constexpr T max(vector<T> &v) { return *max_element(range(v)); } inline char max(string &v) { return *max_element(range(v)); } template <typename T> inline bool update_min(T &mn, const T &cnt) { if (mn > cnt) { mn = cnt; return 1; } else return 0; } template <typename T> inline bool update_max(T &mx, const T &cnt) { if (mx < cnt) { mx = cnt; return 1; } else return 0; } inline void in() {} template <class T> istream &operator>>(istream &is, vector<T> &vec); template <class T, size_t size> istream &operator>>(istream &is, array<T, size> &vec); template <class T, class L> istream &operator>>(istream &is, pair<T, L> &p); template <class T> ostream &operator<<(ostream &os, vector<T> &vec); template <class T, class L> ostream &operator<<(ostream &os, pair<T, L> &p); template <class T> istream &operator>>(istream &is, vector<T> &vec) { for (T &x : vec) is >> x; return is; } template <class T, class L> istream &operator>>(istream &is, pair<T, L> &p) { is >> p.first; is >> p.second; return is; } template <class T> ostream &operator<<(ostream &os, vector<T> &vec) { os << vec[0]; rep(i, 1, vec.size()) { os << ' ' << vec[i]; } return os; } template <class T> ostream &operator<<(ostream &os, deque<T> &deq) { os << deq[0]; rep(i, 1, deq.size()) { os << ' ' << deq[i]; } return os; } template <class T, class L> ostream &operator<<(ostream &os, pair<T, L> &p) { os << p.first << " " << p.second; return os; } template <class Head, class... Tail> inline void in(Head &&head, Tail &&...tail) { cin >> head; in(move(tail)...); } template <class T> inline void out(T t) { cout << t << '\n'; } inline void out() { cout << '\n'; } template <class Head, class... Tail> inline void out(Head head, Tail... tail) { cout << head << ' '; out(move(tail)...); } template <class T> inline void err(T t) { cerr << t << '\n'; } inline void err() { cerr << '\n'; } template <class Head, class... Tail> inline void err(Head head, Tail... tail) { cerr << head << ' '; out(move(tail)...); } signed main() { ll w, h; while (in(w, h), w + h) { VV(ll, c, h, w); ll cnt = 0; rep(h) rep(j, w) if (c[i][j]) { cnt++; queue<pll> q; q.push({i, j}); while (!q.empty()) { ll x = q.front().first, y = q.front().second; q.pop(); if (!c[x][y]) continue; c[x][y] = 0; vector<ll> dx = {1, 1, 1, 0, -1, -1, -1, 0}, dy = {1, 0, -1, -1, -1, 0, 1, 1}; rep(8) { try { if (c.at(x + dx[i]).at(y + dy[i])) q.push({x + dx[i], y + dy[i]}); } catch (...) { } } } } out(cnt); } }
insert
161
161
161
163
TLE
p00742
C++
Runtime Error
//================================= // Created on: 2018/07/04 15:12:12 //================================= #include <bits/stdc++.h> using namespace std; int main() { for (int N;;) { cin >> N; if (N == 0) { break; } vector<int> coeff1(10, 0); vector<int> coeff2(10, 0); set<int> nz; map<char, int> ind; for (int i = 0; i < N; i++) { string s; cin >> s; reverse(s.begin(), s.end()); for (int j = 0, d = 1; j < s.size(); j++, d *= 10) { const char c = s[j]; if (ind.find(c) == ind.end()) { ind[c] = ind.size(); } const int in = ind[c]; (i < N - 1 ? coeff1 : coeff2).at(in) += d; if (j == s.size() - 1 and s.size() > 1) { nz.insert(in); } } } assert(ind.size() <= 10); vector<int> num{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int div = 1; for (int i = 0; i < 10 - (int)ind.size(); i++) { div *= (i + 1); } int ans = 0; do { bool ok = true; for (const int nzz : nz) { if (num[nzz] == 0) { ok = false; break; } } if (not ok) { continue; } int left = 0, right = 0; for (int i = 0; i < ind.size(); i++) { left += coeff1[i] * num[i], right += coeff2[i] * num[i]; } if (left == right) { ans++; } } while (next_permutation(num.begin(), num.end())); cout << ans / div << endl; } return 0; }
//================================= // Created on: 2018/07/04 15:12:12 //================================= #include <bits/stdc++.h> using namespace std; int main() { for (int N;;) { cin >> N; if (N == 0) { break; } vector<int> coeff1(10, 0); vector<int> coeff2(10, 0); set<int> nz; map<char, int> ind; for (int i = 0; i < N; i++) { string s; cin >> s; reverse(s.begin(), s.end()); for (int j = 0, d = 1; j < s.size(); j++, d *= 10) { const char c = s[j]; if (ind.find(c) == ind.end()) { const int s = ind.size(); ind[c] = s; } const int in = ind[c]; (i < N - 1 ? coeff1 : coeff2).at(in) += d; if (j == s.size() - 1 and s.size() > 1) { nz.insert(in); } } } assert(ind.size() <= 10); vector<int> num{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int div = 1; for (int i = 0; i < 10 - (int)ind.size(); i++) { div *= (i + 1); } int ans = 0; do { bool ok = true; for (const int nzz : nz) { if (num[nzz] == 0) { ok = false; break; } } if (not ok) { continue; } int left = 0, right = 0; for (int i = 0; i < ind.size(); i++) { left += coeff1[i] * num[i], right += coeff2[i] * num[i]; } if (left == right) { ans++; } } while (next_permutation(num.begin(), num.end())); cout << ans / div << endl; } return 0; }
replace
22
23
22
24
TLE
p00742
C++
Runtime Error
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1161&lang=jp #include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <numeric> #include <vector> #define ALL(v) (v).begin(), (v).end() #define REP(i, p, n) for (int i = p; i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) #define dump(a) (cerr << #a << "=" << (a) << endl) #define DUMP(list) \ cout << "{ "; \ for (auto nth : list) { \ cout << nth << " "; \ } \ cout << "}" << endl; using namespace std; vector<int> coefficient; vector<bool> is_top; int dfs(int m, int depth, int used, int value) { if (depth == m) return ((value == 0) ? 1 : 0); int ret = 0; rep(i, 10) { if (is_top[depth] && i == 0) continue; if (used & (1 << i)) continue; ret += dfs(m, depth + 1, used | (1 << i), value + coefficient[depth] * i); } return ret; } int main() { int n; while (cin >> n, n) { map<char, int> converter; // アルファベットの種類を数える vector<string> s(n, ""); rep(i, n) { cin >> s[i]; rep(j, s[i].size()) { if (!converter.count(s[i][j])) converter[s[i][j]] = converter.size(); } } // 各アルファベットの係数と先頭にあるかを求める int m = converter.size(); coefficient.assign(m, 0); is_top.assign(m, false); rep(i, n) { for (int j = s[i].size() - 1, k = 1; j >= 0; --j, k *= 10) { int ctoi = converter[s[i][j]]; if (j == 0 && s[i].size() > 1) is_top[ctoi] = true; coefficient[ctoi] += (i == n - 1) ? -k : k; } } // 覆面算が成り立つ式を満たす組み合わせを探索 cout << dfs(m, 0, 0, 0) << endl; } return 0; }
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1161&lang=jp #include <algorithm> #include <climits> #include <cmath> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <numeric> #include <vector> #define ALL(v) (v).begin(), (v).end() #define REP(i, p, n) for (int i = p; i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) #define dump(a) (cerr << #a << "=" << (a) << endl) #define DUMP(list) \ cout << "{ "; \ for (auto nth : list) { \ cout << nth << " "; \ } \ cout << "}" << endl; using namespace std; vector<int> coefficient; vector<bool> is_top; int dfs(int m, int depth, int used, int value) { if (depth == m) return ((value == 0) ? 1 : 0); int ret = 0; rep(i, 10) { if (is_top[depth] && i == 0) continue; if (used & (1 << i)) continue; ret += dfs(m, depth + 1, used | (1 << i), value + coefficient[depth] * i); } return ret; } int main() { int n; while (cin >> n, n) { map<char, int> converter; // アルファベットの種類を数える vector<string> s(n, ""); rep(i, n) { cin >> s[i]; rep(j, s[i].size()) { if (!converter.count(s[i][j])) converter.insert(make_pair(s[i][j], converter.size())); } } // 各アルファベットの係数と先頭にあるかを求める int m = converter.size(); coefficient.assign(m, 0); is_top.assign(m, false); rep(i, n) { for (int j = s[i].size() - 1, k = 1; j >= 0; --j, k *= 10) { int ctoi = converter[s[i][j]]; if (j == 0 && s[i].size() > 1) is_top[ctoi] = true; coefficient[ctoi] += (i == n - 1) ? -k : k; } } // 覆面算が成り立つ式を満たす組み合わせを探索 cout << dfs(m, 0, 0, 0) << endl; } return 0; }
replace
55
56
55
56
TLE
p00742
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define all(s) s.begin(), s.end() int main(void) { int n; while (cin >> n, n) { vector<string> s(n); map<char, int> a; map<char, bool> not_zero; rep(i, n) { cin >> s[i]; int k = s[i].size(); if (k > 1) not_zero[s[i][0]] = true; reverse(all(s[i])); rep(j, k) { a[s[i][j]] += pow(10, j) * (i == n - 1 ? -1 : 1); } } set<char> st; rep(i, n) { for (char c : s[i]) { st.insert(c); } } string char_list; for (char c : st) { char_list += c; // cerr<<a[c]<<" "; } // cerr<<endl; char_list += string(10 - (int)st.size(), '-'); sort(all(char_list)); int res = 0; int perm = 0; do { perm++; if (not_zero[char_list[0]]) continue; int sum = 0; rep(i, 10) sum += i * a[char_list[i]]; if (sum == 0) res++; } while (next_permutation(all(char_list))); cout << res << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define all(s) s.begin(), s.end() int main(void) { int n; while (cin >> n, n) { vector<string> s(n); // map<char,int> a; int a[256] = {}; // map<char,bool> not_zero; bool not_zero[256] = {}; rep(i, n) { cin >> s[i]; int k = s[i].size(); if (k > 1) not_zero[s[i][0]] = true; reverse(all(s[i])); rep(j, k) { a[s[i][j]] += pow(10, j) * (i == n - 1 ? -1 : 1); } } set<char> st; rep(i, n) { for (char c : s[i]) { st.insert(c); } } string char_list; for (char c : st) { char_list += c; // cerr<<a[c]<<" "; } // cerr<<endl; char_list += string(10 - (int)st.size(), '-'); sort(all(char_list)); int res = 0; int perm = 0; do { perm++; if (not_zero[char_list[0]]) continue; int sum = 0; rep(i, 10) sum += i * a[char_list[i]]; if (sum == 0) res++; } while (next_permutation(all(char_list))); cout << res << endl; } return 0; }
replace
9
11
9
13
TLE
p00742
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif // #define int long long #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--) #define all(c) begin(c), end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9) + 7; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } template <typename T> vector<T> compress(vector<T> v) { sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); return v; } template <typename T> int index(const vector<T> &v, T i) { return lower_bound(v.begin(), v.end(), i) - v.begin(); } signed main() { cin.tie(0); ios::sync_with_stdio(false); for (int n; cin >> n && n;) { vector<string> v(n); vector<char> c; rep(i, 0, n) { cin >> v[i]; reverse(all(v[i])); rep(j, 0, v[i].size()) { if (v[i][j] >= '0' && v[i][j] <= '9') continue; c.push_back(v[i][j]); } c.insert(c.end(), v[i].begin(), v[i].end()); } vector<char> zip = compress(c); dump(zip); int mp[128]; memset(mp, -1, sizeof(mp)); rep(i, 0, 10) mp[i + '0'] = i; bool head[128]; memset(head, 0, sizeof(head)); rep(i, 0, n) { if (v[i].size() > 1) { head[v[i].back()] = false; } } char used[10]; memset(used, 0, sizeof(used)); function<int(int, int)> dfs = [&](int idx, int num) { int add = 0; rep(i, 0, 10) { int digit = add; add = 0; bool flag = false; rep(j, 0, n - 1) { if (v[j].size() <= i) continue; if (mp[v[j][i]] == -1) { flag = true; break; } digit += mp[v[j][i]]; } if (flag) break; add += digit / 10; digit %= 10; if (v[n - 1].size() > i) { if (mp[v[n - 1][i]] == -1) break; if (digit != mp[v[n - 1][i]]) return 0; } else { if (digit > 0 || add > 0) return 0; else break; } } if (zip.size() > idx + 1) { int ret = 0; rep(i, 0, 10) { if (used[i]) continue; if (i == 0 && head[zip[idx + 1]]) continue; used[i] = zip[idx + 1]; mp[zip[idx + 1]] = i; ret += dfs(idx + 1, i); mp[zip[idx + 1]] = -1; used[i] = 0; } return ret; } else { return 1; } }; int ans = 0; rep(i, 0, 10) { if (used[i]) continue; if (i == 0 && head[zip[0]]) continue; used[i] = zip[0]; mp[zip[0]] = i; ans += dfs(0, i); mp[zip[0]] = -1; used[i] = 0; } cout << ans << endl; } return 0; }
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif // #define int long long #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--) #define all(c) begin(c), end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9) + 7; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } template <typename T> vector<T> compress(vector<T> v) { sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); return v; } template <typename T> int index(const vector<T> &v, T i) { return lower_bound(v.begin(), v.end(), i) - v.begin(); } signed main() { cin.tie(0); ios::sync_with_stdio(false); for (int n; cin >> n && n;) { vector<string> v(n); vector<char> c; rep(i, 0, n) { cin >> v[i]; reverse(all(v[i])); rep(j, 0, v[i].size()) { if (v[i][j] >= '0' && v[i][j] <= '9') continue; c.push_back(v[i][j]); } c.insert(c.end(), v[i].begin(), v[i].end()); } vector<char> zip = compress(c); dump(zip); int mp[128]; memset(mp, -1, sizeof(mp)); rep(i, 0, 10) mp[i + '0'] = i; bool head[128]; memset(head, 0, sizeof(head)); rep(i, 0, n) { if (v[i].size() > 1) { head[v[i].back()] = true; } } char used[10]; memset(used, 0, sizeof(used)); function<int(int, int)> dfs = [&](int idx, int num) { int add = 0; rep(i, 0, 10) { int digit = add; add = 0; bool flag = false; rep(j, 0, n - 1) { if (v[j].size() <= i) continue; if (mp[v[j][i]] == -1) { flag = true; break; } digit += mp[v[j][i]]; } if (flag) break; add += digit / 10; digit %= 10; if (v[n - 1].size() > i) { if (mp[v[n - 1][i]] == -1) break; if (digit != mp[v[n - 1][i]]) return 0; } else { if (digit > 0 || add > 0) return 0; else break; } } if (zip.size() > idx + 1) { int ret = 0; rep(i, 0, 10) { if (used[i]) continue; if (i == 0 && head[zip[idx + 1]]) continue; used[i] = zip[idx + 1]; mp[zip[idx + 1]] = i; ret += dfs(idx + 1, i); mp[zip[idx + 1]] = -1; used[i] = 0; } return ret; } else { return 1; } }; int ans = 0; rep(i, 0, 10) { if (used[i]) continue; if (i == 0 && head[zip[0]]) continue; used[i] = zip[0]; mp[zip[0]] = i; ans += dfs(0, i); mp[zip[0]] = -1; used[i] = 0; } cout << ans << endl; } return 0; }
replace
67
68
67
68
TLE
p00742
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int m, coef[10]; bool zero[10]; int dfs(int idx, int sum, int used) { if (idx == m) return sum == 0; int cnt = 0; rep(i, 10) { if (used & (1 << i) || (i == 0 && !zero[idx])) continue; cnt += dfs(idx + 1, sum + coef[idx] * i, used | (1 << i)); } return cnt; } int main() { for (int n; cin >> n, n;) { int f[128], idx = 0; fill(f, f + 128, -1); fill(coef, coef + 10, 0); fill(zero, zero + 10, true); rep(i, n) { string num; cin >> num; int sign = (i < n - 1 ? 1 : -1); for (int j = num.length() - 1, d = 1; j >= 0; j--, d *= 10) { if (f[num[j]] == -1) f[num[j]] = idx++; coef[f[num[j]]] += sign * d; } if (num.length() > 1) zero[f[num[0]]] = false; } m = idx; cout << dfs(0, 0, 0) << endl; } return 0; }
#include <algorithm> #include <iostream> #include <string> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int m, coef[10]; bool zero[10]; int dfs(int idx, int sum, int used) { if (idx == m) return sum == 0; int pr_max = 0, pr_min = 0; for (int i = idx; i < m; i++) { if (coef[i] > 0) pr_max += coef[i] * 9; if (coef[i] < 0) pr_min += coef[i] * 9; } if (sum > 0 && sum + pr_min > 0) return 0; if (sum < 0 && sum + pr_max < 0) return 0; int cnt = 0; rep(i, 10) { if (used & (1 << i) || (i == 0 && !zero[idx])) continue; cnt += dfs(idx + 1, sum + coef[idx] * i, used | (1 << i)); } return cnt; } int main() { for (int n; cin >> n, n;) { int f[128], idx = 0; fill(f, f + 128, -1); fill(coef, coef + 10, 0); fill(zero, zero + 10, true); rep(i, n) { string num; cin >> num; int sign = (i < n - 1 ? 1 : -1); for (int j = num.length() - 1, d = 1; j >= 0; j--, d *= 10) { if (f[num[j]] == -1) f[num[j]] = idx++; coef[f[num[j]]] += sign * d; } if (num.length() > 1) zero[f[num[0]]] = false; } m = idx; cout << dfs(0, 0, 0) << endl; } return 0; }
insert
14
14
14
26
TLE
p00742
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <stdio.h> #include <string.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int n, m, a[10], f[10], u[10]; int rec(int k, int t) { if (k == m) return t == 0 ? 1 : 0; int ans = 0; rep(i, 10) if (u[i] == 0) { if (i == 0 && f[k]) continue; u[i] = 1; ans += rec(k + 1, t + a[k] * i); u[i] = 0; } return ans; } int main() { for (;;) { cin >> n; if (n == 0) return 0; memset(a, 0, sizeof(a)); memset(f, 0, sizeof(f)); map<char, int> of; m = 0; rep(k, n) { string s; cin >> s; int t = 1; for (int i = s.size() - 1; i >= 0; i--) { if (of.count(s[i]) == 0) of[s[i]] = m++; a[of[s[i]]] += k < n - 1 ? t : -t; if (s.size() > 1 && i == 0) f[of[s[i]]] = 1; t *= 10; } } printf("%d\n", rec(0, 0)); } }
#include <algorithm> #include <iostream> #include <map> #include <stdio.h> #include <string.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int n, m, a[10], f[10], u[10]; int rec(int k, int t) { if (k == m) return t == 0 ? 1 : 0; int mx = 0, mn = 0; for (int i = k; i < m; i++) { if (a[i] > 0) mx += a[i] * 9; else mn += a[i] * 9; } if (t + mx < 0 || t + mn > 0) return 0; int ans = 0; rep(i, 10) if (u[i] == 0) { if (i == 0 && f[k]) continue; u[i] = 1; ans += rec(k + 1, t + a[k] * i); u[i] = 0; } return ans; } int main() { for (;;) { cin >> n; if (n == 0) return 0; memset(a, 0, sizeof(a)); memset(f, 0, sizeof(f)); map<char, int> of; m = 0; rep(k, n) { string s; cin >> s; int t = 1; for (int i = s.size() - 1; i >= 0; i--) { if (of.count(s[i]) == 0) of[s[i]] = m++; a[of[s[i]]] += k < n - 1 ? t : -t; if (s.size() > 1 && i == 0) f[of[s[i]]] = 1; t *= 10; } } printf("%d\n", rec(0, 0)); } }
insert
13
13
13
22
TLE
p00742
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef ll li; typedef pair<int, int> PI; #define EPS (1e-6) #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define REP(i, n) rep(i, n) #define F first #define S second #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) #define min3(a, b, c) min((a), min((b), (c))) #define min4(a, b, c, d) min((a), min3((b), (c), (d))) #define SZ(a) (int)((a).size()) #define ALL(a) a.begin(), a.end() #define FLL(a, b) memset((a), b, sizeof(a)) #define CLR(a) memset((a), 0, sizeof(a)) #define FOR(it, a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); ++it) template <typename T, typename U> ostream &operator<<(ostream &out, const pair<T, U> &val) { return out << "(" << val.F << ", " << val.S << ")"; } template <class T> ostream &operator<<(ostream &out, const vector<T> &val) { out << "{"; rep(i, SZ(val)) out << (i ? ", " : "") << val[i]; return out << "}"; } typedef double FP; typedef complex<FP> pt; typedef pt P; typedef pair<pt, pt> line; FP dot(P a, P b) { return real(conj(a) * b); } FP crs(P a, P b) { return imag(conj(a) * b); } P ortho(P a) { return conj(P(imag(a), real(a))); } P ortho(line a) { return ortho(a.S - a.F); } P crspt(P a, P b, P c, P d) { b -= a, d -= c; return a + b * crs(d, c - a) / crs(d, b); } P crspt(line a, line b) { return crspt(a.F, a.S, b.F, b.S); } bool onl(P a1, P a2, P b) { return abs(b - a1) + abs(b - a2) < abs(a1 - a2) + EPS; } bool onl(line a, P b) { return onl(a.F, a.S, b); } bool iscrs(line a, line b) { P c = crspt(a, b); return onl(a, c) && onl(b, c); } void pkuassert(bool t) { t = 1 / t; }; int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}; int dy[] = {1, 0, -1, 0, -1, 1, 1, -1}; enum { TOP, BTM, LFT, RGT, FRT, BCK }; int dxdy2ce[] = {RGT, FRT, LFT, BCK}; template <class T> T shift(T a, int b, int c, int d, int e) { __typeof(a[0]) t = a[b]; a[b] = a[c]; a[c] = a[d]; a[d] = a[e]; a[e] = t; return a; } template <class T> T rgt(T a) { return shift(a, TOP, LFT, BTM, RGT); } template <class T> T lft(T a) { return shift(a, TOP, RGT, BTM, LFT); } template <class T> T frt(T a) { return shift(a, TOP, BCK, BTM, FRT); } template <class T> T bck(T a) { return shift(a, TOP, FRT, BTM, BCK); } line mkl(P a, P v) { return line(a, a + v); } FP lpdist(line a, P b) { return abs(b - crspt(a, mkl(b, ortho(a)))); } FP spdist(line a, P b) { P c(crspt(a, mkl(b, ortho(a)))); return onl(a, c) ? abs(b - c) : min(abs(a.F - b), abs(a.S - b)); } FP ssdist(line a, line b) { return min4(spdist(a, b.F), spdist(a, b.S), spdist(b, a.F), spdist(b, a.S)); } int n; string in[10]; int ans; int used[10]; int vis[300]; void dfs(int ne, int le, int c) { if (le == 10) { bool ok = 1; rep(i, n) ok &= SZ(in[i]) < 2 || vis[(int)in[i][SZ(in[i]) - 1]] != 1; ans += ok; return; } if (ne == n) { int su = c; rep(i, n - 1) if (le < SZ(in[i])) su += vis[(int)in[i][le]] - 1; int wa = 0; if (le < SZ(in[n - 1])) wa = vis[(int)in[n - 1][le]] - 1; if (su % 10 != wa) return; c = su / 10; ne = 0; ++le; } if (SZ(in[ne]) <= le) { dfs(ne + 1, le, c); return; } if (vis[(int)in[ne][le]]) { dfs(ne + 1, le, c); return; } rep(i, 10) { if (used[i]) continue; used[i] = 1; vis[(int)in[ne][le]] = i + 1; dfs(ne + 1, le, c); vis[(int)in[ne][le]] = 0; used[i] = 0; } } void solve() { rep(i, n) cin >> in[i]; rep(i, n) reverse(ALL(in[i])); ans = 0; dfs(0, 0, 0); cout << ans << endl; } int main(int argc, char *argv[]) { while (cin >> n && n) solve(); return 0; }
#include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef ll li; typedef pair<int, int> PI; #define EPS (1e-6) #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define REP(i, n) rep(i, n) #define F first #define S second #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) #define min3(a, b, c) min((a), min((b), (c))) #define min4(a, b, c, d) min((a), min3((b), (c), (d))) #define SZ(a) (int)((a).size()) #define ALL(a) a.begin(), a.end() #define FLL(a, b) memset((a), b, sizeof(a)) #define CLR(a) memset((a), 0, sizeof(a)) #define FOR(it, a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); ++it) template <typename T, typename U> ostream &operator<<(ostream &out, const pair<T, U> &val) { return out << "(" << val.F << ", " << val.S << ")"; } template <class T> ostream &operator<<(ostream &out, const vector<T> &val) { out << "{"; rep(i, SZ(val)) out << (i ? ", " : "") << val[i]; return out << "}"; } typedef double FP; typedef complex<FP> pt; typedef pt P; typedef pair<pt, pt> line; FP dot(P a, P b) { return real(conj(a) * b); } FP crs(P a, P b) { return imag(conj(a) * b); } P ortho(P a) { return conj(P(imag(a), real(a))); } P ortho(line a) { return ortho(a.S - a.F); } P crspt(P a, P b, P c, P d) { b -= a, d -= c; return a + b * crs(d, c - a) / crs(d, b); } P crspt(line a, line b) { return crspt(a.F, a.S, b.F, b.S); } bool onl(P a1, P a2, P b) { return abs(b - a1) + abs(b - a2) < abs(a1 - a2) + EPS; } bool onl(line a, P b) { return onl(a.F, a.S, b); } bool iscrs(line a, line b) { P c = crspt(a, b); return onl(a, c) && onl(b, c); } void pkuassert(bool t) { t = 1 / t; }; int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}; int dy[] = {1, 0, -1, 0, -1, 1, 1, -1}; enum { TOP, BTM, LFT, RGT, FRT, BCK }; int dxdy2ce[] = {RGT, FRT, LFT, BCK}; template <class T> T shift(T a, int b, int c, int d, int e) { __typeof(a[0]) t = a[b]; a[b] = a[c]; a[c] = a[d]; a[d] = a[e]; a[e] = t; return a; } template <class T> T rgt(T a) { return shift(a, TOP, LFT, BTM, RGT); } template <class T> T lft(T a) { return shift(a, TOP, RGT, BTM, LFT); } template <class T> T frt(T a) { return shift(a, TOP, BCK, BTM, FRT); } template <class T> T bck(T a) { return shift(a, TOP, FRT, BTM, BCK); } line mkl(P a, P v) { return line(a, a + v); } FP lpdist(line a, P b) { return abs(b - crspt(a, mkl(b, ortho(a)))); } FP spdist(line a, P b) { P c(crspt(a, mkl(b, ortho(a)))); return onl(a, c) ? abs(b - c) : min(abs(a.F - b), abs(a.S - b)); } FP ssdist(line a, line b) { return min4(spdist(a, b.F), spdist(a, b.S), spdist(b, a.F), spdist(b, a.S)); } int n; string in[20]; int ans; int used[10]; int vis[300]; void dfs(int ne, int le, int c) { if (le == 10) { bool ok = 1; rep(i, n) ok &= SZ(in[i]) < 2 || vis[(int)in[i][SZ(in[i]) - 1]] != 1; ans += ok; return; } if (ne == n) { int su = c; rep(i, n - 1) if (le < SZ(in[i])) su += vis[(int)in[i][le]] - 1; int wa = 0; if (le < SZ(in[n - 1])) wa = vis[(int)in[n - 1][le]] - 1; if (su % 10 != wa) return; c = su / 10; ne = 0; ++le; } if (SZ(in[ne]) <= le) { dfs(ne + 1, le, c); return; } if (vis[(int)in[ne][le]]) { dfs(ne + 1, le, c); return; } rep(i, 10) { if (used[i]) continue; used[i] = 1; vis[(int)in[ne][le]] = i + 1; dfs(ne + 1, le, c); vis[(int)in[ne][le]] = 0; used[i] = 0; } } void solve() { rep(i, n) cin >> in[i]; rep(i, n) reverse(ALL(in[i])); ans = 0; dfs(0, 0, 0); cout << ans << endl; } int main(int argc, char *argv[]) { while (cin >> n && n) solve(); return 0; }
replace
95
96
95
96
0
p00743
C++
Runtime Error
// #define DEBUG #include <bits/stdc++.h> using namespace std; /*{{{*/ // template #define REP(i, n) for (int i = 0; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1 << 29 #define LINF LLONG_MAX / 3 #define MP make_pair #define PB push_back #define EB emplace_back #define ALL(v) (v).begin(), (v).end() #define all(v) ALL(v) #define debug(x) cerr << #x << ":" << x << endl #define debug2(x, y) cerr << #x << "," << #y ":" << x << "," << y << endl #define CININIT cin.tie(0), ios::sync_with_stdio(false) struct fin { fin() { cin.tie(0); ios::sync_with_stdio(false); } } fin_; struct Double { double d; explicit Double(double x) : d(x) {} }; ostream &operator<<(ostream &os, const Double x) { os << fixed << setprecision(20) << x.d; return os; } template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << "["; for (const auto &v : vec) { os << v << ","; } os << "]"; return os; } template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << "(" << p.first << "," << p.second << ")"; return os; } typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vvi; ll gcd(ll a, ll b) { if (b == 0) return a; else return gcd(b, a % b); } constexpr ll mod = 1e9 + 7; const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; /*}}}*/ // (time,speed,node,pre_node) using P = pair<pair<double, int>, pair<int, int>>; P makeP(double t, int s, int n, int np) { return make_pair(make_pair(t, s), make_pair(n, np)); } void solve(int n, int m) { int start, goal; cin >> start >> goal; start--; goal--; vector<vector<int>> g(n, vector<int>(n, INF)); vector<vector<int>> lim(n, vector<int>(n, 0)); rep(i, m) { int x, y, d, c; cin >> x >> y >> d >> c; x--; y--; g[x][y] = d; g[y][x] = d; lim[x][y] = c; lim[y][x] = c; } double visited[32][32][32]; rep(i, 32) rep(j, 32) rep(k, 32) visited[i][j][k] = DBL_MAX / 10; visited[start][0][start] = 0; priority_queue<P, vector<P>, greater<P>> que; que.push(makeP(0, 0, start, start)); while (!que.empty()) { auto p = que.top(); que.pop(); double ti = p.first.first; int speed = p.first.second; int node = p.second.first; int pre = p.second.second; #ifdef DEBUG cerr << "time : " << ti << " " << "node : " << node + 1 << " " << "speed " << speed << endl; #endif if (node == goal and speed == 1) { cout << Double(ti) << endl; return; } if (ti > visited[node][speed][pre]) continue; for (int next_node = 0; next_node < n; next_node++) { if (next_node == node or next_node == pre or g[node][next_node] == INF) continue; int d = g[node][next_node]; int c = lim[node][next_node]; for (int nspeed = speed - 1; nspeed <= speed + 1; nspeed++) { if (nspeed <= 0 or nspeed > c) continue; double nt = ti + (double)d / (double)nspeed; if (nt < visited[next_node][nspeed][pre]) { #ifdef DEBUG cerr << "\ttime " << nt << " " << "node " << next_node + 1 << " speed " << nspeed << endl; #endif visited[next_node][nspeed][node] = nt; que.push(makeP(nt, nspeed, next_node, node)); } } } } cout << "unreachable" << endl; } int main() { int n, m; while (cin >> n >> m) { if (n == 0 && m == 0) break; solve(n, m); } }
// #define DEBUG #include <bits/stdc++.h> using namespace std; /*{{{*/ // template #define REP(i, n) for (int i = 0; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1 << 29 #define LINF LLONG_MAX / 3 #define MP make_pair #define PB push_back #define EB emplace_back #define ALL(v) (v).begin(), (v).end() #define all(v) ALL(v) #define debug(x) cerr << #x << ":" << x << endl #define debug2(x, y) cerr << #x << "," << #y ":" << x << "," << y << endl #define CININIT cin.tie(0), ios::sync_with_stdio(false) struct fin { fin() { cin.tie(0); ios::sync_with_stdio(false); } } fin_; struct Double { double d; explicit Double(double x) : d(x) {} }; ostream &operator<<(ostream &os, const Double x) { os << fixed << setprecision(20) << x.d; return os; } template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << "["; for (const auto &v : vec) { os << v << ","; } os << "]"; return os; } template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << "(" << p.first << "," << p.second << ")"; return os; } typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vvi; ll gcd(ll a, ll b) { if (b == 0) return a; else return gcd(b, a % b); } constexpr ll mod = 1e9 + 7; const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; /*}}}*/ // (time,speed,node,pre_node) using P = pair<pair<double, int>, pair<int, int>>; P makeP(double t, int s, int n, int np) { return make_pair(make_pair(t, s), make_pair(n, np)); } void solve(int n, int m) { int start, goal; cin >> start >> goal; start--; goal--; vector<vector<int>> g(n, vector<int>(n, INF)); vector<vector<int>> lim(n, vector<int>(n, 0)); rep(i, m) { int x, y, d, c; cin >> x >> y >> d >> c; x--; y--; g[x][y] = d; g[y][x] = d; lim[x][y] = c; lim[y][x] = c; } double visited[32][32][32]; rep(i, 32) rep(j, 32) rep(k, 32) visited[i][j][k] = DBL_MAX / 10; visited[start][0][start] = 0; priority_queue<P, vector<P>, greater<P>> que; que.push(makeP(0, 0, start, start)); while (!que.empty()) { auto p = que.top(); que.pop(); double ti = p.first.first; int speed = p.first.second; int node = p.second.first; int pre = p.second.second; #ifdef DEBUG cerr << "time : " << ti << " " << "node : " << node + 1 << " " << "speed " << speed << endl; #endif if (node == goal and speed == 1) { cout << Double(ti) << endl; return; } if (ti > visited[node][speed][pre]) continue; for (int next_node = 0; next_node < n; next_node++) { if (next_node == node or next_node == pre or g[node][next_node] == INF) continue; int d = g[node][next_node]; int c = lim[node][next_node]; for (int nspeed = speed - 1; nspeed <= speed + 1; nspeed++) { if (nspeed <= 0 or nspeed > c) continue; double nt = ti + (double)d / (double)nspeed; if (nt < visited[next_node][nspeed][node]) { #ifdef DEBUG cerr << "\ttime " << nt << " " << "node " << next_node + 1 << " speed " << nspeed << endl; #endif visited[next_node][nspeed][node] = nt; que.push(makeP(nt, nspeed, next_node, node)); } } } } cout << "unreachable" << endl; } int main() { int n, m; while (cin >> n >> m) { if (n == 0 && m == 0) break; solve(n, m); } }
replace
120
121
120
121
TLE
p00743
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class T> inline T sqr(T x) { return x * x; } typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pii; typedef long long ll; #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define pb push_back #define mp make_pair #define each(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define exist(s, e) ((s).find(e) != (s).end()) #define range(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) range(i, 0, n) #define clr(a, b) memset((a), (b), sizeof(a)) #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; const double eps = 1e-10; const double pi = acos(-1.0); const ll INF = 1LL << 62; const int inf = 1 << 29; #define F first #define S second //((time, pre_node), (power, node)) typedef pair<pair<double, int>, pii> State; int main(void) { for (int n, m; cin >> n >> m, n;) { int s, z; cin >> s >> z; s--, z--; // (to, (length, limited_power)) vector<vector<pair<int, pii>>> edge(n); rep(i, m) { int x, y, d, c; cin >> x >> y >> d >> c; x--, y--; edge[x].pb(mp(y, mp(d, c))); edge[y].pb(mp(x, mp(d, c))); } priority_queue<State, vector<State>, greater<State>> q; for (auto e : edge[s]) { q.push(mp(mp((double)e.S.F, s), mp(1, e.F))); } // [pre_node][power][node] vector<vector<vector<double>>> minDist( n, vector<vector<double>>(31, vector<double>(n, (double)inf))); while (!q.empty()) { double cur_time = q.top().F.F; int cur_prev = q.top().F.S; int cur_power = q.top().S.F; int cur_v = q.top().S.S; q.pop(); if (minDist[cur_prev][cur_power][cur_v] < (double)inf - eps) continue; minDist[cur_prev][cur_power][cur_v] = cur_time; int next_prev = cur_v; range(next_power, max(1, cur_power - 1), cur_power + 2) { for (auto e : edge[cur_v]) { int next_v = e.F; if (next_v == cur_prev || e.S.S < next_power || minDist[next_prev][next_power][next_v] < (double)inf - eps) { continue; } double next_time = cur_time + (double)e.S.F / next_power; debug(e.S.F); debug(next_power); q.push(mp(mp(next_time, next_prev), mp(next_power, next_v))); } } } double res = (double)inf; rep(i, n) { res = min(res, minDist[i][1][z]); } if (res >= (double)inf - eps) cout << "unreachable" << endl; else printf("%.5f\n", res); } return 0; }
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class T> inline T sqr(T x) { return x * x; } typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pii; typedef long long ll; #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define pb push_back #define mp make_pair #define each(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define exist(s, e) ((s).find(e) != (s).end()) #define range(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) range(i, 0, n) #define clr(a, b) memset((a), (b), sizeof(a)) #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; const double eps = 1e-10; const double pi = acos(-1.0); const ll INF = 1LL << 62; const int inf = 1 << 29; #define F first #define S second //((time, pre_node), (power, node)) typedef pair<pair<double, int>, pii> State; int main(void) { for (int n, m; cin >> n >> m, n;) { int s, z; cin >> s >> z; s--, z--; // (to, (length, limited_power)) vector<vector<pair<int, pii>>> edge(n); rep(i, m) { int x, y, d, c; cin >> x >> y >> d >> c; x--, y--; edge[x].pb(mp(y, mp(d, c))); edge[y].pb(mp(x, mp(d, c))); } priority_queue<State, vector<State>, greater<State>> q; for (auto e : edge[s]) { q.push(mp(mp((double)e.S.F, s), mp(1, e.F))); } // [pre_node][power][node] vector<vector<vector<double>>> minDist( n, vector<vector<double>>(31, vector<double>(n, (double)inf))); while (!q.empty()) { double cur_time = q.top().F.F; int cur_prev = q.top().F.S; int cur_power = q.top().S.F; int cur_v = q.top().S.S; q.pop(); if (minDist[cur_prev][cur_power][cur_v] < (double)inf - eps) continue; minDist[cur_prev][cur_power][cur_v] = cur_time; int next_prev = cur_v; range(next_power, max(1, cur_power - 1), cur_power + 2) { for (auto e : edge[cur_v]) { int next_v = e.F; if (next_v == cur_prev || e.S.S < next_power || minDist[next_prev][next_power][next_v] < (double)inf - eps) { continue; } double next_time = cur_time + (double)e.S.F / next_power; q.push(mp(mp(next_time, next_prev), mp(next_power, next_v))); } } } double res = (double)inf; rep(i, n) { res = min(res, minDist[i][1][z]); } if (res >= (double)inf - eps) cout << "unreachable" << endl; else printf("%.5f\n", res); } return 0; }
delete
96
98
96
96
0
e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 3 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 3 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 3 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 3 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 3 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 3 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 3 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 3 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 2 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 30 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 29 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 28 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 27 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 26 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 25 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 24 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 23 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 22 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 21 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 20 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 19 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 18 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 17 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 16 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 15 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 14 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 13 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 12 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 11 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 10 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 9 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 8 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 7 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 6 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 5 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 4 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 3 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 1 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 1 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp e.S.F = 100 (L80) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp next_power = 2 (L81) /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00743/C++/s428986672.cpp
p00743
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define ALL(c) (c).begin(), (c).end() const int INF = 1 << 29; typedef double Weight; struct Edge { int src, dst; Weight weight; int c; // c ‚̓Oƒ‰ƒt‚ł͐§ŒÀ‘¬“xAqueue ‚ł͑¬“x Edge(int src, int dst, Weight weight, int c) : src(src), dst(dst), weight(weight), c(c) {} }; bool operator<(const Edge &e, const Edge &f) { return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!! e.src != f.src ? e.src < f.src : e.dst != f.dst ? e.dst < f.dst : e.c < f.c; } typedef vector<Edge> Edges; typedef vector<Edges> Graph; typedef pair<int, int> pii; double dist[30][30][32]; // dist[i][j][k] = ƒXƒs[ƒh k ‚̏ó‘Ô‚Å j ‚©‚ç // i ‚ɂ‚­Å’Z‹——£ double dijkstra(const Graph &g, int s, int t) { int n = g.size(); REP(i, n) REP(j, n) REP(k, 32) dist[i][j][k] = INF; priority_queue<Edge> Q; Q.push(Edge(s, s, 0, 0)); int cnt = 0; while (!Q.empty()) { Edge e = Q.top(); Q.pop(); if (e.dst == t && e.c == 1) break; REP(k, 3) { int v = e.c - 1 + k; if (v <= 0) continue; if (dist[e.dst][e.src][v] < e.weight) continue; FOR(f, g[e.dst]) { if (v > f->c) continue; if (f->dst == e.src) continue; double hoge = e.weight + f->weight / v; if (dist[f->dst][f->src][v] > hoge) { dist[f->dst][f->src][v] = hoge; Q.push(Edge(f->src, f->dst, hoge, v)); } } } if (cnt++ > 1000000) break; } double res = INF; REP(i, n) res = min(res, dist[t][i][1]); return res; } int main() { int n, m; while (cin >> n >> m, n || m) { int s, t; cin >> s >> t; s--; t--; Graph g(n); REP(i, m) { int x, y, d, c; cin >> x >> y >> d >> c; x--; y--; g[x].push_back(Edge(x, y, d, c)); g[y].push_back(Edge(y, x, d, c)); } double res = dijkstra(g, s, t); if (res == INF) cout << "unreachable" << endl; else printf("%.5f\n", res); } }
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define ALL(c) (c).begin(), (c).end() const int INF = 1 << 29; typedef double Weight; struct Edge { int src, dst; Weight weight; int c; // c ‚̓Oƒ‰ƒt‚ł͐§ŒÀ‘¬“xAqueue ‚ł͑¬“x Edge(int src, int dst, Weight weight, int c) : src(src), dst(dst), weight(weight), c(c) {} }; bool operator<(const Edge &e, const Edge &f) { return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!! e.src != f.src ? e.src < f.src : e.dst != f.dst ? e.dst < f.dst : e.c < f.c; } typedef vector<Edge> Edges; typedef vector<Edges> Graph; typedef pair<int, int> pii; double dist[30][30][32]; // dist[i][j][k] = ƒXƒs[ƒh k ‚̏ó‘Ô‚Å j ‚©‚ç // i ‚ɂ‚­Å’Z‹——£ double dijkstra(const Graph &g, int s, int t) { int n = g.size(); REP(i, n) REP(j, n) REP(k, 32) dist[i][j][k] = INF; priority_queue<Edge> Q; Q.push(Edge(s, s, 0, 0)); int cnt = 0; while (!Q.empty()) { Edge e = Q.top(); Q.pop(); if (e.dst == t && e.c == 1) break; REP(k, 3) { int v = e.c - 1 + k; if (v <= 0) continue; if (dist[e.dst][e.src][v] < e.weight) continue; FOR(f, g[e.dst]) { if (v > f->c) continue; if (f->dst == e.src) continue; double hoge = e.weight + f->weight / v; if (dist[f->dst][f->src][v] > hoge) { dist[f->dst][f->src][v] = hoge; Q.push(Edge(f->src, f->dst, hoge, v)); } } } if (cnt++ > 200000) break; } double res = INF; REP(i, n) res = min(res, dist[t][i][1]); return res; } int main() { int n, m; while (cin >> n >> m, n || m) { int s, t; cin >> s >> t; s--; t--; Graph g(n); REP(i, m) { int x, y, d, c; cin >> x >> y >> d >> c; x--; y--; g[x].push_back(Edge(x, y, d, c)); g[y].push_back(Edge(y, x, d, c)); } double res = dijkstra(g, s, t); if (res == INF) cout << "unreachable" << endl; else printf("%.5f\n", res); } }
replace
72
73
72
73
TLE
p00743
C++
Memory Limit Exceeded
// MLE #include <algorithm> #include <cstdio> #include <iostream> #include <queue> #include <vector> using namespace std; struct node { char pos; char prev; char speed; double dist; node(int pos_, int prev_, int speed_, double dist_) : pos(pos_), prev(prev_), speed(speed_), dist(dist_) {} bool operator<(const node &n) const { return dist > n.dist; // 逆 } }; struct road { char to; double dist; char c; road(int t, double d, int c_) : to(t), dist(d), c(c_) {} }; int n, m; int s, g; vector<vector<road>> roads; double mindist[31][31][31]; void solve() { fill(mindist[0][0], mindist[31][0], 9e9); priority_queue<node> pq; for (int i = 0; i < roads[s].size(); ++i) { road r = roads[s][i]; pq.push(node(r.to, s, 1, r.dist)); mindist[r.to][s][1] = r.dist; } while (!pq.empty()) { node nd = pq.top(); pq.pop(); if (mindist[nd.pos][nd.prev][nd.speed] != nd.dist) { continue; } if (nd.pos == g && nd.speed == 1) { printf("%f\n", nd.dist); return; } for (int i = 0; i < roads[nd.pos].size(); ++i) { road r = roads[nd.pos][i]; if (r.to == nd.prev) { continue; } for (int j = -1; j < 2; ++j) { if (nd.speed + j > 0 && nd.speed + j <= r.c) { double nextdist = nd.dist + r.dist / (nd.speed + j); if (mindist[r.to][nd.pos][nd.speed + j] > nextdist) { mindist[r.to][nd.pos][nd.speed + j] = nextdist; pq.push(node(r.to, nd.pos, nd.speed + j, nextdist)); } } } } } puts("unreachable"); } int main() { int x, y, d, c; while (cin >> n >> m, n != 0) { roads = vector<vector<road>>(n + 1); cin >> s >> g; for (int i = 0; i < m; ++i) { cin >> x >> y >> d >> c; roads[x].push_back(road(y, d, c)); roads[y].push_back(road(x, d, c)); } solve(); } }
#include <algorithm> #include <cstdio> #include <iostream> #include <queue> #include <vector> using namespace std; struct node { char pos; char prev; char speed; double dist; node(int pos_, int prev_, int speed_, double dist_) : pos(pos_), prev(prev_), speed(speed_), dist(dist_) {} bool operator<(const node &n) const { return dist > n.dist; // 逆 } }; struct road { char to; double dist; char c; road(int t, double d, int c_) : to(t), dist(d), c(c_) {} }; int n, m; int s, g; vector<vector<road>> roads; double mindist[31][31][31]; void solve() { fill(mindist[0][0], mindist[31][0], 9e9); priority_queue<node> pq; for (int i = 0; i < roads[s].size(); ++i) { road r = roads[s][i]; pq.push(node(r.to, s, 1, r.dist)); mindist[r.to][s][1] = r.dist; } while (!pq.empty()) { node nd = pq.top(); pq.pop(); if (mindist[nd.pos][nd.prev][nd.speed] != nd.dist) { continue; } if (nd.pos == g && nd.speed == 1) { printf("%f\n", nd.dist); return; } for (int i = 0; i < roads[nd.pos].size(); ++i) { road r = roads[nd.pos][i]; if (r.to == nd.prev) { continue; } for (int j = -1; j < 2; ++j) { if (nd.speed + j > 0 && nd.speed + j <= r.c) { double nextdist = nd.dist + r.dist / (nd.speed + j); if (mindist[r.to][nd.pos][nd.speed + j] > nextdist) { mindist[r.to][nd.pos][nd.speed + j] = nextdist; pq.push(node(r.to, nd.pos, nd.speed + j, nextdist)); } } } } } puts("unreachable"); } int main() { int x, y, d, c; while (cin >> n >> m, n != 0) { roads = vector<vector<road>>(n + 1); cin >> s >> g; for (int i = 0; i < m; ++i) { cin >> x >> y >> d >> c; roads[x].push_back(road(y, d, c)); roads[y].push_back(road(x, d, c)); } solve(); } }
delete
0
2
0
0
MLE
p00743
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int main() { int i, j; int n, m; while (cin >> n >> m, n || m) { int f, g; cin >> f >> g; f--; g--; int a[30][30], b[30][30]; memset(a, -1, sizeof(a)); for (i = 0; i < m; i++) { int p, q, r, s; cin >> p >> q >> r >> s; p--; q--; a[p][q] = a[q][p] = r; b[p][q] = b[q][p] = s; } int c[31][30][30]; memset(c, -1, sizeof(c)); priority_queue<pair<pair<double, int>, pair<int, int>>, vector<pair<pair<double, int>, pair<int, int>>>, greater<pair<pair<double, int>, pair<int, int>>>> d; for (i = 0; i < n; i++) { if (a[f][i] != -1) d.push(make_pair(make_pair(a[f][i], 1), make_pair(f, i))); } while (d.empty() == 0) { double p; int q, r, s; p = d.top().first.first; q = d.top().first.second; r = d.top().second.first; s = d.top().second.second; if (q == 1 && s == g) break; d.pop(); if (c[q][r][s]) { c[q][r][s] = 0; for (i = 0; i < n; i++) { if (i != r && a[s][i] != -1) { for (j = -1; j <= 1; j++) { if (1 <= q + j && q + j <= b[s][i]) d.push( make_pair(make_pair(p + (double)a[s][i] / (q + j), q + j), make_pair(s, i))); } } } } } if (d.empty()) cout << "unreachable" << endl; else cout << d.top().first.first << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int main() { int i, j; int n, m; while (cin >> n >> m, n || m) { int f, g; cin >> f >> g; f--; g--; int a[30][30], b[30][30]; memset(a, -1, sizeof(a)); for (i = 0; i < m; i++) { int p, q, r, s; cin >> p >> q >> r >> s; p--; q--; a[p][q] = a[q][p] = r; b[p][q] = b[q][p] = s; } int c[31][30][30]; memset(c, -1, sizeof(c)); priority_queue<pair<pair<double, int>, pair<int, int>>, vector<pair<pair<double, int>, pair<int, int>>>, greater<pair<pair<double, int>, pair<int, int>>>> d; for (i = 0; i < n; i++) { if (a[f][i] != -1) d.push(make_pair(make_pair(a[f][i], 1), make_pair(f, i))); } while (d.empty() == 0) { double p; int q, r, s; p = d.top().first.first; q = d.top().first.second; r = d.top().second.first; s = d.top().second.second; if (q == 1 && s == g) break; d.pop(); if (c[q][r][s]) { c[q][r][s] = 0; for (i = 0; i < n; i++) { if (i != r && a[s][i] != -1) { for (j = -1; j <= 1; j++) { if (1 <= q + j && q + j <= b[s][i] && c[q + j][s][i]) d.push( make_pair(make_pair(p + (double)a[s][i] / (q + j), q + j), make_pair(s, i))); } } } } } if (d.empty()) cout << "unreachable" << endl; else cout << d.top().first.first << endl; } return 0; }
replace
59
60
59
60
TLE
p00743
C++
Time Limit Exceeded
#include <cstdio> #include <cstring> #include <map> #include <queue> #define fst first #define snd second using namespace std; typedef struct { int dis; int lim; } edge; typedef pair<int, int> pp; typedef pair<int, pp> node; // v, (x,y) typedef pair<double, node> que; // sum, (v, (x,y)) edge input[50][50]; double G[50][50][50]; // x, y, v int main(void) { while (1) { int n, m, s, g; scanf("%d%d", &n, &m); if (!n) break; scanf("%d%d", &s, &g); s--, g--; memset(input, 0, sizeof(input)); memset(G, 0, sizeof(G)); for (int i = 0; i < m; i++) { int x, y, d, c; scanf("%d%d%d%d", &x, &y, &d, &c); x--, y--; input[x][y] = input[y][x] = {d, c}; } map<node, double> tbl; priority_queue<que> q; for (int i = 0; i < n; i++) if (input[s][i].dis) q.push(que(-0.0, node(1, pp(s, i)))); double res = 10000000.0; while (q.size()) { que t = q.top(); q.pop(); int v = t.snd.fst; int x = t.snd.snd.fst, y = t.snd.snd.snd; double sum = -t.fst + 1.0 * input[x][y].dis / v; if (tbl.find(t.snd) != tbl.end()) continue; tbl[t.snd] = sum; if (y == g && v == 1) { res = res < sum ? res : sum; continue; } for (int i = 0; i < n; i++) if (i != x && input[y][i].dis) { int dv[] = {-1, 0, 1}; for (int iv = 0; iv < 3; iv++) if (0 < v + dv[iv] && v + dv[iv] <= input[y][i].lim) q.push(que(-sum, node(v + dv[iv], pp(y, i)))); } } if (res > 1000000.0) puts("unreachable"); else printf("%f\n", res); } return 0; }
#include <cstdio> #include <cstring> #include <map> #include <queue> #define fst first #define snd second using namespace std; typedef struct { int dis; int lim; } edge; typedef pair<int, int> pp; typedef pair<int, pp> node; // v, (x,y) typedef pair<double, node> que; // sum, (v, (x,y)) edge input[50][50]; double G[50][50][50]; // x, y, v int main(void) { while (1) { int n, m, s, g; scanf("%d%d", &n, &m); if (!n) break; scanf("%d%d", &s, &g); s--, g--; memset(input, 0, sizeof(input)); memset(G, 0, sizeof(G)); for (int i = 0; i < m; i++) { int x, y, d, c; scanf("%d%d%d%d", &x, &y, &d, &c); x--, y--; input[x][y] = input[y][x] = {d, c}; } map<node, double> tbl; priority_queue<que> q; for (int i = 0; i < n; i++) if (input[s][i].dis) q.push(que(-0.0, node(1, pp(s, i)))); double res = 10000000.0; while (q.size()) { que t = q.top(); q.pop(); int v = t.snd.fst; int x = t.snd.snd.fst, y = t.snd.snd.snd; double sum = -t.fst + 1.0 * input[x][y].dis / v; if (tbl.find(t.snd) != tbl.end()) continue; tbl[t.snd] = sum; if (y == g && v == 1) { res = res < sum ? res : sum; continue; } for (int i = 0; i < n; i++) if (i != x && input[y][i].dis) { int dv[] = {-1, 0, 1}; for (int iv = 0; iv < 3; iv++) if (0 < v + dv[iv] && v + dv[iv] <= input[y][i].lim && tbl.find(node(v + dv[iv], pp(y, i))) == tbl.end()) q.push(que(-sum, node(v + dv[iv], pp(y, i)))); } } if (res > 1000000.0) puts("unreachable"); else printf("%f\n", res); } return 0; }
replace
69
70
69
71
TLE
p00743
C++
Time Limit Exceeded
#include <cstdio> #include <map> #include <queue> #include <vector> using namespace std; struct E { int t, c, d; E(int t, int c, int d) : t(t), c(c), d(d) {} }; vector<E> e[30]; struct S { double t; int cur, last, s; S(double t, int cur, int last, int s) : t(t), cur(cur), last(last), s(s) {} }; struct Cmp { bool operator()(const S &a, const S &b) { return a.t > b.t; } }; double F(int s, int g) { double time[31][30][30]; int i, j, k; fill_n(&time[0][0][0], sizeof(time) / sizeof(double), 1e99); priority_queue<S, vector<S>, Cmp> q; q.push(S(0, s, s, 1)); while (!q.empty()) { S s = q.top(); q.pop(); if (time[s.s][s.cur][s.last] <= s.t) continue; time[s.s][s.cur][s.last] = s.t; if (s.cur == g && s.s == 1) return s.t; for (i = 0; i < e[s.cur].size(); ++i) { E &r = e[s.cur][i]; if (s.last == r.t) continue; if (s.cur == s.last) q.push(S(s.t + r.d / double(s.s), r.t, s.cur, s.s)); else for (j = (s.s - 1 ? -1 : 0); j < 2; ++j) if (s.s + j <= r.c) q.push(S(s.t + r.d / double(s.s + j), r.t, s.cur, s.s + j)); } } return -1; } int main() { int n, m, s, g, x, y, d, c, i; while (scanf("%d%d", &n, &m), n) { for (i = 0; i < n; ++i) e[i].clear(); scanf("%d%d", &s, &g); while (m--) { scanf("%d%d%d%d", &x, &y, &d, &c); --x, --y; e[x].push_back(E(y, c, d)); e[y].push_back(E(x, c, d)); } double r = F(s - 1, g - 1); if (r < 0) puts("unreachable"); else printf("%f\n", r); } return 0; }
#include <cstdio> #include <map> #include <queue> #include <vector> using namespace std; struct E { int t, c, d; E(int t, int c, int d) : t(t), c(c), d(d) {} }; vector<E> e[30]; struct S { double t; int cur, last, s; S(double t, int cur, int last, int s) : t(t), cur(cur), last(last), s(s) {} }; struct Cmp { bool operator()(const S &a, const S &b) { return a.t > b.t; } }; double F(int s, int g) { double time[31][30][30]; int i, j, k; fill_n(&time[0][0][0], sizeof(time) / sizeof(double), 1e99); priority_queue<S, vector<S>, Cmp> q; q.push(S(0, s, s, 1)); while (!q.empty()) { S s = q.top(); q.pop(); if (time[s.s][s.cur][s.last] <= s.t) continue; time[s.s][s.cur][s.last] = s.t; if (s.cur == g && s.s == 1) return s.t; for (i = 0; i < e[s.cur].size(); ++i) { E &r = e[s.cur][i]; if (s.last == r.t) continue; if (s.cur == s.last) q.push(S(s.t + r.d / double(s.s), r.t, s.cur, s.s)); else for (j = (s.s - 1 ? -1 : 0); j < 2; ++j) if (s.s + j <= r.c && time[s.s + j][r.t][s.cur] > s.t + r.d / double(s.s + j)) q.push(S(s.t + r.d / double(s.s + j), r.t, s.cur, s.s + j)); } } return -1; } int main() { int n, m, s, g, x, y, d, c, i; while (scanf("%d%d", &n, &m), n) { for (i = 0; i < n; ++i) e[i].clear(); scanf("%d%d", &s, &g); while (m--) { scanf("%d%d%d%d", &x, &y, &d, &c); --x, --y; e[x].push_back(E(y, c, d)); e[y].push_back(E(x, c, d)); } double r = F(s - 1, g - 1); if (r < 0) puts("unreachable"); else printf("%f\n", r); } return 0; }
replace
40
41
40
42
TLE
p00743
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; double EPS = 1e-7; double EQ(double a, double b) { return abs(a - b) < EPS; } void fast_stream() { std::ios_base::sync_with_stdio(0); } struct edge { int to; int limitSpeed; int dist; }; vector<edge> G[101]; void add_edge(int x, int y, int d, int c) { edge e; int from = x; int to = y; e.to = y; e.limitSpeed = c; e.dist = d; G[from].push_back(e); e.to = x; G[to].push_back(e); } const double INF = 1e+10; typedef pair<double, int> pdi; typedef pair<pdi, pii> Sit; double d[51][51][51]; double dijkstra(int s, int g, int n) { for (int i = 0; i < 51; i++) for (int j = 0; j < 51; j++) for (int k = 0; k < 51; k++) d[i][j][k] = INF; priority_queue<Sit> pq; pq.push(make_pair(pdi(0, 0), pii(s, 1))); d[0][s][1] = 0; while (pq.size()) { Sit p = pq.top(); pq.pop(); double ccost = p.first.first; int prvNode = p.first.second; int curNode = p.second.first; int curSpeed = p.second.second; if (!EQ(d[prvNode][curNode][curSpeed], ccost) && d[prvNode][curNode][curSpeed] < ccost) continue; for (int j = 0; j < G[curNode].size(); j++) { edge &e = G[curNode][j]; int toNode = e.to; if (toNode == prvNode) continue; int limitSpeed = e.limitSpeed; int dist = e.dist; for (int i = -1; i <= 1; i++) { if (prvNode == 0 && i != 0) continue; int nxtSpeed = curSpeed + i; if (nxtSpeed == 0 || nxtSpeed > limitSpeed) continue; double ncost = ccost + 1.0 * dist / nxtSpeed; if (!EQ(ncost, d[curNode][toNode][nxtSpeed]) && ncost < d[curNode][toNode][nxtSpeed]) { d[curNode][toNode][nxtSpeed] = ncost; pq.push(make_pair(pdi(ncost, curNode), pii(toNode, nxtSpeed))); } } } } double res = INF; for (int i = 1; i <= n; i++) res = min(res, d[i][g][1]); return res; } void solve() { int n, m, s, g; while (cin >> n >> m && (n | m)) { cin >> s >> g; for (int i = 0; i < m; i++) { int x, y, d, c; cin >> x >> y >> d >> c; add_edge(x, y, d, c); } double res = dijkstra(s, g, n); if (EQ(res, INF)) cout << "unreachable" << endl; else printf("%.10f\n", res); for (int i = 0; i < 101; i++) G[i].clear(); } } int main() { solve(); return 0; }
#include <algorithm> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; double EPS = 1e-7; double EQ(double a, double b) { return abs(a - b) < EPS; } void fast_stream() { std::ios_base::sync_with_stdio(0); } struct edge { int to; int limitSpeed; int dist; }; vector<edge> G[101]; void add_edge(int x, int y, int d, int c) { edge e; int from = x; int to = y; e.to = y; e.limitSpeed = c; e.dist = d; G[from].push_back(e); e.to = x; G[to].push_back(e); } const double INF = 1e+10; typedef pair<double, int> pdi; typedef pair<pdi, pii> Sit; double d[51][51][51]; double dijkstra(int s, int g, int n) { for (int i = 0; i < 51; i++) for (int j = 0; j < 51; j++) for (int k = 0; k < 51; k++) d[i][j][k] = INF; priority_queue<Sit, vector<Sit>, greater<Sit>> pq; pq.push(make_pair(pdi(0, 0), pii(s, 1))); d[0][s][1] = 0; while (pq.size()) { Sit p = pq.top(); pq.pop(); double ccost = p.first.first; int prvNode = p.first.second; int curNode = p.second.first; int curSpeed = p.second.second; if (!EQ(d[prvNode][curNode][curSpeed], ccost) && d[prvNode][curNode][curSpeed] < ccost) continue; for (int j = 0; j < G[curNode].size(); j++) { edge &e = G[curNode][j]; int toNode = e.to; if (toNode == prvNode) continue; int limitSpeed = e.limitSpeed; int dist = e.dist; for (int i = -1; i <= 1; i++) { if (prvNode == 0 && i != 0) continue; int nxtSpeed = curSpeed + i; if (nxtSpeed == 0 || nxtSpeed > limitSpeed) continue; double ncost = ccost + 1.0 * dist / nxtSpeed; if (!EQ(ncost, d[curNode][toNode][nxtSpeed]) && ncost < d[curNode][toNode][nxtSpeed]) { d[curNode][toNode][nxtSpeed] = ncost; pq.push(make_pair(pdi(ncost, curNode), pii(toNode, nxtSpeed))); } } } } double res = INF; for (int i = 1; i <= n; i++) res = min(res, d[i][g][1]); return res; } void solve() { int n, m, s, g; while (cin >> n >> m && (n | m)) { cin >> s >> g; for (int i = 0; i < m; i++) { int x, y, d, c; cin >> x >> y >> d >> c; add_edge(x, y, d, c); } double res = dijkstra(s, g, n); if (EQ(res, INF)) cout << "unreachable" << endl; else printf("%.10f\n", res); for (int i = 0; i < 101; i++) G[i].clear(); } } int main() { solve(); return 0; }
replace
55
56
55
56
TLE
p00743
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define INF 100000000.0 #define EPS 1e-10 #define MOD 1000000007 using namespace std; typedef pair<double, int> P; int n, m; int s, g; double dp[40 * 900 + 30 * 30 + 30]; vector<P> e[40 * 900 + 30 * 30 + 30]; void solve() { cin >> s >> g; s--; g--; rep(i, 40 * 900 + 30 * 30 + 30) { dp[i] = INF; e[i].clear(); } rep(i, m) { int x, y, c; double d; cin >> x >> y >> d >> c; x--; y--; for (int j = 1; j <= c; j++) rep(k, n) { if (k == y) continue; e[j * 900 + k * 30 + x].push_back(P(d / j, j * 900 + x * 30 + y)); e[j * 900 + k * 30 + x].push_back(P(d / j, (j + 1) * 900 + x * 30 + y)); e[j * 900 + k * 30 + x].push_back(P(d / j, (j - 1) * 900 + x * 30 + y)); } for (int j = 1; j <= c; j++) rep(k, n) { if (k == x) continue; e[j * 900 + k * 30 + y].push_back(P(d / j, j * 900 + y * 30 + x)); e[j * 900 + k * 30 + y].push_back(P(d / j, (j + 1) * 900 + y * 30 + x)); e[j * 900 + k * 30 + y].push_back(P(d / j, (j - 1) * 900 + y * 30 + x)); } } priority_queue<P> que; que.push(P(0.0, 1 * 900 + s * 30 + s)); dp[1 * 900 + s * 30 + s] = 0.0; while (true) { if (que.size() == 0) break; P q = que.top(); que.pop(); if (q.first > dp[q.second]) continue; rep(i, e[q.second].size()) { P p = e[q.second][i]; if (dp[p.second] > q.first + p.first) { dp[p.second] = q.first + p.first; que.push(P(dp[p.second], p.second)); } } } double ans = INF; rep(i, n) ans = min(ans, dp[0 * 900 + i * 30 + g]); if (ans == INF) puts("unreachable"); else printf("%.9f\n", ans); } int main() { while (cin >> n >> m) { if (n == 0 && m == 0) break; solve(); } }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define INF 100000000.0 #define EPS 1e-10 #define MOD 1000000007 using namespace std; typedef pair<double, int> P; int n, m; int s, g; double dp[40 * 900 + 30 * 30 + 30]; vector<P> e[40 * 900 + 30 * 30 + 30]; void solve() { cin >> s >> g; s--; g--; rep(i, 40 * 900 + 30 * 30 + 30) { dp[i] = INF; e[i].clear(); } rep(i, m) { int x, y, c; double d; cin >> x >> y >> d >> c; x--; y--; for (int j = 1; j <= c; j++) rep(k, n) { if (k == y) continue; e[j * 900 + k * 30 + x].push_back(P(d / j, j * 900 + x * 30 + y)); e[j * 900 + k * 30 + x].push_back(P(d / j, (j + 1) * 900 + x * 30 + y)); e[j * 900 + k * 30 + x].push_back(P(d / j, (j - 1) * 900 + x * 30 + y)); } for (int j = 1; j <= c; j++) rep(k, n) { if (k == x) continue; e[j * 900 + k * 30 + y].push_back(P(d / j, j * 900 + y * 30 + x)); e[j * 900 + k * 30 + y].push_back(P(d / j, (j + 1) * 900 + y * 30 + x)); e[j * 900 + k * 30 + y].push_back(P(d / j, (j - 1) * 900 + y * 30 + x)); } } priority_queue<P, vector<P>, greater<P>> que; que.push(P(0.0, 1 * 900 + s * 30 + s)); dp[1 * 900 + s * 30 + s] = 0.0; while (true) { if (que.size() == 0) break; P q = que.top(); que.pop(); if (q.first > dp[q.second]) continue; rep(i, e[q.second].size()) { P p = e[q.second][i]; if (dp[p.second] > q.first + p.first) { dp[p.second] = q.first + p.first; que.push(P(dp[p.second], p.second)); } } } double ans = INF; rep(i, n) ans = min(ans, dp[0 * 900 + i * 30 + g]); if (ans == INF) puts("unreachable"); else printf("%.9f\n", ans); } int main() { while (cin >> n >> m) { if (n == 0 && m == 0) break; solve(); } }
replace
44
45
44
45
TLE
p00744
C++
Runtime Error
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define INF 100000000 typedef long long ll; const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; // max_flow const int MAX_V = 510; class FordFulkerson { public: struct edge { int to; int cap; int rev; edge() {} edge(int t, int c, int r) : to(t), cap(c), rev(r) {} }; vector<edge> G[MAX_V]; void add_edge(int from, int to, int cap) { G[from].push_back(edge(to, cap, G[to].size())); G[to].push_back(edge(from, 0, G[from].size() - 1)); } int max_flow(int s, int t) { int flow = 0; while (1) { for (int i = 0; i < MAX_V; i++) used[i] = false; int f = dfs(s, t, INF); if (f == 0) return flow; flow += f; } } private: int dfs(int v, int t, int f) { if (v == t) return f; used[v] = true; for (int i = 0; i < G[v].size(); i++) { edge &e = G[v][i]; if (!used[e.to] && e.cap > 0) { int d = dfs(e.to, t, min(e.cap, f)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } bool used[MAX_V]; }; int b[600], r[600]; int main(void) { int m, n; while (cin >> m >> n) { if (m == 0 && n == 0) break; FordFulkerson ff; for (int i = 0; i < m; i++) { cin >> b[i]; } for (int i = 0; i < n; i++) { cin >> r[i]; } int s = m + n, t = s + 1; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (__gcd(b[i], r[j]) > 1) { ff.add_edge(i, m + j, 1); } } } for (int i = 0; i < m; i++) { ff.add_edge(s, i, 1); } for (int i = 0; i < n; i++) { ff.add_edge(i + m, t, 1); } cout << ff.max_flow(s, t) << endl; } return 0; }
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define INF 100000000 typedef long long ll; const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; // max_flow const int MAX_V = 1050; class FordFulkerson { public: struct edge { int to; int cap; int rev; edge() {} edge(int t, int c, int r) : to(t), cap(c), rev(r) {} }; vector<edge> G[MAX_V]; void add_edge(int from, int to, int cap) { G[from].push_back(edge(to, cap, G[to].size())); G[to].push_back(edge(from, 0, G[from].size() - 1)); } int max_flow(int s, int t) { int flow = 0; while (1) { for (int i = 0; i < MAX_V; i++) used[i] = false; int f = dfs(s, t, INF); if (f == 0) return flow; flow += f; } } private: int dfs(int v, int t, int f) { if (v == t) return f; used[v] = true; for (int i = 0; i < G[v].size(); i++) { edge &e = G[v][i]; if (!used[e.to] && e.cap > 0) { int d = dfs(e.to, t, min(e.cap, f)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } bool used[MAX_V]; }; int b[600], r[600]; int main(void) { int m, n; while (cin >> m >> n) { if (m == 0 && n == 0) break; FordFulkerson ff; for (int i = 0; i < m; i++) { cin >> b[i]; } for (int i = 0; i < n; i++) { cin >> r[i]; } int s = m + n, t = s + 1; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (__gcd(b[i], r[j]) > 1) { ff.add_edge(i, m + j, 1); } } } for (int i = 0; i < m; i++) { ff.add_edge(s, i, 1); } for (int i = 0; i < n; i++) { ff.add_edge(i + m, t, 1); } cout << ff.max_flow(s, t) << endl; } return 0; }
replace
23
24
23
24
0
p00744
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <limits> #include <vector> using namespace std; using ll = long long; template <typename T> constexpr T INF = numeric_limits<T>::max() / 100; class Flow { public: using T = ll; struct Edge { Edge(const int from_, const int to_, const int reverse_, const T capacity_, bool is_reverse = false) : from{from_}, to{to_}, reverse{reverse_}, capacity{capacity_}, flow{0}, is_reverse(is_reverse) {} int from; int to; int reverse; T capacity; T flow; bool is_reverse; }; Flow(const int v) : V{v} { edge.resize(v); } void addEdge(const int from, const int to, const T capacity) { edge[from].push_back(Edge{from, to, (int)edge[to].size(), capacity, false}); edge[to].push_back(Edge{to, from, (int)edge[from].size() - 1, 0, true}); } T FordFulkerson(const int s, const int t) { vector<bool> checked(V); T flow = 0; while (true) { for (int i = 0; i < V; i++) { checked[i] = false; } const T f = dfs_ff(s, t, INF<T>, checked); if (f == 0) { break; } flow += f; } return flow; } const int V; vector<vector<Edge>> edge; private: T dfs_ff(const int pos, const int t, const T flow, vector<bool> &checked) { if (pos == t) { return flow; } checked[pos] = true; for (auto &e : edge[pos]) { if (not checked[e.to]) { const T res = e.capacity - e.flow; if (res > 0) { const T d = dfs_ff(e.to, t, min(flow, res), checked); if (d > 0) { e.flow += min(d, res); edge[e.to][e.reverse].flow -= min(d, res); return d; } } } } return 0; } }; template <typename T> T gcd(const T a, const T b) { return (b != 0) ? gcd(b, a % b) : a; } int main() { while (true) { int m, n; cin >> m >> n; if (m == 0 and n == 0) { break; } Flow flow(m + n + 2); vector<ll> b(m); for (int i = 0; i < m; i++) { flow.addEdge(m + n, i, 1); cin >> b[i]; } vector<ll> r(m); for (int i = 0; i < n; i++) { flow.addEdge(i + m, m + n + 1, 1); cin >> r[i]; } for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (gcd(b[i], r[j]) > 1) { flow.addEdge(i, m + j, 1); } } } cout << flow.FordFulkerson(m + n, m + n + 1) << endl; } return 0; }
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <limits> #include <vector> using namespace std; using ll = long long; template <typename T> constexpr T INF = numeric_limits<T>::max() / 100; class Flow { public: using T = ll; struct Edge { Edge(const int from_, const int to_, const int reverse_, const T capacity_, bool is_reverse = false) : from{from_}, to{to_}, reverse{reverse_}, capacity{capacity_}, flow{0}, is_reverse(is_reverse) {} int from; int to; int reverse; T capacity; T flow; bool is_reverse; }; Flow(const int v) : V{v} { edge.resize(v); } void addEdge(const int from, const int to, const T capacity) { edge[from].push_back(Edge{from, to, (int)edge[to].size(), capacity, false}); edge[to].push_back(Edge{to, from, (int)edge[from].size() - 1, 0, true}); } T FordFulkerson(const int s, const int t) { vector<bool> checked(V); T flow = 0; while (true) { for (int i = 0; i < V; i++) { checked[i] = false; } const T f = dfs_ff(s, t, INF<T>, checked); if (f == 0) { break; } flow += f; } return flow; } const int V; vector<vector<Edge>> edge; private: T dfs_ff(const int pos, const int t, const T flow, vector<bool> &checked) { if (pos == t) { return flow; } checked[pos] = true; for (auto &e : edge[pos]) { if (not checked[e.to]) { const T res = e.capacity - e.flow; if (res > 0) { const T d = dfs_ff(e.to, t, min(flow, res), checked); if (d > 0) { e.flow += min(d, res); edge[e.to][e.reverse].flow -= min(d, res); return d; } } } } return 0; } }; template <typename T> T gcd(const T a, const T b) { return (b != 0) ? gcd(b, a % b) : a; } int main() { while (true) { int m, n; cin >> m >> n; if (m == 0 and n == 0) { break; } Flow flow(m + n + 2); vector<ll> b(m); for (int i = 0; i < m; i++) { flow.addEdge(m + n, i, 1); cin >> b[i]; } vector<ll> r(n); for (int i = 0; i < n; i++) { flow.addEdge(i + m, m + n + 1, 1); cin >> r[i]; } for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (gcd(b[i], r[j]) > 1) { flow.addEdge(i, m + j, 1); } } } cout << flow.FordFulkerson(m + n, m + n + 1) << endl; } return 0; }
replace
92
93
92
93
0
p00744
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (n); i++) #define INF (long long)(1e18) #define MOD (int)(1e9 + 7) #define yn(f) ((f) ? "Yes" : "No") #define YN(f) ((f) ? "YES" : "NO") #define MAX 300 #define MAX_V MAX struct edge { int to, cap, rev; }; vector<edge> G[MAX_V]; bool used[MAX_V]; int V, E; int n, m; int a[MAX], b; void add_edge(int from, int to, int cap) { G[from].push_back((edge){to, cap, (int)G[to].size()}); G[to].push_back((edge){from, 0, (int)G[from].size() - 1}); } int dfs(int v, int t, int f) { if (v == t) return f; used[v] = true; for (int i = 0; i < G[v].size(); i++) { edge &e = G[v][i]; if (!used[e.to] && e.cap > 0) { int d = dfs(e.to, t, min(f, e.cap)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } int max_flow(int s, int t) { int flow = 0; for (;;) { memset(used, 0, sizeof(used)); int f = dfs(s, t, INF); if (f == 0) return flow; flow += f; } } signed main() { cout << fixed << setprecision(7); while (true) { cin >> m >> n; if (!n && !m) break; for (int i = 0; i <= n + m + 1; i++) G[i].clear(); for (int i = 1; i <= m; i++) { cin >> a[i]; add_edge(0, i, 1); } for (int i = 1; i <= n; i++) { cin >> b; for (int j = 1; j <= m; j++) { if (__gcd(a[j], b) != 1) { add_edge(j, i + m, 1); } } add_edge(i + m, n + m + 1, 1); } cout << max_flow(0, n + m + 1) << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (n); i++) #define INF (long long)(1e18) #define MOD (int)(1e9 + 7) #define yn(f) ((f) ? "Yes" : "No") #define YN(f) ((f) ? "YES" : "NO") #define MAX 1100 #define MAX_V MAX struct edge { int to, cap, rev; }; vector<edge> G[MAX_V]; bool used[MAX_V]; int V, E; int n, m; int a[MAX], b; void add_edge(int from, int to, int cap) { G[from].push_back((edge){to, cap, (int)G[to].size()}); G[to].push_back((edge){from, 0, (int)G[from].size() - 1}); } int dfs(int v, int t, int f) { if (v == t) return f; used[v] = true; for (int i = 0; i < G[v].size(); i++) { edge &e = G[v][i]; if (!used[e.to] && e.cap > 0) { int d = dfs(e.to, t, min(f, e.cap)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } int max_flow(int s, int t) { int flow = 0; for (;;) { memset(used, 0, sizeof(used)); int f = dfs(s, t, INF); if (f == 0) return flow; flow += f; } } signed main() { cout << fixed << setprecision(7); while (true) { cin >> m >> n; if (!n && !m) break; for (int i = 0; i <= n + m + 1; i++) G[i].clear(); for (int i = 1; i <= m; i++) { cin >> a[i]; add_edge(0, i, 1); } for (int i = 1; i <= n; i++) { cin >> b; for (int j = 1; j <= m; j++) { if (__gcd(a[j], b) != 1) { add_edge(j, i + m, 1); } } add_edge(i + m, n + m + 1, 1); } cout << max_flow(0, n + m + 1) << endl; } return 0; }
replace
17
18
17
18
0
p00744
C++
Runtime Error
#include <cstdio> #include <cstring> #include <queue> using namespace std; const int MAXV = 2005; const int MAXE = MAXV * MAXV; const int INF = 1 << 29; struct BiparateMatching { int N, M, E, match[MAXV + 1], dist[MAXV + 1]; int last[MAXE], prev[MAXE], to[MAXE]; BiparateMatching(int n, int m) : N(n), M(m), E(0) { memset(last, -1, sizeof(last)); } void add_edge(int x, int y) { // x \in [0, N), y \in [0, M) to[E] = y + N; prev[E] = last[x]; last[x] = E; E++; } bool bfs() { queue<int> q; for (int i = 0; i < N; ++i) { if (match[i] == -1) { q.push(i); dist[i] = 0; } else dist[i] = INF; } bool ret = false; while (!q.empty()) { int v = q.front(); q.pop(); for (int e = last[v]; e != -1; e = prev[e]) { if (match[to[e]] == -1) ret = true; else if (dist[match[to[e]]] == INF) { dist[match[to[e]]] = dist[v] + 1; q.push(match[to[e]]); } } } return ret; } bool dfs(int v) { for (int e = last[v]; e != -1; e = prev[e]) { bool update = false; if (match[to[e]] == -1) { match[to[e]] = v; match[v] = to[e]; update = true; } else if (dist[match[to[e]]] == dist[v] + 1) { if (dfs(match[to[e]])) { match[to[e]] = v; match[v] = to[e]; update = true; } } if (update) return true; } dist[v] = INF; return false; } int matching() { int ret = 0; memset(match, -1, sizeof(match)); while (bfs()) { for (int i = 0; i < N; ++i) if (match[i] == -1 && dfs(i)) ret++; } return ret; } }; int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y); } int b[501], r[501]; int main() { int m, n; while (scanf("%d %d", &m, &n), m | n) { BiparateMatching bm(m, n); for (int i = 0; i < m; ++i) scanf("%d", &b[i]); for (int i = 0; i < n; ++i) scanf("%d", &r[i]); for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) if (gcd(b[i], r[j]) > 1) bm.add_edge(i, j); } printf("%d\n", bm.matching()); } }
#include <cstdio> #include <cstring> #include <queue> using namespace std; const int MAXV = 2005; const int MAXE = 505 * 505; const int INF = 1 << 29; struct BiparateMatching { int N, M, E, match[MAXV + 1], dist[MAXV + 1]; int last[MAXE], prev[MAXE], to[MAXE]; BiparateMatching(int n, int m) : N(n), M(m), E(0) { memset(last, -1, sizeof(last)); } void add_edge(int x, int y) { // x \in [0, N), y \in [0, M) to[E] = y + N; prev[E] = last[x]; last[x] = E; E++; } bool bfs() { queue<int> q; for (int i = 0; i < N; ++i) { if (match[i] == -1) { q.push(i); dist[i] = 0; } else dist[i] = INF; } bool ret = false; while (!q.empty()) { int v = q.front(); q.pop(); for (int e = last[v]; e != -1; e = prev[e]) { if (match[to[e]] == -1) ret = true; else if (dist[match[to[e]]] == INF) { dist[match[to[e]]] = dist[v] + 1; q.push(match[to[e]]); } } } return ret; } bool dfs(int v) { for (int e = last[v]; e != -1; e = prev[e]) { bool update = false; if (match[to[e]] == -1) { match[to[e]] = v; match[v] = to[e]; update = true; } else if (dist[match[to[e]]] == dist[v] + 1) { if (dfs(match[to[e]])) { match[to[e]] = v; match[v] = to[e]; update = true; } } if (update) return true; } dist[v] = INF; return false; } int matching() { int ret = 0; memset(match, -1, sizeof(match)); while (bfs()) { for (int i = 0; i < N; ++i) if (match[i] == -1 && dfs(i)) ret++; } return ret; } }; int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y); } int b[501], r[501]; int main() { int m, n; while (scanf("%d %d", &m, &n), m | n) { BiparateMatching bm(m, n); for (int i = 0; i < m; ++i) scanf("%d", &b[i]); for (int i = 0; i < n; ++i) scanf("%d", &r[i]); for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) if (gcd(b[i], r[j]) > 1) bm.add_edge(i, j); } printf("%d\n", bm.matching()); } }
replace
6
7
6
7
-11
p00744
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // Max-Flow,?????§??? template <int V> struct MaxFlow { using T = double; const T INF = 1 << 28; struct Edge { int to, rev; T cap; }; vector<Edge> g[V]; int level[V]; int iter[V]; void add(int from, int to, T cap) { g[from].push_back(Edge{to, (int)g[to].size(), cap}); g[to].push_back(Edge{from, (int)g[from].size() - 1, 0}); } void add_multi(int from, int to, T cap) { g[from].push_back(Edge{to, (int)g[to].size(), cap}); g[to].push_back(Edge{from, (int)g[from].size() - 1, cap}); } void bfs(int s) { fill_n(level, V, -1); queue<int> que; level[s] = 0; que.push(s); while (!que.empty()) { int v = que.front(); que.pop(); for (Edge e : g[v]) { if (e.cap <= 0) continue; if (level[e.to] < 0) { level[e.to] = level[v] + 1; que.push(e.to); } } } } T dfs(int v, int t, T f) { if (v == t) return f; for (int &i = iter[v]; i < g[v].size(); i++) { Edge &e = g[v][i]; if (e.cap <= 0) continue; if (level[v] < level[e.to]) { T d = dfs(e.to, t, min(f, e.cap)); if (d <= 0) continue; e.cap -= d; g[e.to][e.rev].cap += d; return d; } } return 0; } T exec(int s, int t) { T flow = 0; while (true) { bfs(s); if (level[t] < 0) return flow; fill_n(iter, V, 0); T f; while ((f = dfs(s, t, INF)) > 0) { flow += f; } } } }; bool solve() { int m, n; cin >> m >> n; if (m == 0 && n == 0) return false; vector<int> b(m), r(n); for (int i = 0; i < m; i++) cin >> b[i]; for (int i = 0; i < n; i++) cin >> r[i]; MaxFlow<1001> mf; for (int i = 0; i < m; i++) { mf.add(0, i + 1, 1); } for (int i = 0; i < n; i++) { mf.add(i + m + 1, m + n + 1, 1); } for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (__gcd(b[i], r[j]) > 1) { mf.add(i + 1, j + m + 1, 1); // cerr << b[i] << " " << r[j] << " " << __gcd(b[i],r[j]) << endl; } } } cout << mf.exec(0, m + n + 1) << endl; return true; } int main(void) { while (solve()) { } return 0; }
#include <bits/stdc++.h> using namespace std; // Max-Flow,?????§??? template <int V> struct MaxFlow { using T = double; const T INF = 1 << 28; struct Edge { int to, rev; T cap; }; vector<Edge> g[V]; int level[V]; int iter[V]; void add(int from, int to, T cap) { g[from].push_back(Edge{to, (int)g[to].size(), cap}); g[to].push_back(Edge{from, (int)g[from].size() - 1, 0}); } void add_multi(int from, int to, T cap) { g[from].push_back(Edge{to, (int)g[to].size(), cap}); g[to].push_back(Edge{from, (int)g[from].size() - 1, cap}); } void bfs(int s) { fill_n(level, V, -1); queue<int> que; level[s] = 0; que.push(s); while (!que.empty()) { int v = que.front(); que.pop(); for (Edge e : g[v]) { if (e.cap <= 0) continue; if (level[e.to] < 0) { level[e.to] = level[v] + 1; que.push(e.to); } } } } T dfs(int v, int t, T f) { if (v == t) return f; for (int &i = iter[v]; i < g[v].size(); i++) { Edge &e = g[v][i]; if (e.cap <= 0) continue; if (level[v] < level[e.to]) { T d = dfs(e.to, t, min(f, e.cap)); if (d <= 0) continue; e.cap -= d; g[e.to][e.rev].cap += d; return d; } } return 0; } T exec(int s, int t) { T flow = 0; while (true) { bfs(s); if (level[t] < 0) return flow; fill_n(iter, V, 0); T f; while ((f = dfs(s, t, INF)) > 0) { flow += f; } } } }; bool solve() { int m, n; cin >> m >> n; if (m == 0 && n == 0) return false; vector<int> b(m), r(n); for (int i = 0; i < m; i++) cin >> b[i]; for (int i = 0; i < n; i++) cin >> r[i]; MaxFlow<1100> mf; for (int i = 0; i < m; i++) { mf.add(0, i + 1, 1); } for (int i = 0; i < n; i++) { mf.add(i + m + 1, m + n + 1, 1); } for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (__gcd(b[i], r[j]) > 1) { mf.add(i + 1, j + m + 1, 1); // cerr << b[i] << " " << r[j] << " " << __gcd(b[i],r[j]) << endl; } } } cout << mf.exec(0, m + n + 1) << endl; return true; } int main(void) { while (solve()) { } return 0; }
replace
90
91
90
91
0
p00744
C++
Runtime Error
// #include<bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef ll int__; #define rep(i, j) for (int__(i) = 0; (i) < (j); (i)++) #define repeat(i, j, k) for (int__ i = (j); i < (k); (i)++) #define all(v) begin(v), end(v) #define MAX_N 510 class maxFlow { public: int N; //???????????° int G[MAX_N][MAX_N]; // G[i][j] :=???i??????j????????§????????? bool is_visited[MAX_N]; maxFlow(int n) { N = n; //?????????????????¨????????°???????????§?????? for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) G[i][j] = 0; } // n1->n2???arc????????? void add_arc(int n1, int n2, int capacity) { G[n1][n2] += capacity; //????????§?????±??? } //??´???????????§???????????¢?´¢ int dfs(int now, int end, int min_capacity) { if (now == end) return min_capacity; if (!is_visited[now]) { is_visited[now] = true; for (int i = 0; i < N; i++) { if (G[now][i] > 0) { // now??????i????????§??????????????????????????°????????§?????? int ret = dfs(i, end, min(min_capacity, G[now][i])); if (ret > 0) { //??´???????????????????????????????????§?¢???????????????????????????????????????´??° G[now][i] -= ret; G[i][now] += ret; return ret; } } } return -2; //??´????????????????????????????????£??? } else return -1; //?????§????¨???????????????£??? } int get_maxFlow(int start, int end) { int temp, ans = 0; //??´???????????????????????????????????§????????????????????????????????????????´¢ while (true) { for (int i = 0; i < N; i++) is_visited[i] = false; temp = dfs(start, end, 100); if (temp > 0) ans += temp; else break; } return ans; } }; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int main() { int n, m; while (true) { cin >> m >> n; if (m == 0 && n == 0) break; maxFlow G(m + n + 2); vector<int> b(m); vector<int> r(n); rep(i, m) { cin >> b[i]; G.add_arc(m + n, i, 1); } rep(i, n) { cin >> r[i]; G.add_arc(m + i, m + n + 1, 1); } rep(i, m) { rep(j, n) { if (gcd(b[i], r[j]) != 1) { G.add_arc(i, m + j, 1); } } } cout << G.get_maxFlow(m + n, m + n + 1) << endl; } return 0; }
// #include<bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef ll int__; #define rep(i, j) for (int__(i) = 0; (i) < (j); (i)++) #define repeat(i, j, k) for (int__ i = (j); i < (k); (i)++) #define all(v) begin(v), end(v) #define MAX_N 1010 class maxFlow { public: int N; //???????????° int G[MAX_N][MAX_N]; // G[i][j] :=???i??????j????????§????????? bool is_visited[MAX_N]; maxFlow(int n) { N = n; //?????????????????¨????????°???????????§?????? for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) G[i][j] = 0; } // n1->n2???arc????????? void add_arc(int n1, int n2, int capacity) { G[n1][n2] += capacity; //????????§?????±??? } //??´???????????§???????????¢?´¢ int dfs(int now, int end, int min_capacity) { if (now == end) return min_capacity; if (!is_visited[now]) { is_visited[now] = true; for (int i = 0; i < N; i++) { if (G[now][i] > 0) { // now??????i????????§??????????????????????????°????????§?????? int ret = dfs(i, end, min(min_capacity, G[now][i])); if (ret > 0) { //??´???????????????????????????????????§?¢???????????????????????????????????????´??° G[now][i] -= ret; G[i][now] += ret; return ret; } } } return -2; //??´????????????????????????????????£??? } else return -1; //?????§????¨???????????????£??? } int get_maxFlow(int start, int end) { int temp, ans = 0; //??´???????????????????????????????????§????????????????????????????????????????´¢ while (true) { for (int i = 0; i < N; i++) is_visited[i] = false; temp = dfs(start, end, 100); if (temp > 0) ans += temp; else break; } return ans; } }; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int main() { int n, m; while (true) { cin >> m >> n; if (m == 0 && n == 0) break; maxFlow G(m + n + 2); vector<int> b(m); vector<int> r(n); rep(i, m) { cin >> b[i]; G.add_arc(m + n, i, 1); } rep(i, n) { cin >> r[i]; G.add_arc(m + i, m + n + 1, 1); } rep(i, m) { rep(j, n) { if (gcd(b[i], r[j]) != 1) { G.add_arc(i, m + j, 1); } } } cout << G.get_maxFlow(m + n, m + n + 1) << endl; } return 0; }
replace
21
22
21
22
0
p00744
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int bipartiteMaximumMatchings(const vector<vector<bool>> &graph) { int answer = 0; int n = graph.size(); int m = graph[0].size(); vector<int> selectN(n, -1); vector<int> selectM(m, -1); for (int i = 0; i < n; ++i) { vector<bool> visitedN(n, false); vector<bool> visitedM(m, false); visitedN[i] = true; vector<int> path(min(n, m) * 2, -1); path[0] = i; int index = 1; for (;;) { while (++path[index] < m && (!graph[path[index - 1]][path[index]] || selectN[path[index - 1]] == path[index] || visitedM[path[index]])) ; if (path[index] < m) { if (selectM[path[index]] == -1) { for (int j = 0; j < index; j += 2) { selectN[path[j]] = path[j + 1]; selectM[path[j + 1]] = path[j]; } ++answer; break; } if (!visitedN[selectM[path[index]]]) { path[index + 1] = selectM[path[index]]; visitedM[path[index]] = true; visitedN[path[index + 1]] = true; index += 2; } } else { path[index] = -1; index -= 2; if (index < 0) break; } } } return answer; } void solve(const vector<int> &blue, const vector<int> &red) { vector<vector<bool>> graph(blue.size(), vector<bool>(red.size(), false)); for (unsigned i = 0; i < blue.size(); ++i) { vector<int> num; int a = blue[i]; int b = 2; while (a >= b * b) { if (a % b == 0) { num.push_back(b); while (a % b == 0) a /= b; } ++b; } if (a > 1) num.push_back(a); for (unsigned j = 0; j < red.size(); ++j) { for (unsigned k = 0; k < num.size(); ++k) { if (red[j] % num[k] == 0) { graph[i][j] = true; break; } } } } cout << bipartiteMaximumMatchings(graph) << endl; } int main() { for (;;) { int m, n; cin >> m >> n; if (m == 0 && n == 0) break; vector<int> blue(m); vector<int> red(n); for (int i = 0; i < m; ++i) cin >> blue[i]; for (int i = 0; i < n; ++i) cin >> red[i]; solve(blue, red); } return 0; }
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int bipartiteMaximumMatchings(const vector<vector<bool>> &graph) { int answer = 0; int n = graph.size(); int m = graph[0].size(); vector<int> selectN(n, -1); vector<int> selectM(m, -1); for (int i = 0; i < n; ++i) { vector<bool> visitedN(n, false); vector<bool> visitedM(m, false); visitedN[i] = true; vector<int> path(min(n, m) * 2, -1); path[0] = i; int index = 1; for (;;) { while (++path[index] < m && (!graph[path[index - 1]][path[index]] || selectN[path[index - 1]] == path[index] || visitedM[path[index]])) ; if (path[index] < m) { if (selectM[path[index]] == -1) { for (int j = 0; j < index; j += 2) { selectN[path[j]] = path[j + 1]; selectM[path[j + 1]] = path[j]; } ++answer; break; } if (!visitedN[selectM[path[index]]]) { path[index + 1] = selectM[path[index]]; visitedM[path[index]] = true; visitedN[path[index + 1]] = true; index += 2; } } else { path[index] = -1; index -= 2; if (index < 0) break; } } if (answer == m) break; } return answer; } void solve(const vector<int> &blue, const vector<int> &red) { vector<vector<bool>> graph(blue.size(), vector<bool>(red.size(), false)); for (unsigned i = 0; i < blue.size(); ++i) { vector<int> num; int a = blue[i]; int b = 2; while (a >= b * b) { if (a % b == 0) { num.push_back(b); while (a % b == 0) a /= b; } ++b; } if (a > 1) num.push_back(a); for (unsigned j = 0; j < red.size(); ++j) { for (unsigned k = 0; k < num.size(); ++k) { if (red[j] % num[k] == 0) { graph[i][j] = true; break; } } } } cout << bipartiteMaximumMatchings(graph) << endl; } int main() { for (;;) { int m, n; cin >> m >> n; if (m == 0 && n == 0) break; vector<int> blue(m); vector<int> red(n); for (int i = 0; i < m; ++i) cin >> blue[i]; for (int i = 0; i < n; ++i) cin >> red[i]; solve(blue, red); } return 0; }
insert
57
57
57
60
0
p00744
C++
Runtime Error
// Hopcroft-Karp Algorithm // O(|E| * |V|^(1/2)) // http://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm // aoj 1163 #include <iostream> #include <queue> #include <vector> using namespace std; int NIL; const int inf = 1 << 29; typedef vector<int> vi; typedef vector<vector<int>> Graph; bool bfs(const Graph &g, vi &dist, const vi &pair, int m) { queue<int> q; for (int i = 0; i < m; ++i) if (pair[i] == NIL) { dist[i] = 0; q.push(i); } else dist[i] = inf; dist[NIL] = inf; while (!q.empty()) { int v = q.front(); q.pop(); if (v == NIL) continue; for (int i = 0; i < g[v].size(); ++i) { int u = g[v][i]; if (dist[pair[u]] == inf) { dist[pair[u]] = dist[v] + 1; q.push(pair[u]); } } } return dist[NIL] != inf; } bool dfs(int v, const Graph &g, vi &dist, vi &pair) { for (int i = 0; i < g[v].size(); ++i) { int u = g[v][i]; if (dist[pair[u]] == dist[v] + 1) { if (dfs(pair[u], g, dist, pair)) { pair[u] = v, pair[v] = u; return true; } } } dist[v] = inf; return false; } // 0ツつゥツづァm-1ツづ慊づづ個静淞点ツづツつゥツづァn-1ツづ慊づづ個静淞点ツづづ個催妥・ツマツッツチツδ督グツづーツ仰づ淞づゥ int hopcroft_karp(Graph &graph, int m) { const int n = graph.size(); NIL = n; vi pair(n + 1, NIL), dist(n + 1, 0); int ret = 0; while (bfs(graph, dist, pair, m)) { for (int i = 0; i < m; ++i) if (pair[i] == NIL) if (i == NIL || dfs(i, graph, dist, pair)) ret++; } return ret; } int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y); } int main() { ios::sync_with_stdio(false); int m, n; while (cin >> m >> n, m | n) { Graph g(m + n); vector<int> b(m), r(n); for (int i = 0; i < m; ++i) cin >> b[i]; for (int i = 0; i < n; ++i) cin >> r[i]; for (int i = 0; i < m; ++i) for (int j = 0; j < n; ++j) if (gcd(b[i], r[j]) > 1) g[i].push_back(j + m); cout << hopcroft_karp(g, m) << endl; } }
// Hopcroft-Karp Algorithm // O(|E| * |V|^(1/2)) // http://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm // aoj 1163 #include <iostream> #include <queue> #include <vector> using namespace std; int NIL; const int inf = 1 << 29; typedef vector<int> vi; typedef vector<vector<int>> Graph; bool bfs(const Graph &g, vi &dist, const vi &pair, int m) { queue<int> q; for (int i = 0; i < m; ++i) if (pair[i] == NIL) { dist[i] = 0; q.push(i); } else dist[i] = inf; dist[NIL] = inf; while (!q.empty()) { int v = q.front(); q.pop(); if (v == NIL) continue; for (int i = 0; i < g[v].size(); ++i) { int u = g[v][i]; if (dist[pair[u]] == inf) { dist[pair[u]] = dist[v] + 1; q.push(pair[u]); } } } return dist[NIL] != inf; } bool dfs(int v, const Graph &g, vi &dist, vi &pair) { for (int i = 0; i < g[v].size(); ++i) { int u = g[v][i]; if (dist[pair[u]] == dist[v] + 1) { if (pair[u] == NIL || dfs(pair[u], g, dist, pair)) { pair[u] = v, pair[v] = u; return true; } } } dist[v] = inf; return false; } // 0ツつゥツづァm-1ツづ慊づづ個静淞点ツづツつゥツづァn-1ツづ慊づづ個静淞点ツづづ個催妥・ツマツッツチツδ督グツづーツ仰づ淞づゥ int hopcroft_karp(Graph &graph, int m) { const int n = graph.size(); NIL = n; vi pair(n + 1, NIL), dist(n + 1, 0); int ret = 0; while (bfs(graph, dist, pair, m)) { for (int i = 0; i < m; ++i) if (pair[i] == NIL) if (i == NIL || dfs(i, graph, dist, pair)) ret++; } return ret; } int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y); } int main() { ios::sync_with_stdio(false); int m, n; while (cin >> m >> n, m | n) { Graph g(m + n); vector<int> b(m), r(n); for (int i = 0; i < m; ++i) cin >> b[i]; for (int i = 0; i < n; ++i) cin >> r[i]; for (int i = 0; i < m; ++i) for (int j = 0; j < n; ++j) if (gcd(b[i], r[j]) > 1) g[i].push_back(j + m); cout << hopcroft_karp(g, m) << endl; } }
replace
47
48
47
48
-11
p00744
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct Bipartite_Matching { vector<vector<int>> graph; vector<int> dist, match; vector<bool> used, vv; Bipartite_Matching(int n, int m) { graph.resize(n); match.assign(m, -1); used.assign(n, false); } void add_edge(int u, int v) { graph[u].push_back(v); } void bfs() { dist.assign(graph.size(), -1); queue<int> que; for (int i = 0; i < graph.size(); i++) { if (!used[i]) { que.emplace(i); dist[i] = 0; } } while (!que.empty()) { int a = que.front(); que.pop(); for (auto &b : graph[a]) { int c = match[b]; if (c >= 0 && dist[c] == -1) { dist[c] = dist[a] + 1; que.emplace(c); } } } } bool dfs(int a) { vv[a] = true; for (auto &b : graph[a]) { int c = match[b]; if (c < 0 || (!vv[c] && dist[c] == dist[a] + 1 && dfs(c))) { match[b] = a; used[a] = true; return (true); } } return (false); } int bipartite_matching() { int ret = 0; while (true) { bfs(); vv.assign(graph.size(), false); int flow = 0; for (int i = 0; i < graph.size(); i++) { if (!used[i] && dfs(i)) ++flow; } if (flow == 0) return (ret); ret += flow; } } }; int dp[1000][1000]; int gcd(int x, int y) { if (x < 1000) { if (~dp[x][y]) return (dp[x][y]); int r = x % y; if (r == 0) return dp[x][y] = y; return dp[x][y] = gcd(y, r); } else { int r = x % y; if (r == 0) return y; return gcd(y, r); } } int main() { memset(dp, -1, sizeof(dp)); int M, N, B[500], R[500]; while (scanf("%d %d", &M, &N), M) { Bipartite_Matching flow(M, N); for (int i = 0; i < M; i++) scanf("%d", &B[i]); for (int i = 0; i < N; i++) scanf("%d", &R[i]); for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { if (gcd(min(B[i], R[j]), max(B[i], R[j])) > 1) flow.add_edge(i, j); } } printf("%d\n", flow.bipartite_matching()); } }
#include <bits/stdc++.h> using namespace std; struct Bipartite_Matching { vector<vector<int>> graph; vector<int> dist, match; vector<bool> used, vv; Bipartite_Matching(int n, int m) { graph.resize(n); match.assign(m, -1); used.assign(n, false); } void add_edge(int u, int v) { graph[u].push_back(v); } void bfs() { dist.assign(graph.size(), -1); queue<int> que; for (int i = 0; i < graph.size(); i++) { if (!used[i]) { que.emplace(i); dist[i] = 0; } } while (!que.empty()) { int a = que.front(); que.pop(); for (auto &b : graph[a]) { int c = match[b]; if (c >= 0 && dist[c] == -1) { dist[c] = dist[a] + 1; que.emplace(c); } } } } bool dfs(int a) { vv[a] = true; for (auto &b : graph[a]) { int c = match[b]; if (c < 0 || (!vv[c] && dist[c] == dist[a] + 1 && dfs(c))) { match[b] = a; used[a] = true; return (true); } } return (false); } int bipartite_matching() { int ret = 0; while (true) { bfs(); vv.assign(graph.size(), false); int flow = 0; for (int i = 0; i < graph.size(); i++) { if (!used[i] && dfs(i)) ++flow; } if (flow == 0) return (ret); ret += flow; } } }; int dp[1000][1000]; int gcd(int x, int y) { if (x < 1000) { if (~dp[x][y]) return (dp[x][y]); int r = x % y; if (r == 0) return dp[x][y] = y; return dp[x][y] = gcd(y, r); } else { int r = x % y; if (r == 0) return y; return gcd(y, r); } } int main() { memset(dp, -1, sizeof(dp)); int M, N, B[500], R[500]; while (scanf("%d %d", &M, &N), M) { Bipartite_Matching flow(M, N); for (int i = 0; i < M; i++) scanf("%d", &B[i]); for (int i = 0; i < N; i++) scanf("%d", &R[i]); for (int i = 0; i < M; i++) { for (int j = 0; j < N; j++) { if (gcd(max(B[i], R[j]), min(B[i], R[j])) > 1) flow.add_edge(i, j); } } printf("%d\n", flow.bipartite_matching()); } }
replace
100
101
100
101
0
p00744
C++
Runtime Error
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <vector> using namespace std; const int MAX_V = 1100; const int INF = 100000000; // &#65533;&#65533;&#65533;_&#65533;&#65533; int V; // &#65533;O&#65533;&#65533;&#65533;t&#65533;&#771;&#65533;&#65533;X&#65533;g&#65533;\&#65533;&#65533; vector<int> G[MAX_V]; // &#65533;}&#65533;b&#65533;`&#65533;&#65533;&#65533;O&#65533;&#771;y&#65533;A int match[MAX_V]; // dfs&#65533;&#322;&#65533;&#65533;&#322;&#594;&#65533;&#65533;&#1474;&#65533;&#65533;&#65533;&#65533;&#450;&#65533;&#65533;&#65533;&#65533;&#771;t&#65533;&#65533;&#65533;O static bool used[MAX_V]; // u&#65533;&#65533;v&#65533;&#65533;&#1301;&#1218;&#65533;O&#65533;&#65533;&#65533;t&#65533;&#594;&#457;&#65533; void add_edge(int u, int v) { G[u].push_back(v); G[v].push_back(u); } // &#65533;&#65533;&#65533;&#65533;p&#65533;X&#65533;&#65533;dfs&#65533;&#338;T&#65533;&#65533; bool dfs(int v) { used[v] = true; for (int i = 0; i < G[v].size(); i++) { int u = G[v][i], w = match[u]; if (w < 0 || !used[w] && dfs(w)) { match[v] = u; match[u] = v; return true; } } return false; } // &#65533;&#349443;O&#65533;&#65533;&#65533;t&#65533;&#781;&#337;&#65533;}&#65533;b&#65533;`&#65533;&#65533;&#65533;O&#65533;&#65533;&#1986;&#65533; int bipartite_matching() { int res = 0; // memset(match,-1,sizeof(match)); for (int i = 0; i < MAX_V; i++) match[i] = -1; for (int v = 0; v < V; v++) { if (match[v] < 0) { memset(used, 0, sizeof(used)); if (dfs(v)) { res++; } } } return res; } int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int main() { int n, m; vector<int> bs, rs; int b, r; while (cin >> m >> n && !(m == 0 && n == 0)) { for (int i = 0; i < MAX_V; i++) G[i].clear(); V = n + m; for (int i = 0; i < m; i++) { cin >> b; bs.push_back(b); } for (int i = 0; i < n; i++) { cin >> r; rs.push_back(r); } for (int i = 0; i < rs.size(); i++) { for (int j = 0; j < bs.size(); j++) { int res = gcd(rs[i], bs[j]); if (res > 1) add_edge(i, j + rs.size()); } } cout << bipartite_matching() << endl; } return 0; }
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <vector> using namespace std; const int MAX_V = 1100; const int INF = 100000000; // &#65533;&#65533;&#65533;_&#65533;&#65533; int V; // &#65533;O&#65533;&#65533;&#65533;t&#65533;&#771;&#65533;&#65533;X&#65533;g&#65533;\&#65533;&#65533; vector<int> G[MAX_V]; // &#65533;}&#65533;b&#65533;`&#65533;&#65533;&#65533;O&#65533;&#771;y&#65533;A int match[MAX_V]; // dfs&#65533;&#322;&#65533;&#65533;&#322;&#594;&#65533;&#65533;&#1474;&#65533;&#65533;&#65533;&#65533;&#450;&#65533;&#65533;&#65533;&#65533;&#771;t&#65533;&#65533;&#65533;O static bool used[MAX_V]; // u&#65533;&#65533;v&#65533;&#65533;&#1301;&#1218;&#65533;O&#65533;&#65533;&#65533;t&#65533;&#594;&#457;&#65533; void add_edge(int u, int v) { G[u].push_back(v); G[v].push_back(u); } // &#65533;&#65533;&#65533;&#65533;p&#65533;X&#65533;&#65533;dfs&#65533;&#338;T&#65533;&#65533; bool dfs(int v) { used[v] = true; for (int i = 0; i < G[v].size(); i++) { int u = G[v][i], w = match[u]; if (w < 0 || !used[w] && dfs(w)) { match[v] = u; match[u] = v; return true; } } return false; } // &#65533;&#349443;O&#65533;&#65533;&#65533;t&#65533;&#781;&#337;&#65533;}&#65533;b&#65533;`&#65533;&#65533;&#65533;O&#65533;&#65533;&#1986;&#65533; int bipartite_matching() { int res = 0; // memset(match,-1,sizeof(match)); for (int i = 0; i < MAX_V; i++) match[i] = -1; for (int v = 0; v < V; v++) { if (match[v] < 0) { memset(used, 0, sizeof(used)); if (dfs(v)) { res++; } } } return res; } int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int main() { int n, m; vector<int> bs, rs; int b, r; while (cin >> m >> n && !(m == 0 && n == 0)) { for (int i = 0; i < MAX_V; i++) G[i].clear(); bs.clear(); rs.clear(); V = n + m; for (int i = 0; i < m; i++) { cin >> b; bs.push_back(b); } for (int i = 0; i < n; i++) { cin >> r; rs.push_back(r); } for (int i = 0; i < rs.size(); i++) { for (int j = 0; j < bs.size(); j++) { int res = gcd(rs[i], bs[j]); if (res > 1) add_edge(i, j + rs.size()); } } cout << bipartite_matching() << endl; } return 0; }
insert
72
72
72
74
0
p00744
C++
Runtime Error
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; // typedef //------------------------------------------ typedef long long LL; typedef vector<int> VI; typedef vector<bool> VB; typedef vector<char> VC; typedef vector<double> VD; typedef vector<string> VS; typedef vector<LL> VLL; typedef vector<VI> VVI; typedef vector<VB> VVB; typedef vector<VS> VVS; typedef vector<VLL> VVLL; typedef vector<VVI> VVVI; typedef vector<VVLL> VVVLL; typedef pair<int, int> PII; typedef pair<LL, LL> PLL; typedef pair<int, string> PIS; typedef pair<string, int> PSI; typedef pair<string, string> PSS; // 数値・文字列 //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } inline LL toLongLong(string s) { LL v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } inline VC toVC(string s) { VC data(s.begin(), s.end()); return data; } template <typename List> void SPRIT(const std::string &s, const std::string &delim, List &result) { result.clear(); string::size_type pos = 0; while (pos != string::npos) { string::size_type p = s.find(delim, pos); if (p == string::npos) { result.push_back(s.substr(pos)); break; } else { result.push_back(s.substr(pos, p - pos)); } pos = p + delim.size(); } } string TRIM(const string &str, const char *trimCharacterList = " \t\v\r\n") { string result; string::size_type left = str.find_first_not_of(trimCharacterList); if (left != string::npos) { string::size_type right = str.find_last_not_of(trimCharacterList); result = str.substr(left, right - left + 1); } return result; } template <typename T> bool VECTOR_EXISTS(vector<T> vec, T data) { auto itr = std::find(vec.begin(), vec.end(), data); size_t index = distance(vec.begin(), itr); if (index != vec.size()) { return true; } else { return 0; } } #define UPPER(s) transform((s).begin(), (s).end(), (s).begin(), ::toupper) #define LOWER(s) transform((s).begin(), (s).end(), (s).begin(), ::tolower) // 四捨五入 nLen=小数点第N位にする //------------------------------------------ // 切り上げ double ceil_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double)(int)(dOut + 0.9); return dOut * pow(10.0, -nLen); } // 切り捨て double floor_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double)(int)(dOut); return dOut * pow(10.0, -nLen); } // 四捨五入 double round_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double)(int)(dOut + 0.5); return dOut * pow(10.0, -nLen); } // n桁目の数の取得 int take_a_n(int num, int n) { string str = toString(num); return str[str.length() - n] - '0'; } // 進数 //------------------------------------------ //"1111011" → 123 int strbase_2to10(const std::string &s) { int out = 0; for (int i = 0, size = s.size(); i < size; ++i) { out *= 2; out += ((int)s[i] == 49) ? 1 : 0; } return out; } //"123" → 1111011 int strbase_10to2(const std::string &s) { int binary = toInt(s); int out = 0; for (int i = 0; binary > 0; i++) { out = out + (binary % 2) * pow(static_cast<int>(10), i); binary = binary / 2; } return out; } //"ABC" 2748 int strbase_16to10(const std::string &s) { int out = stoi(s, 0, 16); return out; } // 1111011 → 123 int intbase_2to10(int in) { string str = toString(in); return strbase_2to10(str); } // 123 → 1111011 int intbase_10to2(int in) { string str = toString(in); return strbase_10to2(str); } int intbase_16to10(int in) { string str = toString(in); return strbase_16to10(str); } // 123→ "7B" string intbase_10to16(unsigned int val, bool lower = true) { if (!val) return std::string("0"); std::string str; const char hc = lower ? 'a' : 'A'; // 小文字 or 大文字表記 while (val != 0) { int d = val & 15; // 16進数一桁を取得 if (d < 10) str.insert(str.begin(), d + '0'); // 10未満の場合 else // 10以上の場合 str.insert(str.begin(), d - 10 + hc); val >>= 4; } return str; } // 整数を2進数表記したときの1の個数を返す LL bitcount64(LL bits) { bits = (bits & 0x5555555555555555) + (bits >> 1 & 0x5555555555555555); bits = (bits & 0x3333333333333333) + (bits >> 2 & 0x3333333333333333); bits = (bits & 0x0f0f0f0f0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f0f0f0f0f); bits = (bits & 0x00ff00ff00ff00ff) + (bits >> 8 & 0x00ff00ff00ff00ff); bits = (bits & 0x0000ffff0000ffff) + (bits >> 16 & 0x0000ffff0000ffff); return (bits & 0x00000000ffffffff) + (bits >> 32 & 0x00000000ffffffff); } // comparison //------------------------------------------ #define C_MAX(a, b) ((a) > (b) ? (a) : (b)) #define C_MIN(a, b) ((a) < (b) ? (a) : (b)) #define C_ABS(a, b) ((a) < (b) ? (b) - (a) : (a) - (b)) // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define COUNT(obj, v) count((obj).begin(), (obj).end(), v) #define SEARCH(v, w) search((v).begin(), (v).end(), (w).begin(), (w).end()) #define B_SEARCH(obj, v) binary_search((obj).begin(), (obj).end(), v) #define SORT(c) sort((c).begin(), (c).end()) #define RSORT(c) sort((c).rbegin(), (c).rend()) #define REVERSE(c) reverse((c).begin(), (c).end()) #define SUMI(obj) accumulate((obj).begin(), (obj).end(), 0) #define SUMD(obj) accumulate((obj).begin(), (obj).end(), 0.) #define SUMLL(obj) accumulate((obj).begin(), (obj).end(), 0LL) #define SUMS(obj) accumulate((obj).begin(), (obj).end(), string()) #define UB(obj, n) upper_bound((obj).begin(), (obj).end(), n) #define LB(obj, n) lower_bound((obj).begin(), (obj).end(), n) #define PB push_back #define MP make_pair // input output //------------------------------------------ #define GL(s) getline(cin, (s)) #define INIT \ std::ios::sync_with_stdio(false); \ std::cin.tie(0); #define OUT(d) std::cout << (d); #define OUT_L(d) std::cout << (d) << endl; #define FOUT(n, data) std::cout << std::fixed << std::setprecision(n) << (data); #define FOUT_L(n, data) \ std::cout << std::fixed << std::setprecision(n) << (data) << "\n"; #define EL() std::cout << "\n"; #define SHOW_VECTOR(v) \ { \ std::cerr << #v << "\t:"; \ for (const auto &xxx : v) { \ std::cerr << xxx << " "; \ } \ std::cerr << "\n"; \ } #define SHOW_MAP(v) \ { \ std::cerr << #v << endl; \ for (const auto &xxx : v) { \ std::cerr << xxx.first << " " << xxx.second << "\n"; \ } \ } template <typename T> std::istream &operator>>(std::istream &is, std::vector<T> &vec) { for (T &x : vec) is >> x; return is; } template <typename T> std::ostream &operator<<(std::ostream &os, const std::vector<T> &vec) { for (const T &x : vec) os << x << " "; return os; } // repetition //------------------------------------------ #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); --i) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) for (int i = n - 1; i >= 0; i--) #define FORLL(i, a, b) for (LL i = LL(a); i < LL(b); ++i) #define RFORLL(i, a, b) for (LL i = LL(b) - 1; i >= LL(a); --i) #define REPLL(i, n) for (LL i = 0; i < LL(n); ++i) #define RREPLL(i, n) for (LL i = LL(n) - 1; i >= 0; --i) #define FOREACH(x, v) for (auto &(x) : (v)) #define FORITER(x, v) for (auto(x) = (v).begin(); (x) != (v).end(); ++(x)) // constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); const int MOD = 1000000007; // const int dx[] = {-1, 0, 1, 0}; // const int dy[] = {0, 1, 0, -1}; // math //-------------------------------------------- // min <= aim <= max template <typename T> inline bool BETWEEN(const T aim, const T min, const T max) { if (min <= aim && aim <= max) { return true; } else { return false; } } template <class T> inline T SQR(const T x) { return x * x; } template <class T1, class T2> inline T1 POW(const T1 x, const T2 y) { if (!y) return 1; else if ((y & 1) == 0) { return SQR(POW(x, y >> 1)); } else return POW(x, y ^ 1) * x; } template <typename T> constexpr T ABS(T x) { return x < 0 ? -x : x; } // partial_permutation nPr 順列 // first・・最初の数 // middle・・r(取り出す数) // last・・n(全体数) template <class BidirectionalIterator> bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last) { reverse(middle, last); return next_permutation(first, last); } // combination nCr 組み合わせ // first1・・最初の数 // last1==first2・・r(取り出す数) // last2・・n(全体数) template <class BidirectionalIterator> bool next_combination(BidirectionalIterator first1, BidirectionalIterator last1, BidirectionalIterator first2, BidirectionalIterator last2) { if ((first1 == last1) || (first2 == last2)) { return false; } BidirectionalIterator m1 = last1; BidirectionalIterator m2 = last2; --m2; while (--m1 != first1 && !(*m1 < *m2)) { } bool result = (m1 == first1) && !(*first1 < *m2); if (!result) { while (first2 != m2 && !(*m1 < *first2)) { ++first2; } first1 = m1; std::iter_swap(first1, first2); ++first1; ++first2; } if ((first1 != last1) && (first2 != last2)) { m1 = last1; m2 = first2; while ((m1 != first1) && (m2 != last2)) { std::iter_swap(--m1, m2); ++m2; } std::reverse(first1, m1); std::reverse(first1, last1); std::reverse(m2, last2); std::reverse(first2, last2); } return !result; } // numeric_law //-------------------------------------------- template <typename T> constexpr bool ODD(T x) { return x % 2 != 0; } template <typename T> constexpr bool EVEN(T x) { return x % 2 == 0; } // 最大公約数 template <class T> inline T GCD(const T x, const T y) { if (x < 0) return GCD(-x, y); if (y < 0) return GCD(x, -y); return (!y) ? x : GCD(y, x % y); } // 最小公倍数 template <class T> inline T LCM(const T x, const T y) { if (x < 0) return LCM(-x, y); if (y < 0) return LCM(x, -y); return x * (y / GCD(x, y)); } // ax + by = 1 // x,yが変数に格納される template <class T> inline T EXTGCD(const T a, const T b, T &x, T &y) { if (a < 0) { T d = EXTGCD(-a, b, x, y); x = -x; return d; } if (b < 0) { T d = EXTGCD(a, -b, x, y); y = -y; return d; } if (!b) { x = 1; y = 0; return a; } else { T d = EXTGCD(b, a % b, x, y); T t = x; x = y; y = t - (a / b) * y; return d; } } // 素数 template <class T> inline bool ISPRIME(const T x) { if (x <= 1) return false; for (T i = 2; SQR(i) <= x; i++) if (x % i == 0) return false; return true; } // 素数をtrueとして返す template <class T> VB ERATOSTHENES(const T n) { VB arr(n, true); for (int i = 2; SQR(i) < n; i++) { if (arr[i]) { for (int j = 0; i * (j + 2) < n; j++) { arr[i * (j + 2)] = false; } } } return arr; } // a <= x < b の素数を返す template <typename T> VB ERATOSTHENES(const T a, const T b) { VB small = ERATOSTHENES(b); VB prime(b - a, true); for (int i = 2; (T)(SQR(i)) < b; i++) { if (small[i]) { for (T j = max(2, (a + i - 1) / i) * i; j < b; j += i) { prime[j - a] = false; } } } return prime; } // 約数 template <class T> // vector<T> DIVISOR(T n) { // vector<T> v; // for (int i = 1; i * i <= n; ++i) { // if (n % i == 0) { // v.push_back(i); // if (i != n / i) { // v.push_back(n / i); // } // } // } // sort(v.begin(), v.end()); // return v; // } vector<T> DIVISOR(T n) { vector<T> v; for (int i = 1; i * i <= n; ++i) { if (n % i == 0) { v.push_back(i); if (i != n / i) { v.push_back(n / i); } } } sort(v.begin(), v.end()); return v; } // 組み合わせ個数 template <typename T> T NCR(T n, T r) { T ans = 1; REPLL(i, r) { ans = ans * (n - i) / (i + 1); } return ans; } // 行列 int MATRIZ_CHAIN(VI &p, VVI &s) { const static int INF = 1 << 20; const int n = p.size() - 1; VVI X(n, VI(n, INF)); s.resize(n, VI(n)); for (int i = 0; i < n; ++i) X[i][i] = 0; for (int w = 1; w < n; ++w) for (int i = 0, j; j = i + w, j < n; ++i) for (int k = i; k < j; ++k) { int f = p[i] * p[k + 1] * p[j + 1]; if (X[i][k] + X[k + 1][j] + f < X[i][j]) { X[i][j] = X[i][k] + X[k + 1][j] + f; s[i][j] = k; } } return X[0][n - 1]; } // 最長増加部分列 VI LIS(const VI &a) { const static int INF = 99999999; const int n = a.size(); VI A(n, INF); VI id(n); for (int i = 0; i < n; ++i) { id[i] = distance(A.begin(), lower_bound(A.begin(), A.end(), a[i])); A[id[i]] = a[i]; } int m = *max_element(id.begin(), id.end()); VI b(m + 1); for (int i = n - 1; i >= 0; --i) if (id[i] == m) b[m--] = a[i]; return b; } // 最長共通部分列 string->toVC template <typename T> vector<T> LCS(const vector<T> &a, const vector<T> &b) { const int n = a.size(), m = b.size(); vector<VI> X(n + 1, VI(m + 1)); vector<VI> Y(n + 1, VI(m + 1)); REP(i, n) { REP(j, m) { if (a[i] == b[j]) { X[i + 1][j + 1] = X[i][j] + 1; Y[i + 1][j + 1] = 0; } else if (X[i + 1][j] < X[i][j + 1]) { X[i + 1][j + 1] = X[i][j + 1]; Y[i + 1][j + 1] = +1; } else { X[i + 1][j + 1] = X[i + 1][j]; Y[i + 1][j + 1] = -1; } } } vector<T> c; for (int i = n, j = m; i > 0 && j > 0;) { if (Y[i][j] > 0) --i; else if (Y[i][j] < 0) --j; else { c.PB(a[i - 1]); --i; --j; } } REVERSE(c); return c; } // コイン C総額 cs使用できるコインの種類 VI money_change(int C, VI &cs) { const int INF = 99999999; int n = cs.size(); VI xs(C + 1, INF); VI ys(C + 1); xs[0] = 0; for (int i = 0; i < n; ++i) { for (int c = 0; c + cs[i] <= C; ++c) { if (xs[c + cs[i]] > xs[c] + 1) { xs[c + cs[i]] = xs[c] + 1; ys[c + cs[i]] = c; } } } VI zs; for (int c = C; c > 0; c = ys[c]) { zs.push_back(c - ys[c]); } return zs; } // confirmation //-------------------------------------------- // clear memory #define CLR(arr, d) memset((arr), (d), sizeof(arr)) // debug #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; /* * * * ~~~~Below My Answer~~~~ * * **/ #define MAX_V 400 #define INF (1 << 20) struct Edge { int to; int cap; int rev; }; vector<Edge> G[MAX_V]; bool used[MAX_V]; void add_edge(int from, int to, int cap) { G[from].push_back((Edge){to, cap, (int)G[to].size()}); G[to].push_back((Edge){from, 0, (int)G[from].size()}); } int dfs(int v, int t, int f) { if (v == t) return f; used[v] = true; for (int i = 0; i < G[v].size(); i++) { Edge &e = G[v][i]; if (!used[e.to] && e.cap > 0) { int d = dfs(e.to, t, min(e.cap, f)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } int max_flow(int s, int t) { int flow = 0; while (true) { memset(used, 0, sizeof(used)); int f = dfs(s, t, INF); if (f == 0) { return flow; } flow += f; } } int main() { while (true) { int m, n; cin >> m >> n; if (m == 0 && n == 0) break; for (int i = 0; i < MAX_V; i++) { G[i] = vector<Edge>(); } VI b(m); for (int i = 0; i < m; i++) cin >> b[i]; VVI blueDivisor(m); for (int i = 0; i < m; i++) blueDivisor[i] = DIVISOR(b[i]), blueDivisor[i].erase(blueDivisor[i].begin()); VI r(n); for (int i = 0; i < n; i++) cin >> r[i]; VVI redDivisor(n); for (int i = 0; i < n; i++) redDivisor[i] = DIVISOR(r[i]), redDivisor[i].erase(redDivisor[i].begin()); int s = 0; int t = m + n + 1; for (int i = 0; i < m; i++) { add_edge(s, i + 1, 1); } for (int i = 0; i < n; i++) { add_edge(i + m + 1, t, 1); } for (int i = 0; i < m; i++) { VI blue = blueDivisor[i]; for (int j = 0; j < n; j++) { VI red = redDivisor[j]; bool exist = false; for (int k = 0; k < blue.size(); k++) { if (VECTOR_EXISTS(red, blue[k])) exist = true; } if (exist) { int left = s + i + 1; int right = s + j + m + 1; add_edge(left, right, 1); } } } int ans = max_flow(s, t); OUT_L(ans); } }
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; // typedef //------------------------------------------ typedef long long LL; typedef vector<int> VI; typedef vector<bool> VB; typedef vector<char> VC; typedef vector<double> VD; typedef vector<string> VS; typedef vector<LL> VLL; typedef vector<VI> VVI; typedef vector<VB> VVB; typedef vector<VS> VVS; typedef vector<VLL> VVLL; typedef vector<VVI> VVVI; typedef vector<VVLL> VVVLL; typedef pair<int, int> PII; typedef pair<LL, LL> PLL; typedef pair<int, string> PIS; typedef pair<string, int> PSI; typedef pair<string, string> PSS; // 数値・文字列 //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } inline LL toLongLong(string s) { LL v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } inline VC toVC(string s) { VC data(s.begin(), s.end()); return data; } template <typename List> void SPRIT(const std::string &s, const std::string &delim, List &result) { result.clear(); string::size_type pos = 0; while (pos != string::npos) { string::size_type p = s.find(delim, pos); if (p == string::npos) { result.push_back(s.substr(pos)); break; } else { result.push_back(s.substr(pos, p - pos)); } pos = p + delim.size(); } } string TRIM(const string &str, const char *trimCharacterList = " \t\v\r\n") { string result; string::size_type left = str.find_first_not_of(trimCharacterList); if (left != string::npos) { string::size_type right = str.find_last_not_of(trimCharacterList); result = str.substr(left, right - left + 1); } return result; } template <typename T> bool VECTOR_EXISTS(vector<T> vec, T data) { auto itr = std::find(vec.begin(), vec.end(), data); size_t index = distance(vec.begin(), itr); if (index != vec.size()) { return true; } else { return 0; } } #define UPPER(s) transform((s).begin(), (s).end(), (s).begin(), ::toupper) #define LOWER(s) transform((s).begin(), (s).end(), (s).begin(), ::tolower) // 四捨五入 nLen=小数点第N位にする //------------------------------------------ // 切り上げ double ceil_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double)(int)(dOut + 0.9); return dOut * pow(10.0, -nLen); } // 切り捨て double floor_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double)(int)(dOut); return dOut * pow(10.0, -nLen); } // 四捨五入 double round_n(double dIn, int nLen) { double dOut; dOut = dIn * pow(10.0, nLen); dOut = (double)(int)(dOut + 0.5); return dOut * pow(10.0, -nLen); } // n桁目の数の取得 int take_a_n(int num, int n) { string str = toString(num); return str[str.length() - n] - '0'; } // 進数 //------------------------------------------ //"1111011" → 123 int strbase_2to10(const std::string &s) { int out = 0; for (int i = 0, size = s.size(); i < size; ++i) { out *= 2; out += ((int)s[i] == 49) ? 1 : 0; } return out; } //"123" → 1111011 int strbase_10to2(const std::string &s) { int binary = toInt(s); int out = 0; for (int i = 0; binary > 0; i++) { out = out + (binary % 2) * pow(static_cast<int>(10), i); binary = binary / 2; } return out; } //"ABC" 2748 int strbase_16to10(const std::string &s) { int out = stoi(s, 0, 16); return out; } // 1111011 → 123 int intbase_2to10(int in) { string str = toString(in); return strbase_2to10(str); } // 123 → 1111011 int intbase_10to2(int in) { string str = toString(in); return strbase_10to2(str); } int intbase_16to10(int in) { string str = toString(in); return strbase_16to10(str); } // 123→ "7B" string intbase_10to16(unsigned int val, bool lower = true) { if (!val) return std::string("0"); std::string str; const char hc = lower ? 'a' : 'A'; // 小文字 or 大文字表記 while (val != 0) { int d = val & 15; // 16進数一桁を取得 if (d < 10) str.insert(str.begin(), d + '0'); // 10未満の場合 else // 10以上の場合 str.insert(str.begin(), d - 10 + hc); val >>= 4; } return str; } // 整数を2進数表記したときの1の個数を返す LL bitcount64(LL bits) { bits = (bits & 0x5555555555555555) + (bits >> 1 & 0x5555555555555555); bits = (bits & 0x3333333333333333) + (bits >> 2 & 0x3333333333333333); bits = (bits & 0x0f0f0f0f0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f0f0f0f0f); bits = (bits & 0x00ff00ff00ff00ff) + (bits >> 8 & 0x00ff00ff00ff00ff); bits = (bits & 0x0000ffff0000ffff) + (bits >> 16 & 0x0000ffff0000ffff); return (bits & 0x00000000ffffffff) + (bits >> 32 & 0x00000000ffffffff); } // comparison //------------------------------------------ #define C_MAX(a, b) ((a) > (b) ? (a) : (b)) #define C_MIN(a, b) ((a) < (b) ? (a) : (b)) #define C_ABS(a, b) ((a) < (b) ? (b) - (a) : (a) - (b)) // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define COUNT(obj, v) count((obj).begin(), (obj).end(), v) #define SEARCH(v, w) search((v).begin(), (v).end(), (w).begin(), (w).end()) #define B_SEARCH(obj, v) binary_search((obj).begin(), (obj).end(), v) #define SORT(c) sort((c).begin(), (c).end()) #define RSORT(c) sort((c).rbegin(), (c).rend()) #define REVERSE(c) reverse((c).begin(), (c).end()) #define SUMI(obj) accumulate((obj).begin(), (obj).end(), 0) #define SUMD(obj) accumulate((obj).begin(), (obj).end(), 0.) #define SUMLL(obj) accumulate((obj).begin(), (obj).end(), 0LL) #define SUMS(obj) accumulate((obj).begin(), (obj).end(), string()) #define UB(obj, n) upper_bound((obj).begin(), (obj).end(), n) #define LB(obj, n) lower_bound((obj).begin(), (obj).end(), n) #define PB push_back #define MP make_pair // input output //------------------------------------------ #define GL(s) getline(cin, (s)) #define INIT \ std::ios::sync_with_stdio(false); \ std::cin.tie(0); #define OUT(d) std::cout << (d); #define OUT_L(d) std::cout << (d) << endl; #define FOUT(n, data) std::cout << std::fixed << std::setprecision(n) << (data); #define FOUT_L(n, data) \ std::cout << std::fixed << std::setprecision(n) << (data) << "\n"; #define EL() std::cout << "\n"; #define SHOW_VECTOR(v) \ { \ std::cerr << #v << "\t:"; \ for (const auto &xxx : v) { \ std::cerr << xxx << " "; \ } \ std::cerr << "\n"; \ } #define SHOW_MAP(v) \ { \ std::cerr << #v << endl; \ for (const auto &xxx : v) { \ std::cerr << xxx.first << " " << xxx.second << "\n"; \ } \ } template <typename T> std::istream &operator>>(std::istream &is, std::vector<T> &vec) { for (T &x : vec) is >> x; return is; } template <typename T> std::ostream &operator<<(std::ostream &os, const std::vector<T> &vec) { for (const T &x : vec) os << x << " "; return os; } // repetition //------------------------------------------ #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); --i) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) for (int i = n - 1; i >= 0; i--) #define FORLL(i, a, b) for (LL i = LL(a); i < LL(b); ++i) #define RFORLL(i, a, b) for (LL i = LL(b) - 1; i >= LL(a); --i) #define REPLL(i, n) for (LL i = 0; i < LL(n); ++i) #define RREPLL(i, n) for (LL i = LL(n) - 1; i >= 0; --i) #define FOREACH(x, v) for (auto &(x) : (v)) #define FORITER(x, v) for (auto(x) = (v).begin(); (x) != (v).end(); ++(x)) // constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); const int MOD = 1000000007; // const int dx[] = {-1, 0, 1, 0}; // const int dy[] = {0, 1, 0, -1}; // math //-------------------------------------------- // min <= aim <= max template <typename T> inline bool BETWEEN(const T aim, const T min, const T max) { if (min <= aim && aim <= max) { return true; } else { return false; } } template <class T> inline T SQR(const T x) { return x * x; } template <class T1, class T2> inline T1 POW(const T1 x, const T2 y) { if (!y) return 1; else if ((y & 1) == 0) { return SQR(POW(x, y >> 1)); } else return POW(x, y ^ 1) * x; } template <typename T> constexpr T ABS(T x) { return x < 0 ? -x : x; } // partial_permutation nPr 順列 // first・・最初の数 // middle・・r(取り出す数) // last・・n(全体数) template <class BidirectionalIterator> bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last) { reverse(middle, last); return next_permutation(first, last); } // combination nCr 組み合わせ // first1・・最初の数 // last1==first2・・r(取り出す数) // last2・・n(全体数) template <class BidirectionalIterator> bool next_combination(BidirectionalIterator first1, BidirectionalIterator last1, BidirectionalIterator first2, BidirectionalIterator last2) { if ((first1 == last1) || (first2 == last2)) { return false; } BidirectionalIterator m1 = last1; BidirectionalIterator m2 = last2; --m2; while (--m1 != first1 && !(*m1 < *m2)) { } bool result = (m1 == first1) && !(*first1 < *m2); if (!result) { while (first2 != m2 && !(*m1 < *first2)) { ++first2; } first1 = m1; std::iter_swap(first1, first2); ++first1; ++first2; } if ((first1 != last1) && (first2 != last2)) { m1 = last1; m2 = first2; while ((m1 != first1) && (m2 != last2)) { std::iter_swap(--m1, m2); ++m2; } std::reverse(first1, m1); std::reverse(first1, last1); std::reverse(m2, last2); std::reverse(first2, last2); } return !result; } // numeric_law //-------------------------------------------- template <typename T> constexpr bool ODD(T x) { return x % 2 != 0; } template <typename T> constexpr bool EVEN(T x) { return x % 2 == 0; } // 最大公約数 template <class T> inline T GCD(const T x, const T y) { if (x < 0) return GCD(-x, y); if (y < 0) return GCD(x, -y); return (!y) ? x : GCD(y, x % y); } // 最小公倍数 template <class T> inline T LCM(const T x, const T y) { if (x < 0) return LCM(-x, y); if (y < 0) return LCM(x, -y); return x * (y / GCD(x, y)); } // ax + by = 1 // x,yが変数に格納される template <class T> inline T EXTGCD(const T a, const T b, T &x, T &y) { if (a < 0) { T d = EXTGCD(-a, b, x, y); x = -x; return d; } if (b < 0) { T d = EXTGCD(a, -b, x, y); y = -y; return d; } if (!b) { x = 1; y = 0; return a; } else { T d = EXTGCD(b, a % b, x, y); T t = x; x = y; y = t - (a / b) * y; return d; } } // 素数 template <class T> inline bool ISPRIME(const T x) { if (x <= 1) return false; for (T i = 2; SQR(i) <= x; i++) if (x % i == 0) return false; return true; } // 素数をtrueとして返す template <class T> VB ERATOSTHENES(const T n) { VB arr(n, true); for (int i = 2; SQR(i) < n; i++) { if (arr[i]) { for (int j = 0; i * (j + 2) < n; j++) { arr[i * (j + 2)] = false; } } } return arr; } // a <= x < b の素数を返す template <typename T> VB ERATOSTHENES(const T a, const T b) { VB small = ERATOSTHENES(b); VB prime(b - a, true); for (int i = 2; (T)(SQR(i)) < b; i++) { if (small[i]) { for (T j = max(2, (a + i - 1) / i) * i; j < b; j += i) { prime[j - a] = false; } } } return prime; } // 約数 template <class T> // vector<T> DIVISOR(T n) { // vector<T> v; // for (int i = 1; i * i <= n; ++i) { // if (n % i == 0) { // v.push_back(i); // if (i != n / i) { // v.push_back(n / i); // } // } // } // sort(v.begin(), v.end()); // return v; // } vector<T> DIVISOR(T n) { vector<T> v; for (int i = 1; i * i <= n; ++i) { if (n % i == 0) { v.push_back(i); if (i != n / i) { v.push_back(n / i); } } } sort(v.begin(), v.end()); return v; } // 組み合わせ個数 template <typename T> T NCR(T n, T r) { T ans = 1; REPLL(i, r) { ans = ans * (n - i) / (i + 1); } return ans; } // 行列 int MATRIZ_CHAIN(VI &p, VVI &s) { const static int INF = 1 << 20; const int n = p.size() - 1; VVI X(n, VI(n, INF)); s.resize(n, VI(n)); for (int i = 0; i < n; ++i) X[i][i] = 0; for (int w = 1; w < n; ++w) for (int i = 0, j; j = i + w, j < n; ++i) for (int k = i; k < j; ++k) { int f = p[i] * p[k + 1] * p[j + 1]; if (X[i][k] + X[k + 1][j] + f < X[i][j]) { X[i][j] = X[i][k] + X[k + 1][j] + f; s[i][j] = k; } } return X[0][n - 1]; } // 最長増加部分列 VI LIS(const VI &a) { const static int INF = 99999999; const int n = a.size(); VI A(n, INF); VI id(n); for (int i = 0; i < n; ++i) { id[i] = distance(A.begin(), lower_bound(A.begin(), A.end(), a[i])); A[id[i]] = a[i]; } int m = *max_element(id.begin(), id.end()); VI b(m + 1); for (int i = n - 1; i >= 0; --i) if (id[i] == m) b[m--] = a[i]; return b; } // 最長共通部分列 string->toVC template <typename T> vector<T> LCS(const vector<T> &a, const vector<T> &b) { const int n = a.size(), m = b.size(); vector<VI> X(n + 1, VI(m + 1)); vector<VI> Y(n + 1, VI(m + 1)); REP(i, n) { REP(j, m) { if (a[i] == b[j]) { X[i + 1][j + 1] = X[i][j] + 1; Y[i + 1][j + 1] = 0; } else if (X[i + 1][j] < X[i][j + 1]) { X[i + 1][j + 1] = X[i][j + 1]; Y[i + 1][j + 1] = +1; } else { X[i + 1][j + 1] = X[i + 1][j]; Y[i + 1][j + 1] = -1; } } } vector<T> c; for (int i = n, j = m; i > 0 && j > 0;) { if (Y[i][j] > 0) --i; else if (Y[i][j] < 0) --j; else { c.PB(a[i - 1]); --i; --j; } } REVERSE(c); return c; } // コイン C総額 cs使用できるコインの種類 VI money_change(int C, VI &cs) { const int INF = 99999999; int n = cs.size(); VI xs(C + 1, INF); VI ys(C + 1); xs[0] = 0; for (int i = 0; i < n; ++i) { for (int c = 0; c + cs[i] <= C; ++c) { if (xs[c + cs[i]] > xs[c] + 1) { xs[c + cs[i]] = xs[c] + 1; ys[c + cs[i]] = c; } } } VI zs; for (int c = C; c > 0; c = ys[c]) { zs.push_back(c - ys[c]); } return zs; } // confirmation //-------------------------------------------- // clear memory #define CLR(arr, d) memset((arr), (d), sizeof(arr)) // debug #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) \ cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; /* * * * ~~~~Below My Answer~~~~ * * **/ #define MAX_V 3000 #define INF (1 << 20) struct Edge { int to; int cap; int rev; }; vector<Edge> G[MAX_V]; bool used[MAX_V]; void add_edge(int from, int to, int cap) { G[from].push_back((Edge){to, cap, (int)G[to].size()}); G[to].push_back((Edge){from, 0, (int)G[from].size()}); } int dfs(int v, int t, int f) { if (v == t) return f; used[v] = true; for (int i = 0; i < G[v].size(); i++) { Edge &e = G[v][i]; if (!used[e.to] && e.cap > 0) { int d = dfs(e.to, t, min(e.cap, f)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } int max_flow(int s, int t) { int flow = 0; while (true) { memset(used, 0, sizeof(used)); int f = dfs(s, t, INF); if (f == 0) { return flow; } flow += f; } } int main() { while (true) { int m, n; cin >> m >> n; if (m == 0 && n == 0) break; for (int i = 0; i < MAX_V; i++) { G[i] = vector<Edge>(); } VI b(m); for (int i = 0; i < m; i++) cin >> b[i]; VVI blueDivisor(m); for (int i = 0; i < m; i++) blueDivisor[i] = DIVISOR(b[i]), blueDivisor[i].erase(blueDivisor[i].begin()); VI r(n); for (int i = 0; i < n; i++) cin >> r[i]; VVI redDivisor(n); for (int i = 0; i < n; i++) redDivisor[i] = DIVISOR(r[i]), redDivisor[i].erase(redDivisor[i].begin()); int s = 0; int t = m + n + 1; for (int i = 0; i < m; i++) { add_edge(s, i + 1, 1); } for (int i = 0; i < n; i++) { add_edge(i + m + 1, t, 1); } for (int i = 0; i < m; i++) { VI blue = blueDivisor[i]; for (int j = 0; j < n; j++) { VI red = redDivisor[j]; bool exist = false; for (int k = 0; k < blue.size(); k++) { if (VECTOR_EXISTS(red, blue[k])) exist = true; } if (exist) { int left = s + i + 1; int right = s + j + m + 1; add_edge(left, right, 1); } } } int ans = max_flow(s, t); OUT_L(ans); } }
replace
635
636
635
636
0
p00744
C++
Runtime Error
#include <list> #include <stdio.h> #include <string.h> int F(int x, int y) { if (!y) return x; return F(y, x % y); } typedef std::list<int> L; L e[1002]; int m, n; bool f[1002]; int G(int s, int d) { if (s == d) return 1; if (f[s]) return 0; f[s] = 1; for (L::iterator i = e[s].begin(); i != e[s].end(); ++i) { if (G(*i, d)) { e[*i].push_back(s); e[s].erase(i); return 1; } } return 0; } int main() { int a[100], i, j, x; while (scanf("%d%d", &m, &n), m) { for (i = 0; i < m + n + 2; ++i) e[i].clear(); for (i = 0; i < m; ++i) scanf("%d", &a[i]), e[m + n].push_back(i); for (j = 0; j < n; ++j) { scanf("%d", &x); for (i = 0; i < m; ++i) if (F(a[i], x) > 1) e[i].push_back(m + j); e[m + j].push_back(m + n + 1); } for (x = 0; memset(f, 0, sizeof(f)), G(m + n, m + n + 1);) ++x; printf("%d\n", x); } return 0; }
#include <list> #include <stdio.h> #include <string.h> int F(int x, int y) { if (!y) return x; return F(y, x % y); } typedef std::list<int> L; L e[1002]; int m, n; bool f[1002]; int G(int s, int d) { if (s == d) return 1; if (f[s]) return 0; f[s] = 1; for (L::iterator i = e[s].begin(); i != e[s].end(); ++i) { if (G(*i, d)) { e[*i].push_back(s); e[s].erase(i); return 1; } } return 0; } int main() { int a[500], i, j, x; while (scanf("%d%d", &m, &n), m) { for (i = 0; i < m + n + 2; ++i) e[i].clear(); for (i = 0; i < m; ++i) scanf("%d", &a[i]), e[m + n].push_back(i); for (j = 0; j < n; ++j) { scanf("%d", &x); for (i = 0; i < m; ++i) if (F(a[i], x) > 1) e[i].push_back(m + j); e[m + j].push_back(m + n + 1); } for (x = 0; memset(f, 0, sizeof(f)), G(m + n, m + n + 1);) ++x; printf("%d\n", x); } return 0; }
replace
28
29
28
29
0
p00744
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; #define vec vector #define pb push_back #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); i++) // typedef long long Int; typedef int Weight; struct Edge { int src, dst; Weight weight; Edge(int src, int dst) : src(src), dst(dst) {} Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {} }; bool operator<(const Edge &e, const Edge &f) { return e.weight != f.weight ? e.weight > f.weight : e.src != f.src ? e.src < f.src : e.dst < f.dst; } typedef vec<Edge> Edges; typedef vec<Edges> Graph; #define MAXMN 500 int B[MAXMN]; int R[MAXMN]; int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } bool augment(const Graph &g, int u, vector<int> &matchTo, vector<bool> &visited) { if (u < 0) return true; FOR(e, g[u]) if (!visited[e->dst]) { visited[e->dst] = true; if (augment(g, matchTo[e->dst], matchTo, visited)) { matchTo[e->src] = e->dst; matchTo[e->dst] = e->src; return true; } } return false; } int bipartiteMatching(const Graph &g, int L) { const int n = g.size(); vector<int> matchTo(n, -1); int match = 0; REP(u, L) { vector<bool> visited(n); if (augment(g, u, matchTo, visited)) ++match; } return match; } int main(int argc, char **argv) { int M, N; Graph g; g.reserve(MAXMN + MAXMN); while (cin >> M >> N, M) { g.clear(); g.resize(M + N); REP(i, M) cin >> B[i]; REP(i, N) cin >> R[i]; REP(i, M) { Edges es, es2; REP(j, N) { if (gcd(B[i], R[j]) != 1) { es.pb(Edge(i, M + j)); es2.pb(Edge(M + j, i)); } } g[i] = es; g[M + i] = es2; } cout << bipartiteMatching(g, M) << endl; } return 0; }
#include <iostream> #include <vector> using namespace std; #define vec vector #define pb push_back #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); i++) // typedef long long Int; typedef int Weight; struct Edge { int src, dst; Weight weight; Edge(int src, int dst) : src(src), dst(dst) {} Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {} }; bool operator<(const Edge &e, const Edge &f) { return e.weight != f.weight ? e.weight > f.weight : e.src != f.src ? e.src < f.src : e.dst < f.dst; } typedef vec<Edge> Edges; typedef vec<Edges> Graph; #define MAXMN 500 int B[MAXMN]; int R[MAXMN]; int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } bool augment(const Graph &g, int u, vector<int> &matchTo, vector<bool> &visited) { if (u < 0) return true; FOR(e, g[u]) if (!visited[e->dst]) { visited[e->dst] = true; if (augment(g, matchTo[e->dst], matchTo, visited)) { matchTo[e->src] = e->dst; matchTo[e->dst] = e->src; return true; } } return false; } int bipartiteMatching(const Graph &g, int L) { const int n = g.size(); vector<int> matchTo(n, -1); int match = 0; REP(u, L) { vector<bool> visited(n); if (augment(g, u, matchTo, visited)) ++match; } return match; } int main(int argc, char **argv) { int M, N; Graph g; g.reserve(MAXMN + MAXMN); while (cin >> M >> N, M) { g.clear(); g.resize((M + N) * 2); REP(i, M) cin >> B[i]; REP(i, N) cin >> R[i]; REP(i, M) { Edges es, es2; REP(j, N) { if (gcd(B[i], R[j]) != 1) { es.pb(Edge(i, M + j)); es2.pb(Edge(M + j, i)); } } g[i] = es; g[M + i] = es2; } cout << bipartiteMatching(g, M) << endl; } return 0; }
replace
66
67
66
67
0
p00744
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) const int INF = 1e9; const int MAX_V = 300; int m, n; struct Flow { struct edge { int to, cap, rev; }; vector<edge> G[MAX_V]; //??£??\????????? bool used[MAX_V]; void add_edge(int from, int to, int cap) { G[from].push_back((edge){to, cap, (int)G[to].size()}); // from -> to G[to].push_back((edge){from, 0, (int)G[from].size() - 1}); // to -> from } //?¢???????????????¢??? int dfs(int v, int t, int f) { if (v == t) return f; used[v] = true; for (int i = 0; i < G[v].size(); ++i) { edge &e = G[v][i]; if (!used[e.to] && e.cap > 0) { int d = dfs(e.to, t, min(f, e.cap)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } // s??????t???????????§??? int max_flow(int s, int t) { int flow = 0; while (1) { memset(used, 0, sizeof(used)); int f = dfs(s, t, INF); if (f == 0) return flow; flow += f; } } }; int b[510], r[510]; int main(void) { while (1) { cin >> m >> n; if (m == 0 && n == 0) return 0; rep(i, m) cin >> b[i]; rep(i, n) cin >> r[i]; int s = m + n, t = m + n + 1; Flow mf; // s -> b rep(i, m) { mf.add_edge(s, i, 1); } // r -> t rep(i, n) { mf.add_edge(m + i, t, 1); } // b -> r rep(i, m) rep(j, n) { if (__gcd(b[i], r[j]) > 1) { // 1??\???????´???°????????? mf.add_edge(i, m + j, 1); } } printf("%d\n", mf.max_flow(s, t)); } }
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) const int INF = 1e9; const int MAX_V = 300000; int m, n; struct Flow { struct edge { int to, cap, rev; }; vector<edge> G[MAX_V]; //??£??\????????? bool used[MAX_V]; void add_edge(int from, int to, int cap) { G[from].push_back((edge){to, cap, (int)G[to].size()}); // from -> to G[to].push_back((edge){from, 0, (int)G[from].size() - 1}); // to -> from } //?¢???????????????¢??? int dfs(int v, int t, int f) { if (v == t) return f; used[v] = true; for (int i = 0; i < G[v].size(); ++i) { edge &e = G[v][i]; if (!used[e.to] && e.cap > 0) { int d = dfs(e.to, t, min(f, e.cap)); if (d > 0) { e.cap -= d; G[e.to][e.rev].cap += d; return d; } } } return 0; } // s??????t???????????§??? int max_flow(int s, int t) { int flow = 0; while (1) { memset(used, 0, sizeof(used)); int f = dfs(s, t, INF); if (f == 0) return flow; flow += f; } } }; int b[510], r[510]; int main(void) { while (1) { cin >> m >> n; if (m == 0 && n == 0) return 0; rep(i, m) cin >> b[i]; rep(i, n) cin >> r[i]; int s = m + n, t = m + n + 1; Flow mf; // s -> b rep(i, m) { mf.add_edge(s, i, 1); } // r -> t rep(i, n) { mf.add_edge(m + i, t, 1); } // b -> r rep(i, m) rep(j, n) { if (__gcd(b[i], r[j]) > 1) { // 1??\???????´???°????????? mf.add_edge(i, m + j, 1); } } printf("%d\n", mf.max_flow(s, t)); } }
replace
9
10
9
10
0
p00744
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int gcd(int a, int b) { if (!b) return a; return gcd(b, a % b); } int b[500], r[500]; vector<int> E[500]; bool used[1000]; int match[1000]; bool dfs(int u) { used[u] = true; for (int v : E[u]) { int w = match[v]; if (w == -1 || (!used[w] && dfs(w))) { match[u] = v; match[v] = u; return true; } } return false; } int main() { int m, n; while (scanf("%d%d", &m, &n), m) { rep(i, 1000) E[i].clear(); rep(i, m) scanf("%d", &b[i]); rep(i, n) scanf("%d", &r[i]); rep(i, m) rep(j, n) { if (gcd(b[i], r[j]) != 1) E[i].push_back(m + j); } memset(match, -1, sizeof(match)); int ans = 0; rep(i, m) { if (match[i] == -1) { memset(used, 0, sizeof(used)); if (dfs(i)) ans++; } } printf("%d\n", ans); } }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int gcd(int a, int b) { if (!b) return a; return gcd(b, a % b); } int b[500], r[500]; vector<int> E[1000]; bool used[1000]; int match[1000]; bool dfs(int u) { used[u] = true; for (int v : E[u]) { int w = match[v]; if (w == -1 || (!used[w] && dfs(w))) { match[u] = v; match[v] = u; return true; } } return false; } int main() { int m, n; while (scanf("%d%d", &m, &n), m) { rep(i, 1000) E[i].clear(); rep(i, m) scanf("%d", &b[i]); rep(i, n) scanf("%d", &r[i]); rep(i, m) rep(j, n) { if (gcd(b[i], r[j]) != 1) E[i].push_back(m + j); } memset(match, -1, sizeof(match)); int ans = 0; rep(i, m) { if (match[i] == -1) { memset(used, 0, sizeof(used)); if (dfs(i)) ans++; } } printf("%d\n", ans); } }
replace
10
11
10
11
-11
p00744
C++
Memory Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <vector> using namespace std; typedef long long ll; class pass { public: ll t; ll c; ll p; }; class scale { private: ll v, e; pass *p; vector<ll> *node; bool *used; ll *nowin; public: void set(ll vw, ll ew) { v = vw; p = new pass[ew * 2]; node = new vector<ll>[v]; used = new bool[v]; nowin = new ll[v]; e = 0; } void add(ll f, ll t, ll c) { p[e].t = t; p[e].c = c; p[e].p = e + 1; p[e + 1].t = f; p[e + 1].c = 0; p[e + 1].p = e; node[f].push_back(e); node[t].push_back(e + 1); e += 2; } ll solve() { ll nn = 0; for (auto i : node[0]) { nn = max(nn, p[i].c); } while (nn > 0) { stack<ll> st; queue<ll> q; for (ll i = 0; i < v; i++) { used[i] = false; nowin[i] = 0; } q.push(0); used[0] = true; while (!q.empty()) { ll np = q.front(); q.pop(); st.push(np); for (auto i : node[np]) { if (p[i].c > 0) { ll t = p[i].t; nowin[t] += p[i].c; if (nowin[t] >= nn && !used[t]) { if (t == v - 1) { st.push(t); goto aa; } q.push(t); used[t] = true; } } } } aa: if (st.top() != v - 1) { nn /= 2; continue; } while (!q.empty()) { used[q.front()] = false; q.pop(); } for (int i = 0; i < v; i++) { nowin[i] = 0; } nowin[v - 1] = nn; while (st.size() > 1) { ll np = st.top(); st.pop(); for (auto i : node[np]) { ll h = p[i].p; if (used[p[i].t] && p[h].c > 0) { ll w = min(p[h].c, nowin[np]); p[h].c -= w; p[i].c += w; nowin[np] -= w; nowin[p[i].t] += w; if (nowin[np] == 0) { break; } } } used[np] = false; } } ll all = 0; for (auto i : node[0]) { if (i % 2 == 0) { all += p[p[i].p].c; } } return all; } void del() { delete[] p; delete[] node; delete[] used; delete[] nowin; } }; ll dn[2000]; ll dm[2000]; ll gcd(ll a, ll b) { if (a % b == 0) { return b; } return gcd(b, a % b); } int main() { while (1) { scale a; ll n, m; scanf("%lld%lld", &n, &m); if (n == 0) { break; } a.set(n + m + 2, n * m * 2); for (ll i = 0; i < n; i++) { scanf("%lld", &dn[i]); a.add(0, 1 + i, 1); } for (ll i = 0; i < m; i++) { scanf("%lld", &dm[i]); a.add(n + 1 + i, n + m + 1, 1); } for (ll i = 0; i < n; i++) { for (ll ii = 0; ii < m; ii++) { if (1 < gcd(dn[i], dm[ii])) { a.add(1 + i, n + 1 + ii, 1); } } } printf("%lld\n", a.solve()); } return 0; }
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <vector> using namespace std; typedef long long ll; class pass { public: ll t; ll c; ll p; }; class scale { private: ll v, e; pass *p; vector<ll> *node; bool *used; ll *nowin; public: void set(ll vw, ll ew) { v = vw; p = new pass[ew * 2]; node = new vector<ll>[v]; used = new bool[v]; nowin = new ll[v]; e = 0; } void add(ll f, ll t, ll c) { p[e].t = t; p[e].c = c; p[e].p = e + 1; p[e + 1].t = f; p[e + 1].c = 0; p[e + 1].p = e; node[f].push_back(e); node[t].push_back(e + 1); e += 2; } ll solve() { ll nn = 0; for (auto i : node[0]) { nn = max(nn, p[i].c); } while (nn > 0) { stack<ll> st; queue<ll> q; for (ll i = 0; i < v; i++) { used[i] = false; nowin[i] = 0; } q.push(0); used[0] = true; while (!q.empty()) { ll np = q.front(); q.pop(); st.push(np); for (auto i : node[np]) { if (p[i].c > 0) { ll t = p[i].t; nowin[t] += p[i].c; if (nowin[t] >= nn && !used[t]) { if (t == v - 1) { st.push(t); goto aa; } q.push(t); used[t] = true; } } } } aa: if (st.top() != v - 1) { nn /= 2; continue; } while (!q.empty()) { used[q.front()] = false; q.pop(); } for (int i = 0; i < v; i++) { nowin[i] = 0; } nowin[v - 1] = nn; while (st.size() > 1) { ll np = st.top(); st.pop(); for (auto i : node[np]) { ll h = p[i].p; if (used[p[i].t] && p[h].c > 0) { ll w = min(p[h].c, nowin[np]); p[h].c -= w; p[i].c += w; nowin[np] -= w; nowin[p[i].t] += w; if (nowin[np] == 0) { break; } } } used[np] = false; } } ll all = 0; for (auto i : node[0]) { if (i % 2 == 0) { all += p[p[i].p].c; } } return all; } void del() { delete[] p; delete[] node; delete[] used; delete[] nowin; } }; ll dn[2000]; ll dm[2000]; ll gcd(ll a, ll b) { if (a % b == 0) { return b; } return gcd(b, a % b); } int main() { while (1) { scale a; ll n, m; scanf("%lld%lld", &n, &m); if (n == 0) { break; } a.set(n + m + 2, n * m * 2); for (ll i = 0; i < n; i++) { scanf("%lld", &dn[i]); a.add(0, 1 + i, 1); } for (ll i = 0; i < m; i++) { scanf("%lld", &dm[i]); a.add(n + 1 + i, n + m + 1, 1); } for (ll i = 0; i < n; i++) { for (ll ii = 0; ii < m; ii++) { if (1 < gcd(dn[i], dm[ii])) { a.add(1 + i, n + 1 + ii, 1); } } } printf("%lld\n", a.solve()); a.del(); } return 0; }
insert
168
168
168
169
MLE
p00745
C++
Time Limit Exceeded
#include <algorithm> #include <assert.h> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <valarray> #include <vector> using namespace std; typedef long long int ll; typedef unsigned int uint; typedef unsigned char uchar; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i++) #define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--) #define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++) #define RFOR(i, c) \ for (__typeof((c).rbegin()) i = (c).rbegin(); i != (c).rend(); i++) #define ALL(container) (container).begin(), (container).end() #define RALL(container) (container).rbegin(), (container).rend() #define SZ(container) ((int)container.size()) #define mp(a, b) make_pair(a, b) #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; } template <class T> ostream &operator<<(ostream &os, const vector<T> &t) { os << "["; FOR(it, t) { if (it != t.begin()) os << ","; os << *it; } os << "]"; return os; } template <class T> ostream &operator<<(ostream &os, const set<T> &t) { os << "{"; FOR(it, t) { if (it != t.begin()) os << ","; os << *it; } os << "}"; return os; } template <class S, class T> ostream &operator<<(ostream &os, const pair<S, T> &t) { return os << "(" << t.first << "," << t.second << ")"; } template <class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); } template <class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); } namespace geom { #define X real() #define Y imag() #define at(i) ((*this)[i]) #define SELF (*this) enum { TRUE = 1, FALSE = 0, BORDER = -1 }; typedef int BOOL; typedef long double R; const R INF = 1e8; R EPS = 1e-8; const R PI = 3.1415926535897932384626; inline int sig(const R &x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); } inline BOOL less(const R &x, const R &y) { return sig(x - y) ? x < y : BORDER; } typedef complex<R> P; inline R norm(const P &p) { return p.X * p.X + p.Y * p.Y; } inline R inp(const P &a, const P &b) { return (conj(a) * b).X; } inline R outp(const P &a, const P &b) { return (conj(a) * b).Y; } inline P unit(const P &p) { return p / abs(p); } inline P proj(const P &s, const P &t) { return t * inp(s, t) / norm(t); } inline int ccw(const P &s, const P &t, const P &p, int adv = 0) { int res = sig(outp(t - s, p - s)); if (res || !adv) return res; if (sig(inp(t - s, p - s)) < 0) return -2; // p-s-t if (sig(inp(s - t, p - t)) < 0) return 2; // s-t-p return 0; // s-p-t } struct L : public vector<P> { // line L(const P &p1, const P &p2) { this->push_back(p1); this->push_back(p2); } L() {} P dir() const { return at(1) - at(0); } BOOL online(const P &p) const { return !sig(outp(p - at(0), dir())); } }; struct S : public L { // segment S(const P &p1, const P &p2) : L(p1, p2) {} S() {} BOOL online(const P &p) const { if (!sig(norm(p - at(0))) || !sig(norm(p - at(1)))) return BORDER; // 座標の二乗とEPSの差が大きすぎないように注意 return !sig(outp(p - at(0), dir())) && inp(p - at(0), dir()) > EPS && inp(p - at(1), -dir()) > -EPS; // return !sig(abs(at(0)-p) + abs(at(1) - p) - abs(at(0) - at(1))); } }; struct C : public P { C() {} C(const P &p, const R r) : P(p), r(r) {} R r; BOOL inside(const P &p) const { return less(norm(p - SELF), r * r); } }; struct F : public C { R s, t; F(const C &c, R ss, R tt) : C(c), s(ss), t(tt) { if (PI < s) s -= 2 * PI; if (PI < t) t -= 2 * PI; } BOOL inside(const P &p) const { P v = p - SELF; if (!sig(norm(v))) return BORDER; R a = arg(v); if (t < s) { if ((!less(s, a) && !less(a, t)) || !less(norm(v), r * r)) return FALSE; return less(s, a) | less(a, t) | less(norm(v), r * r); } else { if (!less(s, a) || !less(a, t) || !less(norm(v), r * r)) return FALSE; return less(s, a) | less(a, t) | less(norm(v), r * r); } } }; P crosspoint(const L &l, const L &m); struct G : public vector<P> { G(size_type size = 0) : vector(size) {} S edge(int i) const { return S(at(i), at(i + 1 == size() ? 0 : i + 1)); } BOOL contains(const P &p) const { R sum = .0; REP(i, size()) { if (S(at(i), at((i + 1) % size())).online(p)) return BORDER; // online sum += arg((at(i) - p) / (at((i + 1) % size()) - p)); } return !!sig(sum); } R area() const { R sum = 0; REP(i, size()) sum += outp(at(i), at((i + 1) % size())); return abs(sum / 2.); } P gp() const { P r(.0, .0); REP(i, size()) { const S &s = edge(i); r += (s[0] + s[1]) * outp(s[0], s[1]); } return r / (6 * area()); } G convex_hull(bool online = false) { if (size() < 2) return *this; sort(ALL(*this)); G r; r.resize((int)size() * 2); int k = 0; for (int i = 0; i < size(); r[k++] = at(i++)) while (k > 1 && ccw(r[k - 2], r[k - 1], at(i)) < 1 - online) k--; int t = k; for (int i = (int)size() - 1; i >= 0; r[k++] = at(i--)) while (k > t && ccw(r[k - 2], r[k - 1], at(i)) < 1 - online) k--; r.resize(k - 1); return r; } G cut(const L &l) const { G g; REP(i, size()) { const S &s = edge(i); if (ccw(l[0], l[1], s[0], 0) >= 0) g.push_back(s[0]); if (ccw(l[0], l[1], s[0], 0) * ccw(l[0], l[1], s[1], 0) < 0) g.push_back(crosspoint(s, l)); } return g; } G Voronoi(const vector<P> &p, const int t) const { G g = *this; REP(i, p.size()) if (i != t) { const P m = (p[t] + p[i]) * (R)0.5; g = g.cut(L(m, m + (p[i] - p[t]) * P(0, 1))); } return g; } }; inline P proj(const P &s, const L &t) { return t[0] + proj(s - t[0], t[1] - t[0]); } inline P reflect(const P &s, const L &t) { return (R)2. * proj(s, t) - s; } inline S reflect(const S &s, const L &t) { return S(reflect(s[0], t), reflect(s[1], t)); } BOOL intersect(const S &s, const S &t) { const int p = ccw(t[0], t[1], s[0], 1) * ccw(t[0], t[1], s[1], 1); const int q = ccw(s[0], s[1], t[0], 1) * ccw(s[0], s[1], t[1], 1); return (p > 0 || q > 0) ? FALSE : (!p || !q) ? BORDER : TRUE; } BOOL intersect(const S &s, const L &l) { if (l.online(s[0]) || l.online(s[1])) return BORDER; return (sig(outp(l.dir(), s[0] - l[0])) * sig(outp(l.dir(), s[1] - l[0])) <= 0); } R dist2(const L &l, const P &p) { return norm(outp(l.dir(), p - l[0])) / norm(l.dir()); } R dist2(const S &s, const P &p) { if (inp(p - s[0], s.dir()) < EPS) return norm(p - s[0]); if (inp(p - s[1], -s.dir()) < EPS) return norm(p - s[1]); return dist2((const L &)s, p); } R dist2(const S &s, const L &l) { return intersect(s, l) ? .0 : min(dist2(l, s[0]), dist2(l, s[1])); } R dist2(const S &s, const S &t) { return intersect(s, t) ? .0 : min(min(dist2(s, t[0]), dist2(t, s[0])), min(dist2(s, t[1]), dist2(t, s[1]))); } template <class T> R dist2(const G &g, const T &t) { // todo: 内部に完全に含まれる場合 R res = INF; REP(i, g.size()) res = min(res, dist2(g.edge(i), t)); return res; } template <class S, class T> R dist(const S &s, const T &t) { return sqrt(dist2(s, t)); } inline BOOL intersect(const C &a, const C &b) { return less((a.r - b.r) * (a.r - b.r), norm(a - b)) + less(norm(a - b), (a.r + b.r) * (a.r + b.r)) - 1; } inline BOOL intersect(const C &c, const L &l) { return less(dist2(l, c), c.r * c.r); } inline BOOL intersect(const C &c, const S &s) { int d = less(dist2(s, c), c.r * c.r); if (d != TRUE) return d; int p = c.inside(s[0]), q = c.inside(s[1]); return (p < 0 || q < 0) ? BORDER : p & q; } inline P crosspoint(const L &l, const L &m) { R A = outp(l.dir(), m.dir()), B = outp(l.dir(), l[1] - m[0]); if (!sig(abs(A)) && !sig(abs(B))) return m[0]; // same line if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!! return m[0] + B / A * (m[1] - m[0]); } #undef SELF #undef at } // namespace geom using namespace geom; int f = 0; namespace std { bool operator<(const P &a, const P &b) { return sig(a.X - b.X) ? a.X < b.X : a.Y + EPS < b.Y; } bool operator==(const P &a, const P &b) { return abs(a - b) < EPS; } istream &operator>>(istream &is, P &p) { R x, y; is >> x >> y; p = P(x, y); return is; } istream &operator>>(istream &is, L &l) { l.resize(2); return is >> l[0] >> l[1]; } istream &operator>>(istream &is, C &c) { return is >> (P &)c >> c.r; } const R B = 200; const R Z = .5; ostream &operator<<(ostream &os, const C &c) { return os << "circle(" << B + Z * (c.X) << ", " << 1000 - B - Z * (c.Y) << ", " << Z * (c.r) << ")"; } ostream &operator<<(ostream &os, const P &p) { return os << C(p, 2. / Z); } ostream &operator<<(ostream &os, const S &s) { return os << "line(" << B + Z * (s[0].X) << ", " << 1000 - B - Z * (s[0].Y) << ", " << B + Z * (s[1].X) << ", " << 1000 - B - Z * (s[1].Y) << ")"; } ostream &operator<<(ostream &os, const G &g) { REP(i, g.size()) os << g.edge(i) << endl; return os; } } // namespace std int n, m; vi path(S root, const vector<P> &pin) { vi res; if (!sig(root.dir().X)) return res; REPS(i, n) { P cp = crosspoint(root, L(pin[i], pin[i] + P(0, 1))); if (root.online(cp) == FALSE) continue; if (abs(root[0].X - cp.X) < EPS || abs(root[1].X - cp.X) < EPS) continue; res.push_back(pin[i].Y < cp.Y ? i : -i); } sort(ALL(res), [&](int i, int j) { return abs(root[0].X - pin[abs(i)].X) < abs(root[0].X - pin[abs(j)].X); }); return res; } int main(int argc, char *argv[]) { ios::sync_with_stdio(false); int T = 1; while (cin >> m >> n, n) { vector<P> root(m), pin(n + 1); REP(i, m) { cin >> root[i]; root[i] *= polar((R)1, (R)1); } pin[0] = root[0]; REPS(i, n) { cin >> pin[i]; pin[i] *= polar((R)1, (R)1); } sort(pin.begin() + 1, pin.end()); pin.push_back(root.back()); vector<int> st; st.push_back(0); REP(i, m - 1) { S s(root[i], root[i + 1]); vi isc = path(s, pin); FOR(it, isc) { if (st.back() == *it) st.pop_back(); else st.push_back(*it); } } st.push_back(n + 1); vector<R> dp(st.size(), INF); vi prev(st.size()); dp[0] = .0; int save = 0; REP(i, st.size()) { if (i && st[i] == -st[i - 1]) { save = i; dp[i] = dp[i - 1]; prev[i] = prev[i - 1]; continue; } for (int j = save; j < i; j++) { S r(pin[abs(st[j])], pin[abs(st[i])]); vi pt = path(r, pin); if ([&]() { for (int k = 1; k <= pt.size() && j + k < i; k++) if (pt[k - 1] != st[j + k]) return 0; return 1; }()) { if (chmin(dp[i], dp[j] + abs(r.dir()))) { prev[i] = j; } } } } printf("%.10f\n", (double)dp.back()); } return 0; }
#include <algorithm> #include <assert.h> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <valarray> #include <vector> using namespace std; typedef long long int ll; typedef unsigned int uint; typedef unsigned char uchar; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i++) #define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--) #define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++) #define RFOR(i, c) \ for (__typeof((c).rbegin()) i = (c).rbegin(); i != (c).rend(); i++) #define ALL(container) (container).begin(), (container).end() #define RALL(container) (container).rbegin(), (container).rend() #define SZ(container) ((int)container.size()) #define mp(a, b) make_pair(a, b) #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; } template <class T> ostream &operator<<(ostream &os, const vector<T> &t) { os << "["; FOR(it, t) { if (it != t.begin()) os << ","; os << *it; } os << "]"; return os; } template <class T> ostream &operator<<(ostream &os, const set<T> &t) { os << "{"; FOR(it, t) { if (it != t.begin()) os << ","; os << *it; } os << "}"; return os; } template <class S, class T> ostream &operator<<(ostream &os, const pair<S, T> &t) { return os << "(" << t.first << "," << t.second << ")"; } template <class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); } template <class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); } namespace geom { #define X real() #define Y imag() #define at(i) ((*this)[i]) #define SELF (*this) enum { TRUE = 1, FALSE = 0, BORDER = -1 }; typedef int BOOL; typedef double R; const R INF = 1e8; R EPS = 1e-8; const R PI = 3.1415926535897932384626; inline int sig(const R &x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); } inline BOOL less(const R &x, const R &y) { return sig(x - y) ? x < y : BORDER; } typedef complex<R> P; inline R norm(const P &p) { return p.X * p.X + p.Y * p.Y; } inline R inp(const P &a, const P &b) { return (conj(a) * b).X; } inline R outp(const P &a, const P &b) { return (conj(a) * b).Y; } inline P unit(const P &p) { return p / abs(p); } inline P proj(const P &s, const P &t) { return t * inp(s, t) / norm(t); } inline int ccw(const P &s, const P &t, const P &p, int adv = 0) { int res = sig(outp(t - s, p - s)); if (res || !adv) return res; if (sig(inp(t - s, p - s)) < 0) return -2; // p-s-t if (sig(inp(s - t, p - t)) < 0) return 2; // s-t-p return 0; // s-p-t } struct L : public vector<P> { // line L(const P &p1, const P &p2) { this->push_back(p1); this->push_back(p2); } L() {} P dir() const { return at(1) - at(0); } BOOL online(const P &p) const { return !sig(outp(p - at(0), dir())); } }; struct S : public L { // segment S(const P &p1, const P &p2) : L(p1, p2) {} S() {} BOOL online(const P &p) const { if (!sig(norm(p - at(0))) || !sig(norm(p - at(1)))) return BORDER; // 座標の二乗とEPSの差が大きすぎないように注意 return !sig(outp(p - at(0), dir())) && inp(p - at(0), dir()) > EPS && inp(p - at(1), -dir()) > -EPS; // return !sig(abs(at(0)-p) + abs(at(1) - p) - abs(at(0) - at(1))); } }; struct C : public P { C() {} C(const P &p, const R r) : P(p), r(r) {} R r; BOOL inside(const P &p) const { return less(norm(p - SELF), r * r); } }; struct F : public C { R s, t; F(const C &c, R ss, R tt) : C(c), s(ss), t(tt) { if (PI < s) s -= 2 * PI; if (PI < t) t -= 2 * PI; } BOOL inside(const P &p) const { P v = p - SELF; if (!sig(norm(v))) return BORDER; R a = arg(v); if (t < s) { if ((!less(s, a) && !less(a, t)) || !less(norm(v), r * r)) return FALSE; return less(s, a) | less(a, t) | less(norm(v), r * r); } else { if (!less(s, a) || !less(a, t) || !less(norm(v), r * r)) return FALSE; return less(s, a) | less(a, t) | less(norm(v), r * r); } } }; P crosspoint(const L &l, const L &m); struct G : public vector<P> { G(size_type size = 0) : vector(size) {} S edge(int i) const { return S(at(i), at(i + 1 == size() ? 0 : i + 1)); } BOOL contains(const P &p) const { R sum = .0; REP(i, size()) { if (S(at(i), at((i + 1) % size())).online(p)) return BORDER; // online sum += arg((at(i) - p) / (at((i + 1) % size()) - p)); } return !!sig(sum); } R area() const { R sum = 0; REP(i, size()) sum += outp(at(i), at((i + 1) % size())); return abs(sum / 2.); } P gp() const { P r(.0, .0); REP(i, size()) { const S &s = edge(i); r += (s[0] + s[1]) * outp(s[0], s[1]); } return r / (6 * area()); } G convex_hull(bool online = false) { if (size() < 2) return *this; sort(ALL(*this)); G r; r.resize((int)size() * 2); int k = 0; for (int i = 0; i < size(); r[k++] = at(i++)) while (k > 1 && ccw(r[k - 2], r[k - 1], at(i)) < 1 - online) k--; int t = k; for (int i = (int)size() - 1; i >= 0; r[k++] = at(i--)) while (k > t && ccw(r[k - 2], r[k - 1], at(i)) < 1 - online) k--; r.resize(k - 1); return r; } G cut(const L &l) const { G g; REP(i, size()) { const S &s = edge(i); if (ccw(l[0], l[1], s[0], 0) >= 0) g.push_back(s[0]); if (ccw(l[0], l[1], s[0], 0) * ccw(l[0], l[1], s[1], 0) < 0) g.push_back(crosspoint(s, l)); } return g; } G Voronoi(const vector<P> &p, const int t) const { G g = *this; REP(i, p.size()) if (i != t) { const P m = (p[t] + p[i]) * (R)0.5; g = g.cut(L(m, m + (p[i] - p[t]) * P(0, 1))); } return g; } }; inline P proj(const P &s, const L &t) { return t[0] + proj(s - t[0], t[1] - t[0]); } inline P reflect(const P &s, const L &t) { return (R)2. * proj(s, t) - s; } inline S reflect(const S &s, const L &t) { return S(reflect(s[0], t), reflect(s[1], t)); } BOOL intersect(const S &s, const S &t) { const int p = ccw(t[0], t[1], s[0], 1) * ccw(t[0], t[1], s[1], 1); const int q = ccw(s[0], s[1], t[0], 1) * ccw(s[0], s[1], t[1], 1); return (p > 0 || q > 0) ? FALSE : (!p || !q) ? BORDER : TRUE; } BOOL intersect(const S &s, const L &l) { if (l.online(s[0]) || l.online(s[1])) return BORDER; return (sig(outp(l.dir(), s[0] - l[0])) * sig(outp(l.dir(), s[1] - l[0])) <= 0); } R dist2(const L &l, const P &p) { return norm(outp(l.dir(), p - l[0])) / norm(l.dir()); } R dist2(const S &s, const P &p) { if (inp(p - s[0], s.dir()) < EPS) return norm(p - s[0]); if (inp(p - s[1], -s.dir()) < EPS) return norm(p - s[1]); return dist2((const L &)s, p); } R dist2(const S &s, const L &l) { return intersect(s, l) ? .0 : min(dist2(l, s[0]), dist2(l, s[1])); } R dist2(const S &s, const S &t) { return intersect(s, t) ? .0 : min(min(dist2(s, t[0]), dist2(t, s[0])), min(dist2(s, t[1]), dist2(t, s[1]))); } template <class T> R dist2(const G &g, const T &t) { // todo: 内部に完全に含まれる場合 R res = INF; REP(i, g.size()) res = min(res, dist2(g.edge(i), t)); return res; } template <class S, class T> R dist(const S &s, const T &t) { return sqrt(dist2(s, t)); } inline BOOL intersect(const C &a, const C &b) { return less((a.r - b.r) * (a.r - b.r), norm(a - b)) + less(norm(a - b), (a.r + b.r) * (a.r + b.r)) - 1; } inline BOOL intersect(const C &c, const L &l) { return less(dist2(l, c), c.r * c.r); } inline BOOL intersect(const C &c, const S &s) { int d = less(dist2(s, c), c.r * c.r); if (d != TRUE) return d; int p = c.inside(s[0]), q = c.inside(s[1]); return (p < 0 || q < 0) ? BORDER : p & q; } inline P crosspoint(const L &l, const L &m) { R A = outp(l.dir(), m.dir()), B = outp(l.dir(), l[1] - m[0]); if (!sig(abs(A)) && !sig(abs(B))) return m[0]; // same line if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!! return m[0] + B / A * (m[1] - m[0]); } #undef SELF #undef at } // namespace geom using namespace geom; int f = 0; namespace std { bool operator<(const P &a, const P &b) { return sig(a.X - b.X) ? a.X < b.X : a.Y + EPS < b.Y; } bool operator==(const P &a, const P &b) { return abs(a - b) < EPS; } istream &operator>>(istream &is, P &p) { R x, y; is >> x >> y; p = P(x, y); return is; } istream &operator>>(istream &is, L &l) { l.resize(2); return is >> l[0] >> l[1]; } istream &operator>>(istream &is, C &c) { return is >> (P &)c >> c.r; } const R B = 200; const R Z = .5; ostream &operator<<(ostream &os, const C &c) { return os << "circle(" << B + Z * (c.X) << ", " << 1000 - B - Z * (c.Y) << ", " << Z * (c.r) << ")"; } ostream &operator<<(ostream &os, const P &p) { return os << C(p, 2. / Z); } ostream &operator<<(ostream &os, const S &s) { return os << "line(" << B + Z * (s[0].X) << ", " << 1000 - B - Z * (s[0].Y) << ", " << B + Z * (s[1].X) << ", " << 1000 - B - Z * (s[1].Y) << ")"; } ostream &operator<<(ostream &os, const G &g) { REP(i, g.size()) os << g.edge(i) << endl; return os; } } // namespace std int n, m; vi path(S root, const vector<P> &pin) { vi res; if (!sig(root.dir().X)) return res; REPS(i, n) { P cp = crosspoint(root, L(pin[i], pin[i] + P(0, 1))); if (root.online(cp) == FALSE) continue; if (abs(root[0].X - cp.X) < EPS || abs(root[1].X - cp.X) < EPS) continue; res.push_back(pin[i].Y < cp.Y ? i : -i); } sort(ALL(res), [&](int i, int j) { return abs(root[0].X - pin[abs(i)].X) < abs(root[0].X - pin[abs(j)].X); }); return res; } int main(int argc, char *argv[]) { ios::sync_with_stdio(false); int T = 1; while (cin >> m >> n, n) { vector<P> root(m), pin(n + 1); REP(i, m) { cin >> root[i]; root[i] *= polar((R)1, (R)1); } pin[0] = root[0]; REPS(i, n) { cin >> pin[i]; pin[i] *= polar((R)1, (R)1); } sort(pin.begin() + 1, pin.end()); pin.push_back(root.back()); vector<int> st; st.push_back(0); REP(i, m - 1) { S s(root[i], root[i + 1]); vi isc = path(s, pin); FOR(it, isc) { if (st.back() == *it) st.pop_back(); else st.push_back(*it); } } st.push_back(n + 1); vector<R> dp(st.size(), INF); vi prev(st.size()); dp[0] = .0; int save = 0; REP(i, st.size()) { if (i && st[i] == -st[i - 1]) { save = i; dp[i] = dp[i - 1]; prev[i] = prev[i - 1]; continue; } for (int j = save; j < i; j++) { S r(pin[abs(st[j])], pin[abs(st[i])]); vi pt = path(r, pin); if ([&]() { for (int k = 1; k <= pt.size() && j + k < i; k++) if (pt[k - 1] != st[j + k]) return 0; return 1; }()) { if (chmin(dp[i], dp[j] + abs(r.dir()))) { prev[i] = j; } } } } printf("%.10f\n", (double)dp.back()); } return 0; }
replace
101
102
101
102
TLE
p00746
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; bool SortXPos(pair<int, int> pos1, pair<int, int> pos2) { return pos1.first < pos2.first ? true : false; } bool SortYPos(pair<int, int> pos1, pair<int, int> pos2) { return pos1.second < pos2.second ? true : false; } int main(void) { int num; while (cin >> num) { vector<pair<int, int>> pos(num); pos[0].first = 0; pos[0].second = 0; for (int i = 1; i < num; i++) { int base, action; cin >> base >> action; switch (action) { case 0: pos[i].first = pos[base].first - 1; pos[i].second = pos[base].second; break; case 1: pos[i].first = pos[base].first; pos[i].second = pos[base].second - 1; break; case 2: pos[i].first = pos[base].first + 1; pos[i].second = pos[base].second; break; case 3: pos[i].first = pos[base].first; pos[i].second = pos[base].second + 1; break; } } sort(pos.begin(), pos.end(), SortXPos); int xlength = pos[num - 1].first - pos[0].first + 1; sort(pos.begin(), pos.end(), SortYPos); int ylength = pos[num - 1].second - pos[0].second + 1; cout << xlength << ' ' << ylength << endl; } return 0; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; bool SortXPos(pair<int, int> pos1, pair<int, int> pos2) { return pos1.first < pos2.first ? true : false; } bool SortYPos(pair<int, int> pos1, pair<int, int> pos2) { return pos1.second < pos2.second ? true : false; } int main(void) { int num; while (cin >> num) { if (num == 0) break; vector<pair<int, int>> pos(num); pos[0].first = 0; pos[0].second = 0; for (int i = 1; i < num; i++) { int base, action; cin >> base >> action; switch (action) { case 0: pos[i].first = pos[base].first - 1; pos[i].second = pos[base].second; break; case 1: pos[i].first = pos[base].first; pos[i].second = pos[base].second - 1; break; case 2: pos[i].first = pos[base].first + 1; pos[i].second = pos[base].second; break; case 3: pos[i].first = pos[base].first; pos[i].second = pos[base].second + 1; break; } } sort(pos.begin(), pos.end(), SortXPos); int xlength = pos[num - 1].first - pos[0].first + 1; sort(pos.begin(), pos.end(), SortYPos); int ylength = pos[num - 1].second - pos[0].second + 1; cout << xlength << ' ' << ylength << endl; } return 0; }
insert
15
15
15
17
-11
p00746
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; struct POINT { int x; int y; }; int dx[] = {-1, 0, 1, 0}; int dy[] = {0, 1, 0, -1}; int main(void) { int N; while (cin >> N, N) { POINT minp = {0, 0}; POINT maxp = {0, 0}; vector<POINT> box(N); box[0].x = 0; box[0].y = 0; for (int i = 1; i < N; i++) { int n, d; cin >> n >> d; box[i].x = box[n].x + dx[d]; box[i].y = box[n].y + dy[d]; minp.x = min(minp.x, box[i].x); minp.y = min(minp.y, box[i].y); maxp.x = max(maxp.x, box[i].x); maxp.y = max(maxp.y, box[i].y); } cerr << "--- "; cout << (maxp.x - minp.x + 1) << " " << (maxp.y - minp.y + 1) << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; struct POINT { int x; int y; }; int dx[] = {-1, 0, 1, 0}; int dy[] = {0, 1, 0, -1}; int main(void) { int N; while (cin >> N, N) { POINT minp = {0, 0}; POINT maxp = {0, 0}; vector<POINT> box(N); box[0].x = 0; box[0].y = 0; for (int i = 1; i < N; i++) { int n, d; cin >> n >> d; box[i].x = box[n].x + dx[d]; box[i].y = box[n].y + dy[d]; minp.x = min(minp.x, box[i].x); minp.y = min(minp.y, box[i].y); maxp.x = max(maxp.x, box[i].x); maxp.y = max(maxp.y, box[i].y); } // cerr << "--- "; cout << (maxp.x - minp.x + 1) << " " << (maxp.y - minp.y + 1) << endl; } return 0; }
replace
42
43
42
43
TLE
p00746
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using LL = long long; using P = pair<int, int>; using Tapris = tuple<int, int, int>; #define REP(i, n) for (LL i = 0; i < n; ++i) #define FOR(i, a, n) for (LL i = a; i < n; ++i) #define pb(a) push_back(a) #define all(x) (x).begin(), (x).end() const int INF = (int)1e9; const LL INFL = (LL)1e15; const int MOD = 1e9 + 7; int dy[] = {0, -1, 0, 1}; int dx[] = {-1, 0, 1, 0}; // #define int long long /*************** using variables ***************/ int N; vector<int> n, d; P coordinates[101]; /**********************************************/ void solve() { coordinates[0] = P(0, 0); REP(i, N - 1) { int cur = i + 1; int y = coordinates[n[i]].first + dy[d[i]]; int x = coordinates[n[i]].second + dx[d[i]]; coordinates[cur] = P(y, x); } int x_max_num = -INF; int y_max_num = -INF; int x_min_num = INF; int y_min_num = INF; REP(i, N) { x_max_num = max(x_max_num, coordinates[i].second); x_min_num = min(x_min_num, coordinates[i].second); y_max_num = max(y_max_num, coordinates[i].first); y_min_num = min(y_min_num, coordinates[i].first); } cout << x_max_num - x_min_num + 1 << " " << y_max_num - y_min_num + 1 << endl; return; } signed main() { cin.tie(0); ios::sync_with_stdio(false); while (cin >> N, N) { n.resize(N - 1); d.resize(N - 1); REP(i, N - 1) cin >> n[i] >> d[i]; solve(); } }
#include <bits/stdc++.h> using namespace std; using LL = long long; using P = pair<int, int>; using Tapris = tuple<int, int, int>; #define REP(i, n) for (LL i = 0; i < n; ++i) #define FOR(i, a, n) for (LL i = a; i < n; ++i) #define pb(a) push_back(a) #define all(x) (x).begin(), (x).end() const int INF = (int)1e9; const LL INFL = (LL)1e15; const int MOD = 1e9 + 7; int dy[] = {0, -1, 0, 1}; int dx[] = {-1, 0, 1, 0}; // #define int long long /*************** using variables ***************/ int N; vector<int> n, d; P coordinates[201]; /**********************************************/ void solve() { coordinates[0] = P(0, 0); REP(i, N - 1) { int cur = i + 1; int y = coordinates[n[i]].first + dy[d[i]]; int x = coordinates[n[i]].second + dx[d[i]]; coordinates[cur] = P(y, x); } int x_max_num = -INF; int y_max_num = -INF; int x_min_num = INF; int y_min_num = INF; REP(i, N) { x_max_num = max(x_max_num, coordinates[i].second); x_min_num = min(x_min_num, coordinates[i].second); y_max_num = max(y_max_num, coordinates[i].first); y_min_num = min(y_min_num, coordinates[i].first); } cout << x_max_num - x_min_num + 1 << " " << y_max_num - y_min_num + 1 << endl; return; } signed main() { cin.tie(0); ios::sync_with_stdio(false); while (cin >> N, N) { n.resize(N - 1); d.resize(N - 1); REP(i, N - 1) cin >> n[i] >> d[i]; solve(); } }
replace
24
25
24
25
0
p00746
C++
Time Limit Exceeded
#include "bits/stdc++.h" #pragma warning(disable : 4996) using namespace std; const int dx[4] = {-1, 0, 1, 0}; const int dy[4] = {0, 1, 0, -1}; int main() { while (1) { int N; cin >> N; vector<int> xs; vector<int> ys; xs.emplace_back(0); ys.emplace_back(0); for (int i = 0; i < N - 1; ++i) { int n, d; cin >> n >> d; const int nx = xs[n] + dx[d]; const int ny = ys[n] + dy[d]; xs.emplace_back(nx); ys.emplace_back(ny); } const int width = *(max_element(xs.begin(), xs.end())) - *(min_element(xs.begin(), xs.end())); const int height = *(max_element(ys.begin(), ys.end())) - *(min_element(ys.begin(), ys.end())); cout << width + 1 << " " << height + 1 << endl; } return 0; }
#include "bits/stdc++.h" #pragma warning(disable : 4996) using namespace std; const int dx[4] = {-1, 0, 1, 0}; const int dy[4] = {0, 1, 0, -1}; int main() { while (1) { int N; cin >> N; if (!N) break; vector<int> xs; vector<int> ys; xs.emplace_back(0); ys.emplace_back(0); for (int i = 0; i < N - 1; ++i) { int n, d; cin >> n >> d; const int nx = xs[n] + dx[d]; const int ny = ys[n] + dy[d]; xs.emplace_back(nx); ys.emplace_back(ny); } const int width = *(max_element(xs.begin(), xs.end())) - *(min_element(xs.begin(), xs.end())); const int height = *(max_element(ys.begin(), ys.end())) - *(min_element(ys.begin(), ys.end())); cout << width + 1 << " " << height + 1 << endl; } return 0; }
insert
10
10
10
12
TLE
p00748
C++
Runtime Error
#include <iostream> using namespace std; int dpt1[1000001]; int dpt2[1000001]; bool dpb1[1000001]; bool dpb2[1000001]; int tr[1000]; int sq[1000]; int dp1(int s) { if (dpb1[s]) return dpt1[s]; int m = 1000111000; int r; for (int i = 1; i < 1000; i++) { if (s - sq[i] < 0) break; r = dp1(s - sq[i]); if (r < m) m = r; } dpt1[s] = m + 1; dpb1[s] = true; return m + 1; } int dp2(int s) { if (dpb2[s]) return dpt2[s]; int m = 1000111000; int r; for (int i = 1; i < 1000; i++) { if (s - sq[i] < 0) break; if (sq[i] % 2 == 0) continue; r = dp2(s - sq[i]); if (r < m) m = r; } dpt2[s] = m + 1; dpb2[s] = true; return m + 1; } int main() { for (int i = 1; i < 1000; i++) { tr[i] = tr[i - 1] + i; sq[i] = sq[i - 1] + tr[i]; } dpt1[0] = 0; dpb1[0] = true; dpt2[0] = 0; dpb2[0] = true; int n; while (cin >> n, n) { cout << dp1(n) << " " << dp2(n) << endl; } return 0; }
#include <iostream> using namespace std; int dpt1[1000001]; int dpt2[1000001]; bool dpb1[1000001]; bool dpb2[1000001]; int tr[1000]; int sq[1000]; int dp1(int s) { if (dpb1[s]) return dpt1[s]; int m = 1000111000; int r; for (int i = 1; i < 1000; i++) { if (s - sq[i] < 0) break; r = dp1(s - sq[i]); if (r < m) m = r; } dpt1[s] = m + 1; dpb1[s] = true; return m + 1; } int dp2(int s) { if (dpb2[s]) return dpt2[s]; int m = 1000111000; int r; for (int i = 1; i < 1000; i++) { if (s - sq[i] < 0) break; if (sq[i] % 2 == 0) continue; r = dp2(s - sq[i]); if (r < m) m = r; } dpt2[s] = m + 1; dpb2[s] = true; return m + 1; } int main() { for (int i = 1; i < 1000; i++) { tr[i] = tr[i - 1] + i; sq[i] = sq[i - 1] + tr[i]; } dpt1[0] = 0; dpb1[0] = true; dpt2[0] = 0; dpb2[0] = true; int n; for (int i = 1; i <= 1000000; i++) dp1(i), dp2(i); while (cin >> n, n) { cout << dp1(n) << " " << dp2(n) << endl; } return 0; }
insert
61
61
61
63
0
p00748
C++
Runtime Error
#include <algorithm> #include <iostream> #define INF 1 << 28 using namespace std; int p[222]; int memo[1000001]; int memo2[1000001]; int solve(int n) { if (!n) return 0; if (memo[n]) return memo[n]; int ans = INF; for (int i = 1; p[i] <= n; i++) ans = min(ans, solve(n - p[i]) + 1); return memo[n] = ans; } int solve2(int n) { if (!n) return 0; if (memo2[n]) return memo2[n]; int ans = INF; for (int i = 1; p[i] <= n; i++) { if (p[i] & 1) ans = min(ans, solve2(n - p[i]) + 1); } return memo2[n] = ans; } int main() { int n; for (int i = 0; i <= 181; i++) p[i] = i * (i + 1) * (i + 2) / 6; // for(int i=1;i<=1000000;i++) solve(i), solve2(i); while (cin >> n, n) cout << solve(n) << " " << solve2(n) << endl; }
#include <algorithm> #include <iostream> #define INF 1 << 28 using namespace std; int p[222]; int memo[1000001]; int memo2[1000001]; int solve(int n) { if (!n) return 0; if (memo[n]) return memo[n]; int ans = INF; for (int i = 1; p[i] <= n; i++) ans = min(ans, solve(n - p[i]) + 1); return memo[n] = ans; } int solve2(int n) { if (!n) return 0; if (memo2[n]) return memo2[n]; int ans = INF; for (int i = 1; p[i] <= n; i++) { if (p[i] & 1) ans = min(ans, solve2(n - p[i]) + 1); } return memo2[n] = ans; } int main() { int n; for (int i = 0; i <= 181; i++) p[i] = i * (i + 1) * (i + 2) / 6; for (int i = 1; i <= 1000000; i += 100) solve(i), solve2(i); while (cin >> n, n) cout << solve(n) << " " << solve2(n) << endl; }
replace
45
46
45
47
0
p00748
C++
Runtime Error
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, j, k) for (int i = (int)j; i < (int)k; i++) #define itrep(i, x) for (auto i = (x).begin(); i != (x).end(); i++) #define Sort(x) sort((x).begin(), (x).end()) #define all(x) (x).begin(), (x).end() #define fi first #define se second #define vec vector #define INF (int)1e9 #define INFL 1e18 #define MOD 1000000007 #define pb push_back #define MP make_pair #define PI 3.1415926535 typedef long long int ll; typedef std::pair<int, int> P; int D = 1; int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; using namespace std; int main() { vector<int> v, oddv; for (ll i = 1;; i++) { if (i * (i + 1) * (i + 2) / 6 <= 1000000) { v.pb(i * (i + 1) * (i + 2) / 6); } else break; } int ans1[1000010], ans2[1000010]; rep(i, 0, 1000010) ans1[i] = ans2[i] = INF; ans1[0] = 0; ans2[0] = 0; rep(i, 0, 1000000) { ans1[i] = i; ans2[i] = i; for (int j = 0; i >= v[j]; j++) { ans1[i] = min(ans1[i - v[j]] + 1, ans1[i]); if (v[j] % 2 == 1) ans2[i] = min(ans2[i], ans2[i - v[j]] + 1); } } int n; while (cin >> n && n) { cout << ans1[n] << " " << ans2[n] << endl; } return 0; }
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, j, k) for (int i = (int)j; i < (int)k; i++) #define itrep(i, x) for (auto i = (x).begin(); i != (x).end(); i++) #define Sort(x) sort((x).begin(), (x).end()) #define all(x) (x).begin(), (x).end() #define fi first #define se second #define vec vector #define INF (int)1e9 #define INFL 1e18 #define MOD 1000000007 #define pb push_back #define MP make_pair #define PI 3.1415926535 typedef long long int ll; typedef std::pair<int, int> P; int D = 1; int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; using namespace std; int main() { vector<int> v, oddv; for (ll i = 1;; i++) { if (i * (i + 1) * (i + 2) / 6 <= 2000000) { v.pb(i * (i + 1) * (i + 2) / 6); } else break; } int ans1[1000010], ans2[1000010]; rep(i, 0, 1000010) ans1[i] = ans2[i] = INF; ans1[0] = 0; ans2[0] = 0; rep(i, 0, 1000000) { ans1[i] = i; ans2[i] = i; for (int j = 0; i >= v[j]; j++) { ans1[i] = min(ans1[i - v[j]] + 1, ans1[i]); if (v[j] % 2 == 1) ans2[i] = min(ans2[i], ans2[i - v[j]] + 1); } } int n; while (cin >> n && n) { cout << ans1[n] << " " << ans2[n] << endl; } return 0; }
replace
35
36
35
36
TLE
p00748
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #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 #define all(in) in.begin(), in.end() #define shosu(x) fixed << setprecision(x) #define show1d(v) \ rep(i, v.size()) cout << " " << v[i]; \ cout << endl; #define show2d(v) \ rep(i, v.size()) { \ rep(j, v[i].size()) cout << " " << v[i][j]; \ cout << endl; \ } \ cout << endl; using namespace std; typedef long long ll; typedef int Def; typedef pair<Def, Def> pii; typedef vector<Def> vi; typedef vector<vi> vvi; typedef vector<pii> vp; typedef vector<string> vs; int dx[] = {0, 1, 0, -1}; int dy[] = {1, 0, -1, 0}; Def inf = sizeof(Def) == sizeof(ll) ? 2e18 : 1e9 + 10; int main() { vi w; loop(i, 1, 200) if (i * (i + 1) * (i + 2) / 6 < 1000100) w.pb(i * (i + 1) * (i + 2) / 6); int n; while (cin >> n, n) { vi dp(n + 1, inf), dp2(n + 1, inf); dp[0] = dp2[0] = 0; rep(i, w.size()) rep(j, n) { int t = j + w[i]; if (t < n + 1) dp[t] = min(dp[t], dp[j] + 1); if (t < n + 1 && w[i] % 2) dp2[t] = min(dp2[t], dp2[j] + 1); } cout << dp[n] << " " << dp2[n] << endl; } }
#include <algorithm> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #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 #define all(in) in.begin(), in.end() #define shosu(x) fixed << setprecision(x) #define show1d(v) \ rep(i, v.size()) cout << " " << v[i]; \ cout << endl; #define show2d(v) \ rep(i, v.size()) { \ rep(j, v[i].size()) cout << " " << v[i][j]; \ cout << endl; \ } \ cout << endl; using namespace std; typedef long long ll; typedef int Def; typedef pair<Def, Def> pii; typedef vector<Def> vi; typedef vector<vi> vvi; typedef vector<pii> vp; typedef vector<string> vs; int dx[] = {0, 1, 0, -1}; int dy[] = {1, 0, -1, 0}; Def inf = sizeof(Def) == sizeof(ll) ? 2e18 : 1e9 + 10; int main() { vi w; loop(i, 1, 200) if (i * (i + 1) * (i + 2) / 6 < 1000100) w.pb(i * (i + 1) * (i + 2) / 6); const int n = 1000100; vi dp(n + 1, inf), dp2(n + 1, inf); dp[0] = dp2[0] = 0; rep(i, w.size()) rep(j, n) { int t = j + w[i]; if (t < n + 1) dp[t] = min(dp[t], dp[j] + 1); if (t < n + 1 && w[i] % 2) dp2[t] = min(dp2[t], dp2[j] + 1); } int m; while (cin >> m, m) { cout << dp[m] << " " << dp2[m] << endl; } }
replace
40
53
40
53
TLE
p00748
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int dp[2][1000001]; int f(int n) { return n * (n + 1) * (n + 2) / 6; } int main() { int n; for (int k = 0; k < 2; k++) fill(dp[k], dp[k] + 1000001, 1000000); dp[0][0] = dp[1][0] = 0; for (int i = 1; i <= n; i++) { for (int k = 1;; k++) { int num = f(k); if (i - num >= 0) { dp[0][i] = min(dp[0][i], dp[0][i - num] + 1); if ((num % 2) == 1) { dp[1][i] = min(dp[1][i], dp[1][i - num] + 1); } } else { break; } } } while (cin >> n && n) { cout << dp[0][n] << " " << dp[1][n] << endl; } }
#include <algorithm> #include <iostream> using namespace std; int dp[2][1000001]; int f(int n) { return n * (n + 1) * (n + 2) / 6; } int main() { int n; for (int k = 0; k < 2; k++) fill(dp[k], dp[k] + 1000001, 1000000); dp[0][0] = dp[1][0] = 0; for (int i = 1; i <= 1000000; i++) { for (int k = 1;; k++) { int num = f(k); if (i - num >= 0) { dp[0][i] = min(dp[0][i], dp[0][i - num] + 1); if ((num % 2) == 1) { dp[1][i] = min(dp[1][i], dp[1][i - num] + 1); } } else { break; } } } while (cin >> n && n) { cout << dp[0][n] << " " << dp[1][n] << endl; } }
replace
14
15
14
15
TLE
p00748
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; const int MAX = 100010; vector<int> tetras; vector<int> oddTetras; int dp[MAX]; int oddDp[MAX]; int main() { for (int i = 1; i < 200; i++) { int n = i * (i + 1) * (i + 2) / 6; tetras.push_back(n); if (n % 2 == 1) oddTetras.push_back(n); } for (int i = 0; i < MAX; i++) { dp[i] = oddDp[i] = i; } for (int i = 1; i < MAX; i++) { for (int j = 0; tetras[j] <= i; j++) { dp[i] = min(dp[i], dp[i - tetras[j]] + 1); } for (int j = 0; oddTetras[j] <= i; j++) { oddDp[i] = min(oddDp[i], oddDp[i - oddTetras[j]] + 1); } } int n; while (cin >> n, n != 0) { cout << dp[n] << " " << oddDp[n] << endl; } }
#include <algorithm> #include <iostream> #include <vector> using namespace std; const int MAX = 1000100; vector<int> tetras; vector<int> oddTetras; int dp[MAX]; int oddDp[MAX]; int main() { for (int i = 1; i < 200; i++) { int n = i * (i + 1) * (i + 2) / 6; tetras.push_back(n); if (n % 2 == 1) oddTetras.push_back(n); } for (int i = 0; i < MAX; i++) { dp[i] = oddDp[i] = i; } for (int i = 1; i < MAX; i++) { for (int j = 0; tetras[j] <= i; j++) { dp[i] = min(dp[i], dp[i - tetras[j]] + 1); } for (int j = 0; oddTetras[j] <= i; j++) { oddDp[i] = min(oddDp[i], oddDp[i - oddTetras[j]] + 1); } } int n; while (cin >> n, n != 0) { cout << dp[n] << " " << oddDp[n] << endl; } }
replace
5
6
5
6
0
p00748
C++
Runtime Error
#include <algorithm> #include <cstdlib> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <time.h> #include <vector> #define REP(i, N) for (ll i = 0; i < N; ++i) #define FOR(i, a, b) for (ll i = a; i < b; ++i) #define ALL(a) (a).begin(), (a).end() #define pb push_back #define INF 1000000000 #define MOD 1000000007 using namespace std; typedef long long ll; typedef pair<ll, ll> P; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int qx[8] = {1, 1, 0, -1, -1, -1, 0, 1}; int qy[8] = {0, 1, 1, 1, 0, -1, -1, -1}; vector<ll> p; vector<ll> o; vector<ll> memo(1000001, INF); ll cal(ll n) { if (memo[n] != INF) return memo[n]; else { ll ans = INF; ll i = o.size() - 1; while (i >= 0) { ans = min(ans, 1 + cal(n - o[i])); --i; } return memo[n] = ans; } } int main(void) { for (ll i = 0; i * (i + 1) * (i + 2) / 6 <= 1000000; ++i) { p.pb(i * (i + 1) * (i + 2) / 6); if ((i * (i + 1) * (i + 2) / 6) % 2 == 1) o.pb(i * (i + 1) * (i + 2) / 6); } vector<P> nf; map<ll, ll> nb; REP(i, p.size()) { REP(j, p.size()) { if (p[i] + p[j] > 1000000) continue; nf.pb(P(p[i] + p[j], (ll)(p[i] != 0) + (ll)(p[j] != 0))); REP(k, p.size()) { if (nb.count(p[i] + p[j] + p[k]) != 0) nb[p[i] + p[j] + p[k]] = min(nb[p[i] + p[j] + p[k]], (ll)(p[i] != 0) + (ll)(p[j] != 0) + (ll)(p[k] != 0)); else nb[p[i] + p[j] + p[k]] = (ll)(p[i] != 0) + (ll)(p[j] != 0) + (ll)(p[k] != 0); } } } memo[0] = 0; REP(i, o.size()) { memo[o[i]] = 1; } while (true) { ll n; cin >> n; if (n == 0) break; ll ans1 = INF, ans2 = INF; REP(i, nf.size()) { if (nb.count(n - nf[i].first) != 0) { ans1 = min(ans1, nf[i].second + nb[n - nf[i].first]); } } ans2 = cal(n); cout << ans1 << " " << ans2 << endl; } }
#include <algorithm> #include <cstdlib> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <time.h> #include <vector> #define REP(i, N) for (ll i = 0; i < N; ++i) #define FOR(i, a, b) for (ll i = a; i < b; ++i) #define ALL(a) (a).begin(), (a).end() #define pb push_back #define INF 1000000000 #define MOD 1000000007 using namespace std; typedef long long ll; typedef pair<ll, ll> P; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int qx[8] = {1, 1, 0, -1, -1, -1, 0, 1}; int qy[8] = {0, 1, 1, 1, 0, -1, -1, -1}; vector<ll> p; vector<ll> o; vector<ll> memo(1000001, INF); ll cal(ll n) { if (memo[n] != INF) return memo[n]; else { ll ans = INF; ll i = o.size() - 1; while (i >= 0) { if (n - o[i] > 0) ans = min(ans, 1 + cal(n - o[i])); --i; } return memo[n] = ans; } } int main(void) { for (ll i = 0; i * (i + 1) * (i + 2) / 6 <= 1000000; ++i) { p.pb(i * (i + 1) * (i + 2) / 6); if ((i * (i + 1) * (i + 2) / 6) % 2 == 1) o.pb(i * (i + 1) * (i + 2) / 6); } vector<P> nf; map<ll, ll> nb; REP(i, p.size()) { REP(j, p.size()) { if (p[i] + p[j] > 1000000) continue; nf.pb(P(p[i] + p[j], (ll)(p[i] != 0) + (ll)(p[j] != 0))); REP(k, p.size()) { if (nb.count(p[i] + p[j] + p[k]) != 0) nb[p[i] + p[j] + p[k]] = min(nb[p[i] + p[j] + p[k]], (ll)(p[i] != 0) + (ll)(p[j] != 0) + (ll)(p[k] != 0)); else nb[p[i] + p[j] + p[k]] = (ll)(p[i] != 0) + (ll)(p[j] != 0) + (ll)(p[k] != 0); } } } memo[0] = 0; REP(i, o.size()) { memo[o[i]] = 1; } while (true) { ll n; cin >> n; if (n == 0) break; ll ans1 = INF, ans2 = INF; REP(i, nf.size()) { if (nb.count(n - nf[i].first) != 0) { ans1 = min(ans1, nf[i].second + nb[n - nf[i].first]); } } ans2 = cal(n); cout << ans1 << " " << ans2 << endl; } }
replace
40
41
40
42
TLE
p00748
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) // #define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i) #define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort(ALL(c)) #define RSORT(c) sort(RALL(c)) #define SQ(n) (n) * (n) #define BIT(x, i) (((x) >> (i)) & 1) typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<char> vc; typedef vector<pii> vpi; typedef vector<pll> vpl; typedef vector<ll> vll; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vc> vvc; typedef vector<vll> vvll; const int INF = (int)1e9; int main() { vi pollock; for (int i = 0, v; (v = i * (i + 1) * (i + 2) / 6) <= 1000000; i++) { pollock.push_back(v); } vi dpall(100001, INF); vi dpodd(100001, INF); dpall[0] = dpodd[0] = 0; for (auto m : pollock) { for (int i = 0; i + m < dpall.size(); i++) { dpall[i + m] = min(dpall[i + m], dpall[i] + 1); } if (m % 2 == 1) { for (int i = 0; i + m < dpodd.size(); i++) { dpodd[i + m] = min(dpodd[i + m], dpodd[i] + 1); } } } int n; while (cin >> n, n) { printf("%d %d\n", dpall[n], dpodd[n]); } }
#include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) // #define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i) #define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort(ALL(c)) #define RSORT(c) sort(RALL(c)) #define SQ(n) (n) * (n) #define BIT(x, i) (((x) >> (i)) & 1) typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<char> vc; typedef vector<pii> vpi; typedef vector<pll> vpl; typedef vector<ll> vll; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vc> vvc; typedef vector<vll> vvll; const int INF = (int)1e9; int main() { vi pollock; for (int i = 0, v; (v = i * (i + 1) * (i + 2) / 6) <= 1000000; i++) { pollock.push_back(v); } vi dpall(1000001, INF); vi dpodd(1000001, INF); dpall[0] = dpodd[0] = 0; for (auto m : pollock) { for (int i = 0; i + m < dpall.size(); i++) { dpall[i + m] = min(dpall[i + m], dpall[i] + 1); } if (m % 2 == 1) { for (int i = 0; i + m < dpodd.size(); i++) { dpodd[i + m] = min(dpodd[i + m], dpodd[i] + 1); } } } int n; while (cin >> n, n) { printf("%d %d\n", dpall[n], dpodd[n]); } }
replace
41
43
41
43
0
p00748
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <utility> #define pi 3.14159 #define Inf (int)pow(2., 12.) using namespace std; typedef std::pair<int, int> mypair; queue<mypair> qu; #define M 1000000 int odd[M], all[M]; void update(int *ar, int x) { for (int i = x; i <= M; ++i) { ar[i] = min(ar[i], ar[i - x] + 1); } } int main() { odd[0] = all[0] = 0; for (int i = 1; i <= M; ++i) { odd[i] = all[i] = 10000000; } for (int i = 1;; ++i) { int x = i * (i + 1) * (i + 2) / 6; if (x > M) break; update(all, x); if (x % 2 == 1) update(odd, x); } int n; while (1) { cin >> n; if (n == 0) break; cout << all[n] << " " << odd[n] << endl; } }
#include <algorithm> #include <cstdio> #include <iostream> #include <math.h> #include <queue> #include <stdio.h> #include <string> #include <utility> #define pi 3.14159 #define Inf (int)pow(2., 12.) using namespace std; typedef std::pair<int, int> mypair; queue<mypair> qu; #define M 1000000 int odd[M + 10], all[M + 10]; void update(int *ar, int x) { for (int i = x; i <= M; ++i) { ar[i] = min(ar[i], ar[i - x] + 1); } } int main() { odd[0] = all[0] = 0; for (int i = 1; i <= M; ++i) { odd[i] = all[i] = 10000000; } for (int i = 1;; ++i) { int x = i * (i + 1) * (i + 2) / 6; if (x > M) break; update(all, x); if (x % 2 == 1) update(odd, x); } int n; while (1) { cin >> n; if (n == 0) break; cout << all[n] << " " << odd[n] << endl; } }
replace
16
17
16
17
0
p00748
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int all[1000001]; int odd[1000001]; int const INF = 1 << 29; int main() { fill(all, all + 1000001, INF); fill(odd, odd + 1000001, INF); all[0] = odd[0] = 0; for (int i = 1;; i++) { int n = i * (i + 1) * (i + 2); for (int j = n; j <= 1000000; j++) { all[j] = min(all[j - n] + 1, all[j]); if (n % 2) { odd[j] = min(odd[j - n] + 1, odd[j]); } } } int N; while (cin >> N && N) { cout << all[N] << ' ' << odd[N] << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int all[1000001]; int odd[1000001]; int const INF = 1 << 29; int main() { fill(all, all + 1000001, INF); fill(odd, odd + 1000001, INF); all[0] = odd[0] = 0; for (int i = 1;; i++) { int n = i * (i + 1) * (i + 2) / 6; if (n > 1000000) break; for (int j = n; j <= 1000000; j++) { all[j] = min(all[j - n] + 1, all[j]); if (n % 2) { odd[j] = min(odd[j - n] + 1, odd[j]); } } } int N; while (cin >> N && N) { cout << all[N] << ' ' << odd[N] << endl; } return 0; }
replace
17
18
17
20
-11
p00748
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back typedef long long ll; typedef pair<int, int> pint; int a[201]; int dp1[1000001], dp2[1000001]; int main() { FOR(i, 1, 201) { a[i - 1] = i * (i + 1) * (i + 2) / 6; } int n; while (cin >> n, n) { rep(i, n + 1) dp1[i] = dp2[i] = 1000100010; dp1[n] = 0, dp2[n] = 0; rep(i, 200) for (int j = n; j >= 0; --j) { if (j >= a[199 - i]) dp1[j - a[199 - i]] = min(dp1[j - a[199 - i]], dp1[j] + 1); if (j >= a[199 - i] && a[199 - i] % 2 == 1) dp2[j - a[199 - i]] = min(dp2[j - a[199 - i]], dp2[j] + 1); } cout << dp1[0] << " " << dp2[0] << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define pb emplace_back typedef long long ll; typedef pair<int, int> pint; int a[201]; int dp1[1000001], dp2[1000001]; int main() { FOR(i, 1, 201) { a[i - 1] = i * (i + 1) * (i + 2) / 6; } int n; while (cin >> n, n) { rep(i, n + 1) dp1[i] = dp2[i] = 1000100010; dp1[n] = 0, dp2[n] = 0; rep(i, 200) for (int j = n; j >= a[199 - i]; --j) { dp1[j - a[199 - i]] = min(dp1[j - a[199 - i]], dp1[j] + 1); if (a[199 - i] % 2 == 1) dp2[j - a[199 - i]] = min(dp2[j - a[199 - i]], dp2[j] + 1); } cout << dp1[0] << " " << dp2[0] << endl; } return 0; }
replace
16
20
16
19
TLE
p00748
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "../dump.hpp" #else #define dump(...) #endif #define rep(i, n) for (ll i = 0, i##_cond = (n); i < i##_cond; ++i) #define FOR(i, a, b) for (ll i = (a), i##_cond = (b); i < i##_cond; ++i) #define ROF(i, a, b) for (ll i = (a)-1, i##_cond = (b); i >= i##_cond; --i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() // sortで大きい順 #define UNIQUE(v) v.erase(unique(all(v)), v.end()) #define SUM(a) accumulate(all(a), 0) #define sz(x) ((ll)(x).size()) #define pb push_back #define fst first #define snd second #define mp make_pair typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<ll, ll> pii; const ll inf = 1ll << 62; const ll mod = 1e9 + 7; #define n 1000000 int main() { #define int ll int tmp = 1; vi a, b; while (1) { int x = tmp * (tmp + 1) * (tmp + 2) / 6; if (x >= 1000000) break; a.pb(x); if (x & 1) b.pb(x); tmp++; } dump(a, b); vi dpa(n + 1, inf), dpb(n + 1, inf); dpa[0] = 0; dpb[0] = 0; rep(i, n) { for (int j = 0; a[j] <= i + 1; ++j) for (int k = 1; a[j] * k <= i + 1; ++k) dpa[i + 1] = min(dpa[i + 1], dpa[i + 1 - k * a[j]] + k); for (int j = 0; b[j] <= i + 1; ++j) for (int k = 1; b[j] * k <= i + 1; ++k) dpb[i + 1] = min(dpb[i + 1], dpb[i + 1 - k * b[j]] + k); } while (1) { int m; cin >> m; if (m == 0) break; cout << dpa[m] << " " << dpb[m] << endl; } }
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "../dump.hpp" #else #define dump(...) #endif #define rep(i, n) for (ll i = 0, i##_cond = (n); i < i##_cond; ++i) #define FOR(i, a, b) for (ll i = (a), i##_cond = (b); i < i##_cond; ++i) #define ROF(i, a, b) for (ll i = (a)-1, i##_cond = (b); i >= i##_cond; --i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() // sortで大きい順 #define UNIQUE(v) v.erase(unique(all(v)), v.end()) #define SUM(a) accumulate(all(a), 0) #define sz(x) ((ll)(x).size()) #define pb push_back #define fst first #define snd second #define mp make_pair typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<ll, ll> pii; const ll inf = 1ll << 62; const ll mod = 1e9 + 7; #define n 1000000 int main() { #define int ll int tmp = 1; vi a, b; while (1) { int x = tmp * (tmp + 1) * (tmp + 2) / 6; if (x >= 1000000) break; a.pb(x); if (x & 1) b.pb(x); tmp++; } dump(a, b); vi dpa(n + 1, inf), dpb(n + 1, inf); dpa[0] = 0; dpb[0] = 0; rep(i, n) { for (int j = 0; j < sz(a) and a[j] <= i + 1; ++j) dpa[i + 1] = min(dpa[i + 1], dpa[i + 1 - a[j]] + 1); for (int j = 0; j < sz(b) and b[j] <= i + 1; ++j) dpb[i + 1] = min(dpb[i + 1], dpb[i + 1 - b[j]] + 1); } while (1) { int m; cin >> m; if (m == 0) break; cout << dpa[m] << " " << dpb[m] << endl; } }
replace
52
58
52
56
TLE
p00748
C++
Runtime Error
#include <iostream> #include <utility> #include <vector> using namespace std; int main(int argc, char *argv[]) { const int N = 100001; vector<int> full(N); vector<int> odd(N); for (int i = 0; i < N; i++) full[i] = i; for (int i = 0; i < N; i++) odd[i] = i; for (int n = 2;; n++) { const int t = (n * (n + 1) * (n + 2)) / 6; if (t >= N) break; for (int i = 0; i + t < N; i++) { const int k = i + t; if (full[i] + 1 < full[k]) full[k] = full[i] + 1; if (t & 1) { if (odd[i] + 1 < odd[k]) odd[k] = odd[i] + 1; } } } for (int t = 1;; t++) { int n; cin >> n; if (n == 0) break; cout << full[n] << " " << odd[n] << endl; } return 0; }
#include <iostream> #include <utility> #include <vector> using namespace std; int main(int argc, char *argv[]) { const int N = 1000001; vector<int> full(N); vector<int> odd(N); for (int i = 0; i < N; i++) full[i] = i; for (int i = 0; i < N; i++) odd[i] = i; for (int n = 2;; n++) { const int t = (n * (n + 1) * (n + 2)) / 6; if (t >= N) break; for (int i = 0; i + t < N; i++) { const int k = i + t; if (full[i] + 1 < full[k]) full[k] = full[i] + 1; if (t & 1) { if (odd[i] + 1 < odd[k]) odd[k] = odd[i] + 1; } } } for (int t = 1;; t++) { int n; cin >> n; if (n == 0) break; cout << full[n] << " " << odd[n] << endl; } return 0; }
replace
5
6
5
6
0
p00748
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using lint = long long; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); constexpr int N = 1e4; V<> a, b; for (int i = 1;; ++i) { a.push_back(i * (i + 1) * (i + 2) / 6); if (a.back() >= N) { a.pop_back(); break; } if (a.back() & 1) b.push_back(a.back()); } V<> p(N, -1), q(N, -1); p[0] = q[0] = 0; queue<int> que; que.push(0); while (!que.empty()) { int i = que.front(); que.pop(); for (int e : a) if (i + e < N and p[i + e] == -1) { p[i + e] = p[i] + 1; que.push(i + e); } } que.push(0); while (!que.empty()) { int i = que.front(); que.pop(); for (int e : b) if (i + e < N and q[i + e] == -1) { q[i + e] = q[i] + 1; que.push(i + e); } } while (true) { int n; cin >> n; if (!n) break; cout << p[n] << ' ' << q[n] << '\n'; } }
#include <bits/stdc++.h> using namespace std; using lint = long long; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); constexpr int N = 1e6; V<> a, b; for (int i = 1;; ++i) { a.push_back(i * (i + 1) * (i + 2) / 6); if (a.back() >= N) { a.pop_back(); break; } if (a.back() & 1) b.push_back(a.back()); } V<> p(N, -1), q(N, -1); p[0] = q[0] = 0; queue<int> que; que.push(0); while (!que.empty()) { int i = que.front(); que.pop(); for (int e : a) if (i + e < N and p[i + e] == -1) { p[i + e] = p[i] + 1; que.push(i + e); } } que.push(0); while (!que.empty()) { int i = que.front(); que.pop(); for (int e : b) if (i + e < N and q[i + e] == -1) { q[i + e] = q[i] + 1; que.push(i + e); } } while (true) { int n; cin >> n; if (!n) break; cout << p[n] << ' ' << q[n] << '\n'; } }
replace
9
10
9
10
0
p00748
C++
Runtime Error
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; const int MAX_N = 1e6; vector<int> dp1, dp2; vector<int> tetra; int main(void) { int n = 1; do { tetra.push_back(n * (n + 1) * (n + 2) / 6); ++n; } while (tetra.back() <= MAX_N); dp1.push_back(0); dp2.push_back(0); for (int i = 1; i <= n; ++i) { int a1 = INT_MAX, a2 = INT_MAX; for (int t : tetra) { if (t > i) break; a1 = min(a1, dp1[i - t] + 1); if (t % 2) { a2 = min(a2, dp2[i - t] + 1); } } dp1.push_back(a1); dp2.push_back(a2); } int x; while (cin >> x, x) { cout << dp1[x] << " " << dp2[x] << endl; } return 0; }
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> using namespace std; const int MAX_N = 1e6; vector<int> dp1, dp2; vector<int> tetra; int main(void) { int n = 1; do { tetra.push_back(n * (n + 1) * (n + 2) / 6); ++n; } while (tetra.back() <= MAX_N); dp1.push_back(0); dp2.push_back(0); for (int i = 1; i <= MAX_N; ++i) { int a1 = INT_MAX, a2 = INT_MAX; for (int t : tetra) { if (t > i) break; a1 = min(a1, dp1[i - t] + 1); if (t % 2) { a2 = min(a2, dp2[i - t] + 1); } } dp1.push_back(a1); dp2.push_back(a2); } int x; while (cin >> x, x) { cout << dp1[x] << " " << dp2[x] << endl; } return 0; }
replace
36
37
36
37
0
p00748
C++
Runtime Error
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> #include <string> #include <utility> #include <vector> #define INF 1e9 #define llINF 9223372036854775807 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long using namespace std; int main() { int dp[1000010] = {}; int dp2[1000010] = {}; for (int i = 1; i <= 1000000; i++) { dp[i] = INF; dp2[i] = INF; } vector<ll> gu; vector<ll> ki; ll cnt = 1; while (1) { if ((cnt * (cnt + 1) * (cnt + 2) / 6) > 1000000) break; if (((cnt * (cnt + 1) * (cnt + 2)) / 6) % 2) { ki.pb(cnt * (cnt + 1) * (cnt + 2) / 6); dp[ki[ki.size() - 1]] = 1; dp2[gu[gu.size() - 1]] = 1; } else { gu.pb(cnt * (cnt + 1) * (cnt + 2) / 6); dp[gu[gu.size() - 1]] = 1; } cnt++; } dp[1] = 1; dp2[1] = 1; for (int i = 1; i < 1000000; i++) { for (int j = 0; j < gu.size(); j++) { if (i + gu[j] > 1000000) break; dp[i + gu[j]] = min(dp[i + gu[j]], (dp[i] + 1)); } for (int j = 0; j < ki.size(); j++) { if (i + ki[j] > 1000000) break; dp[i + ki[j]] = min(dp[i + ki[j]], (dp[i] + 1)); dp2[i + ki[j]] = min(dp2[i + ki[j]], (dp2[i] + 1)); } } int n; while (cin >> n, n) { cout << dp[n] << " " << dp2[n] << endl; } return 0; }
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> #include <string> #include <utility> #include <vector> #define INF 1e9 #define llINF 9223372036854775807 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long using namespace std; int main() { int dp[1000010] = {}; int dp2[1000010] = {}; for (int i = 1; i <= 1000000; i++) { dp[i] = INF; dp2[i] = INF; } vector<ll> gu; vector<ll> ki; ll cnt = 1; while (1) { if ((cnt * (cnt + 1) * (cnt + 2) / 6) > 1000000) break; if (((cnt * (cnt + 1) * (cnt + 2)) / 6) % 2) { ki.pb(cnt * (cnt + 1) * (cnt + 2) / 6); dp[ki[ki.size() - 1]] = 1; dp2[ki[ki.size() - 1]] = 1; } else { gu.pb(cnt * (cnt + 1) * (cnt + 2) / 6); dp[gu[gu.size() - 1]] = 1; } cnt++; } dp[1] = 1; dp2[1] = 1; for (int i = 1; i < 1000000; i++) { for (int j = 0; j < gu.size(); j++) { if (i + gu[j] > 1000000) break; dp[i + gu[j]] = min(dp[i + gu[j]], (dp[i] + 1)); } for (int j = 0; j < ki.size(); j++) { if (i + ki[j] > 1000000) break; dp[i + ki[j]] = min(dp[i + ki[j]], (dp[i] + 1)); dp2[i + ki[j]] = min(dp2[i + ki[j]], (dp2[i] + 1)); } } int n; while (cin >> n, n) { cout << dp[n] << " " << dp2[n] << endl; } return 0; }
replace
36
37
36
37
-11
p00748
C++
Runtime Error
#include <iostream> using namespace std; int main() { int num[1000010], num2[1000010]; for (int i = 0; i < 1000010; i++) num[i] = num2[i] = 10e8; num[0] = num2[0] = 0; for (int j = 0; j < 1000010; j++) { for (int i = 0; i < 1500; i++) { int m = i * (i + 1) * (i + 2) / 6; if (1000010 <= m + j) continue; num[j + m] = min(num[j] + 1, num[j + m]); if (m == 0) continue; if (m % 2 == 0) continue; num2[j + m] = min(num2[j] + 1, num2[j + m]); } } int n; while (cin >> n, n) { cout << num[n] << " " << num2[n] << endl; } }
#include <iostream> using namespace std; int main() { int num[1000010], num2[1000010]; for (int i = 0; i < 1000010; i++) num[i] = num2[i] = 10e8; num[0] = num2[0] = 0; for (int j = 0; j < 1000010; j++) { for (int i = 0; i < 1200; i++) { int m = i * (i + 1) * (i + 2) / 6; if (1000010 <= m + j) continue; num[j + m] = min(num[j] + 1, num[j + m]); if (m == 0) continue; if (m % 2 == 0) continue; num2[j + m] = min(num2[j] + 1, num2[j + m]); } } int n; while (cin >> n, n) { cout << num[n] << " " << num2[n] << endl; } }
replace
9
10
9
10
-11
p00748
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define repc(i, s, e) for (int i = (s); i < (e); i++) #define pb(n) push_back((n)) #define mp(n, m) make_pair((n), (m)) #define all(r) r.begin(), r.end() #define fi first #define se second typedef long long ll; typedef vector<int> vi; typedef vector<vi> vii; typedef vector<ll> vl; typedef vector<vl> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<int, pii> pip; const int INF = 1000000; const double EPS = 1e-8; const int mod = 1e9 + 7; int dp[1000010]; int dp2[1000010]; int main() { int a = 1, b; vi v; vi u; while ((b = a * (a + 1) * (a + 2) / 6) < 1e6) { v.pb(b); if (b % 2 == 1) { u.pb(b); } a++; } // cout<<v.size()<<endl; for (int i = 0; i < 1000010; i++) { dp[i] = INF; dp2[i] = INF; } dp[0] = 0; dp2[0] = 0; for (int i = 0; i < v.size(); i++) { for (int j = v[i]; j < 1000010; j++) { dp[j] = min(dp[j], dp[j - v[i]] + 1); if (i < u.size()) { dp2[j] = min(dp2[j], dp2[j - u[i]] + 1); } } } // cout<<"OK"<<endl; int n; while (cin >> n && n > 0) { cout << dp[n] << " " << dp2[n] << endl; } }
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define repc(i, s, e) for (int i = (s); i < (e); i++) #define pb(n) push_back((n)) #define mp(n, m) make_pair((n), (m)) #define all(r) r.begin(), r.end() #define fi first #define se second typedef long long ll; typedef vector<int> vi; typedef vector<vi> vii; typedef vector<ll> vl; typedef vector<vl> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<int, pii> pip; const int INF = 1000000; const double EPS = 1e-8; const int mod = 1e9 + 7; int dp[1000010]; int dp2[1000010]; int main() { int a = 1, b; vi v; vi u; while ((b = a * (a + 1) * (a + 2) / 6) < 1e6) { v.pb(b); if (b % 2 == 1) { u.pb(b); } a++; } // cout<<v.size()<<endl; for (int i = 0; i < 1000010; i++) { dp[i] = INF; dp2[i] = INF; } dp[0] = 0; dp2[0] = 0; for (int i = 0; i < v.size(); i++) { for (int j = v[i]; j < 1000010; j++) { dp[j] = min(dp[j], dp[j - v[i]] + 1); if (i < u.size() && j >= u[i]) { dp2[j] = min(dp2[j], dp2[j - u[i]] + 1); } } } // cout<<"OK"<<endl; int n; while (cin >> n && n > 0) { cout << dp[n] << " " << dp2[n] << endl; } }
replace
65
66
65
66
TLE
p00749
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define repr(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define rep(i, n) repl(i, 0, n) #define each(itr, v) for (auto itr : v) #define pb(s) push_back(s) #define all(x) (x).begin(), (x).end() #define dbg(x) cout << #x " = " << x << endl #define print(x) cout << x << endl #define maxch(x, y) x = max(x, y) #define minch(x, y) x = min(x, y) #define uni(x) x.erase(unique(all(x)), x.end()) #define exist(x, y) (find(all(x), y) != x.end()) #define bcnt(x) bitset<32>(x).count() typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<double, int> PD; typedef pair<P, int> PPI; typedef pair<int, P> PIP; typedef pair<ll, ll> PL; typedef pair<P, ll> PPL; typedef set<int> S; #define INF INT_MAX / 3 #define MAX_N 1000000001 struct Piece { double gx; int xl, xr; }; int w, h; string s[60]; int dd[] = {1, 0, -1, 0, 1}; int on[100][100]; bool visited[60][10]; int panel[60][10]; Piece v[60]; bool stable; double gx; int num; bool range(int x, int y) { return 0 <= x && x < w && 0 <= y && y < h; } void search(int y, int x, char c, int num) { panel[y][x] = num; visited[y][x] = true; v[num].gx += x + 0.5; if (y == h - 1) minch(v[num].xl, x), maxch(v[num].xr, x + 1); rep(i, 4) { int yy = y + dd[i], xx = x + dd[i + 1]; if (range(xx, yy) && s[yy][xx] == c && !visited[yy][xx]) { search(yy, xx, c, num); } } } void on_search(int y, int x, int num) { visited[y][x] = true; rep(i, 4) { int yy = y + dd[i], xx = x + dd[i + 1]; if (range(xx, yy)) { if (i == 2 && panel[yy][xx] != num && panel[yy][xx] >= 0) on[num][panel[yy][xx]] = 1; if (i == 0 && panel[yy][xx] != num && panel[yy][xx] >= 0) { minch(v[num].xl, x), maxch(v[num].xr, x + 1); } if (!visited[yy][xx] && panel[yy][xx] == num) on_search(yy, xx, num); } } } void calc(int i, int size) { gx += v[i].gx, num++; rep(j, size) if (on[i][j]) calc(j, size); } bool centerGrabity(int i, int size) { gx = num = 0; calc(i, size); double g = gx / (num * 4); return (v[i].xl < g && g < v[i].xr); } int main() { cin.sync_with_stdio(false); while (cin >> w >> h, w | h) { rep(i, h) cin >> s[i]; rep(i, h) rep(j, w) panel[i][j] = -1, visited[i][j] = false; rep(i, 100) rep(j, 100) on[i][j] = 0; int idx = 0; repr(i, h) { rep(j, w) { if (s[i][j] != '.' && panel[i][j] == -1) { Piece p = Piece{0.0, INF, -1}; v[idx] = p; search(i, j, s[i][j], idx); idx++; } } } rep(i, h) rep(j, w) visited[i][j] = false; rep(i, h) rep(j, w) if (s[i][j] != '.' && !visited[i][j]) on_search(i, j, panel[i][j]); stable = true; rep(i, idx) stable &= centerGrabity(i, idx); cout << ((stable) ? "STABLE" : "UNSTABLE") << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define repr(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define rep(i, n) repl(i, 0, n) #define each(itr, v) for (auto itr : v) #define pb(s) push_back(s) #define all(x) (x).begin(), (x).end() #define dbg(x) cout << #x " = " << x << endl #define print(x) cout << x << endl #define maxch(x, y) x = max(x, y) #define minch(x, y) x = min(x, y) #define uni(x) x.erase(unique(all(x)), x.end()) #define exist(x, y) (find(all(x), y) != x.end()) #define bcnt(x) bitset<32>(x).count() typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<double, int> PD; typedef pair<P, int> PPI; typedef pair<int, P> PIP; typedef pair<ll, ll> PL; typedef pair<P, ll> PPL; typedef set<int> S; #define INF INT_MAX / 3 #define MAX_N 1000000001 struct Piece { double gx; int xl, xr; }; int w, h; string s[60]; int dd[] = {1, 0, -1, 0, 1}; int on[100][100]; bool visited[60][10]; int panel[60][10]; Piece v[100]; bool stable; double gx; int num; bool range(int x, int y) { return 0 <= x && x < w && 0 <= y && y < h; } void search(int y, int x, char c, int num) { panel[y][x] = num; visited[y][x] = true; v[num].gx += x + 0.5; if (y == h - 1) minch(v[num].xl, x), maxch(v[num].xr, x + 1); rep(i, 4) { int yy = y + dd[i], xx = x + dd[i + 1]; if (range(xx, yy) && s[yy][xx] == c && !visited[yy][xx]) { search(yy, xx, c, num); } } } void on_search(int y, int x, int num) { visited[y][x] = true; rep(i, 4) { int yy = y + dd[i], xx = x + dd[i + 1]; if (range(xx, yy)) { if (i == 2 && panel[yy][xx] != num && panel[yy][xx] >= 0) on[num][panel[yy][xx]] = 1; if (i == 0 && panel[yy][xx] != num && panel[yy][xx] >= 0) { minch(v[num].xl, x), maxch(v[num].xr, x + 1); } if (!visited[yy][xx] && panel[yy][xx] == num) on_search(yy, xx, num); } } } void calc(int i, int size) { gx += v[i].gx, num++; rep(j, size) if (on[i][j]) calc(j, size); } bool centerGrabity(int i, int size) { gx = num = 0; calc(i, size); double g = gx / (num * 4); return (v[i].xl < g && g < v[i].xr); } int main() { cin.sync_with_stdio(false); while (cin >> w >> h, w | h) { rep(i, h) cin >> s[i]; rep(i, h) rep(j, w) panel[i][j] = -1, visited[i][j] = false; rep(i, 100) rep(j, 100) on[i][j] = 0; int idx = 0; repr(i, h) { rep(j, w) { if (s[i][j] != '.' && panel[i][j] == -1) { Piece p = Piece{0.0, INF, -1}; v[idx] = p; search(i, j, s[i][j], idx); idx++; } } } rep(i, h) rep(j, w) visited[i][j] = false; rep(i, h) rep(j, w) if (s[i][j] != '.' && !visited[i][j]) on_search(i, j, panel[i][j]); stable = true; rep(i, idx) stable &= centerGrabity(i, idx); cout << ((stable) ? "STABLE" : "UNSTABLE") << endl; } return 0; }
replace
43
44
43
44
0
p00749
C++
Memory Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; int w, h; struct node { vector<int> next; vector<pair<int, int>> blocks; double gx; double left; double right; int num; double weight; bool fl; }; void calc(vector<vector<int>> vec, vector<pair<int, int>> piece, map<pair<int, int>, int> mp, node &kubo, vector<node> &nodes) { if (kubo.fl == 1) return; vector<int> interval; for (int k = 0; k < 4; k++) { if (piece[k].first < h - 1) { if (vec[piece[k].first][piece[k].second] != vec[piece[k].first + 1][piece[k].second] && vec[piece[k].first + 1][piece[k].second] != 0) { interval.push_back(piece[k].second); } } } set<int> st; vector<int> ne; for (int k = 0; k < 4; k++) { if (piece[k].first > 0) { if (vec[piece[k].first][piece[k].second] != vec[piece[k].first - 1][piece[k].second] && vec[piece[k].first - 1][piece[k].second] != 0) { if (!st.count(mp[make_pair(piece[k].first - 1, piece[k].second)])) { ne.push_back(mp[make_pair(piece[k].first - 1, piece[k].second)]); st.insert(mp[make_pair(piece[k].first - 1, piece[k].second)]); } } } } kubo.next = ne; if (interval.size() > 0) { sort(interval.begin(), interval.end()); } else { for (int k = 0; k < w; k++) { if (vec[h - 1][k] != 0) { interval.push_back(k); } } sort(interval.begin(), interval.end()); } kubo.left = interval[0] - 0.5; kubo.right = interval[interval.size() - 1] + 0.5; double sum = 0; double sum_w = 0; if (kubo.next.size() == 0) { for (int k = 0; k < 4; k++) { sum += (double)piece[k].second; sum_w += 1; } kubo.weight = sum_w; kubo.gx = sum / sum_w; kubo.fl = 1; return; } for (int k = 0; k < kubo.next.size(); k++) { calc(vec, nodes[k].blocks, mp, nodes[k], nodes); sum += nodes[kubo.next[k]].weight * nodes[kubo.next[k]].gx; sum_w += nodes[kubo.next[k]].weight; } for (int k = 0; k < 4; k++) { sum += (double)piece[k].second; sum_w += 1; } kubo.weight = sum_w; kubo.gx = sum / sum_w; kubo.fl = 1; return; } int main() { string s; while (1) { cin >> w >> h; if (w == 0 && h == 0) break; vector<vector<int>> vec; for (int i = 0; i < h; i++) { cin >> s; vector<int> vec1; for (int j = 0; j < w; j++) { if (s[j] == '.') { vec1.push_back(0); } else { vec1.push_back(s[j] - '0'); } } vec.push_back(vec1); } vector<vector<int>> flag(h, vector<int>(w, 0)); vector<node> nodes; int node_num = 0; map<pair<int, int>, int> mp; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (vec[i][j] != 0 && flag[i][j] != 1) { vector<pair<int, int>> piece; queue<pair<int, int>> q; q.push(make_pair(i, j)); piece.push_back(make_pair(i, j)); flag[i][j] = 1; mp[make_pair(i, j)] = node_num; while (!q.empty()) { pair<int, int> p; p = q.front(); q.pop(); for (int k = 0; k < 4; k++) { if (p.first + dx[k] < 0 || p.first + dx[k] >= h || p.second + dy[k] < 0 || p.second + dy[k] >= w) continue; if (flag[p.first + dx[k]][p.second + dy[k]] == 0 && vec[p.first + dx[k]][p.second + dy[k]] == vec[p.first][p.second]) { q.push(make_pair(p.first + dx[k], p.second + dy[k])); flag[p.first + dx[k]][p.second + dy[k]] = 1; mp[make_pair(p.first + dx[k], p.second + dy[k])] = node_num; piece.push_back(make_pair(p.first + dx[k], p.second + dy[k])); } } } node kubo; kubo.blocks = piece; kubo.num = node_num; kubo.fl = 0; nodes.push_back(kubo); node_num += 1; } } } for (int i = 0; i < nodes.size(); i++) { calc(vec, nodes[i].blocks, mp, nodes[i], nodes); } bool ans = 0; for (int i = 0; i < nodes.size(); i++) { if (nodes[i].gx >= nodes[i].right || nodes[i].gx <= nodes[i].left) { ans = 1; } } if (ans == 0) cout << "STABLE" << endl; else cout << "UNSTABLE" << endl; } return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; int w, h; struct node { vector<int> next; vector<pair<int, int>> blocks; double gx; double left; double right; int num; double weight; bool fl; }; void calc(vector<vector<int>> vec, vector<pair<int, int>> piece, map<pair<int, int>, int> mp, node &kubo, vector<node> &nodes) { if (kubo.fl == 1) return; vector<int> interval; for (int k = 0; k < 4; k++) { if (piece[k].first < h - 1) { if (vec[piece[k].first][piece[k].second] != vec[piece[k].first + 1][piece[k].second] && vec[piece[k].first + 1][piece[k].second] != 0) { interval.push_back(piece[k].second); } } } set<int> st; vector<int> ne; for (int k = 0; k < 4; k++) { if (piece[k].first > 0) { if (vec[piece[k].first][piece[k].second] != vec[piece[k].first - 1][piece[k].second] && vec[piece[k].first - 1][piece[k].second] != 0) { if (!st.count(mp[make_pair(piece[k].first - 1, piece[k].second)])) { ne.push_back(mp[make_pair(piece[k].first - 1, piece[k].second)]); st.insert(mp[make_pair(piece[k].first - 1, piece[k].second)]); } } } } kubo.next = ne; if (interval.size() > 0) { sort(interval.begin(), interval.end()); } else { for (int k = 0; k < w; k++) { if (vec[h - 1][k] != 0) { interval.push_back(k); } } sort(interval.begin(), interval.end()); } kubo.left = interval[0] - 0.5; kubo.right = interval[interval.size() - 1] + 0.5; double sum = 0; double sum_w = 0; if (kubo.next.size() == 0) { for (int k = 0; k < 4; k++) { sum += (double)piece[k].second; sum_w += 1; } kubo.weight = sum_w; kubo.gx = sum / sum_w; kubo.fl = 1; return; } for (int k = 0; k < kubo.next.size(); k++) { calc(vec, nodes[kubo.next[k]].blocks, mp, nodes[kubo.next[k]], nodes); sum += nodes[kubo.next[k]].weight * nodes[kubo.next[k]].gx; sum_w += nodes[kubo.next[k]].weight; } for (int k = 0; k < 4; k++) { sum += (double)piece[k].second; sum_w += 1; } kubo.weight = sum_w; kubo.gx = sum / sum_w; kubo.fl = 1; return; } int main() { string s; while (1) { cin >> w >> h; if (w == 0 && h == 0) break; vector<vector<int>> vec; for (int i = 0; i < h; i++) { cin >> s; vector<int> vec1; for (int j = 0; j < w; j++) { if (s[j] == '.') { vec1.push_back(0); } else { vec1.push_back(s[j] - '0'); } } vec.push_back(vec1); } vector<vector<int>> flag(h, vector<int>(w, 0)); vector<node> nodes; int node_num = 0; map<pair<int, int>, int> mp; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (vec[i][j] != 0 && flag[i][j] != 1) { vector<pair<int, int>> piece; queue<pair<int, int>> q; q.push(make_pair(i, j)); piece.push_back(make_pair(i, j)); flag[i][j] = 1; mp[make_pair(i, j)] = node_num; while (!q.empty()) { pair<int, int> p; p = q.front(); q.pop(); for (int k = 0; k < 4; k++) { if (p.first + dx[k] < 0 || p.first + dx[k] >= h || p.second + dy[k] < 0 || p.second + dy[k] >= w) continue; if (flag[p.first + dx[k]][p.second + dy[k]] == 0 && vec[p.first + dx[k]][p.second + dy[k]] == vec[p.first][p.second]) { q.push(make_pair(p.first + dx[k], p.second + dy[k])); flag[p.first + dx[k]][p.second + dy[k]] = 1; mp[make_pair(p.first + dx[k], p.second + dy[k])] = node_num; piece.push_back(make_pair(p.first + dx[k], p.second + dy[k])); } } } node kubo; kubo.blocks = piece; kubo.num = node_num; kubo.fl = 0; nodes.push_back(kubo); node_num += 1; } } } for (int i = 0; i < nodes.size(); i++) { calc(vec, nodes[i].blocks, mp, nodes[i], nodes); } bool ans = 0; for (int i = 0; i < nodes.size(); i++) { if (nodes[i].gx >= nodes[i].right || nodes[i].gx <= nodes[i].left) { ans = 1; } } if (ans == 0) cout << "STABLE" << endl; else cout << "UNSTABLE" << endl; } return 0; }
replace
80
81
80
81
MLE
p00749
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #include <queue> using namespace std; char p[16][64]; bool visit[16][64]; int dy[] = {-1, 0, 1, 0}; int dx[] = {0, -1, 0, 1}; bool dfs(int y, int x, int &rn, int &rd) { int n = 0, d = 0; int xl = 100, xr = -100; char ch = p[y][x]; queue<int> q; q.push(y << 8 | x); visit[y][x] = true; while (!q.empty()) { y = q.front() >> 8; x = q.front() & 0xff; q.pop(); n += x; ++d; for (int i = 0; i < 4; ++i) { int ny = y + dy[i], nx = x + dx[i]; if (!visit[ny][nx] && p[ny][nx] == ch) { visit[ny][nx] = true; q.push(ny << 8 | nx); } } if (!visit[y - 1][x] && isdigit(p[y - 1][x])) { if (!dfs(y - 1, x, n, d)) { return false; } } if (p[y + 1][x] != ch) { if (p[y + 1][x] == '!' || isdigit(p[y + 1][x])) { xl = min(xl, x); xr = max(xr, x + 1); } } } rn += n; rd += d; // xl < n / d + 0.5 < xr return 2 * d * xl < 2 * n + d && 2 * n + d < 2 * d * xr; } int main() { int w, h; while (scanf("%d%d", &w, &h), w) { memset(p, '.', sizeof p); memset(p[h + 1], '!', sizeof p[h + 1]); memset(visit, 0, sizeof visit); for (int i = 1; i <= h; ++i) { scanf(" %s", p[i] + 1); } int x; for (x = 1; !isdigit(p[h][x]); ++x) ; int n = 0, d = 0; puts(dfs(h, x, n, d) ? "STABLE" : "UNSTABLE"); } }
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #include <queue> using namespace std; char p[64][16]; bool visit[64][16]; int dy[] = {-1, 0, 1, 0}; int dx[] = {0, -1, 0, 1}; bool dfs(int y, int x, int &rn, int &rd) { int n = 0, d = 0; int xl = 100, xr = -100; char ch = p[y][x]; queue<int> q; q.push(y << 8 | x); visit[y][x] = true; while (!q.empty()) { y = q.front() >> 8; x = q.front() & 0xff; q.pop(); n += x; ++d; for (int i = 0; i < 4; ++i) { int ny = y + dy[i], nx = x + dx[i]; if (!visit[ny][nx] && p[ny][nx] == ch) { visit[ny][nx] = true; q.push(ny << 8 | nx); } } if (!visit[y - 1][x] && isdigit(p[y - 1][x])) { if (!dfs(y - 1, x, n, d)) { return false; } } if (p[y + 1][x] != ch) { if (p[y + 1][x] == '!' || isdigit(p[y + 1][x])) { xl = min(xl, x); xr = max(xr, x + 1); } } } rn += n; rd += d; // xl < n / d + 0.5 < xr return 2 * d * xl < 2 * n + d && 2 * n + d < 2 * d * xr; } int main() { int w, h; while (scanf("%d%d", &w, &h), w) { memset(p, '.', sizeof p); memset(p[h + 1], '!', sizeof p[h + 1]); memset(visit, 0, sizeof visit); for (int i = 1; i <= h; ++i) { scanf(" %s", p[i] + 1); } int x; for (x = 1; !isdigit(p[h][x]); ++x) ; int n = 0, d = 0; puts(dfs(h, x, n, d) ? "STABLE" : "UNSTABLE"); } }
replace
7
9
7
9
0
p00749
C++
Runtime Error
#include <algorithm>/*{{{*/ #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long int LL; typedef complex<double> P; static const double PI(3.14159265358979323846); static const double EPS(1e-10); typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pii; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } #define FOR(i, b, e) for (typeof(b) i = (b); assert((i) <= (e)), i != (e); ++i) #define OPOVER(_op, _type) inline bool operator _op(const _type &t) const #define arrsz(a) (sizeof(a) / sizeof(a[0])) #define F first #define S second #define MP(a, b) make_pair(a, b) #define SZ(a) ((ll)a.size()) #define PB(e) push_back(e) #define SORT(v) sort((v).begin(), (v).end()) #define RSORT(v) sort((v).rbegin(), (v).rend()) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EACH(t, i, c) for (t::iterator i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define BIT(n) (1ULL << (n)) #define BITOF(n, m) ((n) >> (m)&1) #define RANGE(a, b, c) ((a) <= (b) && (b) <= (c)) #define DEBUG_ON_ #ifdef DEBUG_ON #define dprt(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__) #define darr(a) \ copy((a), (a) + arrsz(a), ostream_iterator<int>(cerr, " ")); \ cerr << endl #define darr_range(a, f, t) \ copy((a) + (f), (a) + (t), ostream_iterator<int>(cerr, " ")); \ cerr << endl #define dvec(v) \ copy(ALL(v), ostream_iterator<int>(cerr, " ")); \ cerr << endl #define darr2(a, n, m) \ FOR(i, 0, (n)) { darr_range((a)[i], 0, (m)); } #define dvec2(v) \ FOR(i, 0, SZ(v)) { dvec((v)[i]); } #define WAIT() \ { \ string _wait_; \ cerr << "(hit return to continue)" << endl; \ getline(cin, _wait_); \ } #else #define dprt(fmt, ...) #define darr(a) #define darr_range(a, f, t) #define dvec(v) #define darr2(a, n, m) #define dvec2(v) #define WAIT() #endif /*}}}*/ struct block { int x; int y; }; struct piece { int id; int xl; int xr; vector<block> blocks; vector<piece *> upper_pieces; }; int w, h; int field[10][60]; vector<piece> pieces; int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; void create_piece(piece *p, int y, int x) /*{{{*/ { int id = field[y][x]; field[y][x] = -p->id; block b; b.y = y; b.x = x; p->blocks.PB(b); FOR(d, 0, 4) { int yd = y + dy[d]; int xd = x + dx[d]; if (RANGE(0, yd, h - 1) && RANGE(0, xd, w - 1)) ; else continue; if (field[yd][xd] == id) { create_piece(p, yd, xd); } } } /*}}}*/ void search_piece() /*{{{*/ { int pnum = 0; FOR(i, 0, h) { FOR(j, 0, w) { if (RANGE('1', field[i][j], '9')) { piece p; p.id = pnum; create_piece(&p, i, j); pieces.PB(p); ++pnum; } } } set<int> done; FOR(i, 0, h) { FOR(j, 0, w) { if (field[i][j] <= 0 && !EXIST(done, field[i][j])) { done.insert(field[i][j]); int id = abs(field[i][j]); piece *p = &pieces[id]; // cerr << "check #" << p->id << endl; int lowest_y = -1; int xl = 100, xr = -100; FOR(i, 0, p->blocks.size()) { block b = p->blocks[i]; if (b.y == h - 1 || (field[b.y + 1][b.x] <= 0 && field[b.y + 1][b.x] != -p->id)) { xl = min(xl, b.x); xr = max(xr, b.x + 1); } p->xl = xl; p->xr = xr; if (b.y - 1 >= 0) { if (field[b.y - 1][b.x] <= 0 && abs(field[b.y - 1][b.x]) != p->id) { bool t = true; FOR(i, 0, p->upper_pieces.size()) { if (p->upper_pieces[i]->id == abs(field[b.y - 1][b.x])) { t = false; } } if (t) { // cerr << "append #" << pieces[abs(field[b.y-1][b.x])].id << " // to #" << p->id << "'s upper" << endl; p->upper_pieces.PB(&pieces[abs(field[b.y - 1][b.x])]); } } } } } } } } /*}}}*/ bool dfs(piece *p, vector<block> *blocks) { // cerr << endl << "check piece #" << abs(p->id) << endl; vector<block> upper_blocks; FOR(i, 0, p->upper_pieces.size()) { piece *up = p->upper_pieces[i]; // cerr << "#" << up->id << " is upper" << endl; if (!dfs(up, &upper_blocks)) { return false; } } // merge FOR(i, 0, p->blocks.size()) { upper_blocks.PB(p->blocks[i]); } double mx = 0, my = 0; FOR(i, 0, upper_blocks.size()) { block b = upper_blocks[i]; // cerr << "block at (" << b.x << ", " << b.y << ")" << endl; mx += b.x + 0.5; my += b.y + 0.5; } mx /= (double)upper_blocks.size(); my /= (double)upper_blocks.size(); // cerr << "xl: " << p->xl << ", xr: " << p->xr << ", mx: " << mx << endl; if (p->xl < mx && mx < p->xr) { FOR(i, 0, upper_blocks.size()) { (*blocks).PB(upper_blocks[i]); } // cerr << "#" << p->id << " is stable" << endl; return true; } else { return false; } } int main(int argc, char const *argv[]) { while (cin >> w >> h, w || h) { FOR(i, 0, pieces.size()) { pieces[i].blocks.clear(); pieces[i].upper_pieces.clear(); } pieces.clear(); FOR(i, 0, h) { FOR(j, 0, w) { char c; cin >> c; field[i][j] = c; } } search_piece(); int lowest = 0; FOR(i, 0, w) { if (field[h - 1][i] <= 0) { lowest = abs(field[h - 1][i]); break; } } // cerr << "lowest is #" << lowest << endl; vector<block> b; darr2(field, h, w); if (dfs(&pieces[lowest], &b)) { cout << "STABLE" << endl; } else { cout << "UNSTABLE" << endl; } } return 0; }
#include <algorithm>/*{{{*/ #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long int LL; typedef complex<double> P; static const double PI(3.14159265358979323846); static const double EPS(1e-10); typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<string> vs; typedef pair<int, int> pii; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } #define FOR(i, b, e) for (typeof(b) i = (b); assert((i) <= (e)), i != (e); ++i) #define OPOVER(_op, _type) inline bool operator _op(const _type &t) const #define arrsz(a) (sizeof(a) / sizeof(a[0])) #define F first #define S second #define MP(a, b) make_pair(a, b) #define SZ(a) ((ll)a.size()) #define PB(e) push_back(e) #define SORT(v) sort((v).begin(), (v).end()) #define RSORT(v) sort((v).rbegin(), (v).rend()) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EACH(t, i, c) for (t::iterator i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define BIT(n) (1ULL << (n)) #define BITOF(n, m) ((n) >> (m)&1) #define RANGE(a, b, c) ((a) <= (b) && (b) <= (c)) #define DEBUG_ON_ #ifdef DEBUG_ON #define dprt(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__) #define darr(a) \ copy((a), (a) + arrsz(a), ostream_iterator<int>(cerr, " ")); \ cerr << endl #define darr_range(a, f, t) \ copy((a) + (f), (a) + (t), ostream_iterator<int>(cerr, " ")); \ cerr << endl #define dvec(v) \ copy(ALL(v), ostream_iterator<int>(cerr, " ")); \ cerr << endl #define darr2(a, n, m) \ FOR(i, 0, (n)) { darr_range((a)[i], 0, (m)); } #define dvec2(v) \ FOR(i, 0, SZ(v)) { dvec((v)[i]); } #define WAIT() \ { \ string _wait_; \ cerr << "(hit return to continue)" << endl; \ getline(cin, _wait_); \ } #else #define dprt(fmt, ...) #define darr(a) #define darr_range(a, f, t) #define dvec(v) #define darr2(a, n, m) #define dvec2(v) #define WAIT() #endif /*}}}*/ struct block { int x; int y; }; struct piece { int id; int xl; int xr; vector<block> blocks; vector<piece *> upper_pieces; }; int w, h; int field[60][10]; vector<piece> pieces; int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; void create_piece(piece *p, int y, int x) /*{{{*/ { int id = field[y][x]; field[y][x] = -p->id; block b; b.y = y; b.x = x; p->blocks.PB(b); FOR(d, 0, 4) { int yd = y + dy[d]; int xd = x + dx[d]; if (RANGE(0, yd, h - 1) && RANGE(0, xd, w - 1)) ; else continue; if (field[yd][xd] == id) { create_piece(p, yd, xd); } } } /*}}}*/ void search_piece() /*{{{*/ { int pnum = 0; FOR(i, 0, h) { FOR(j, 0, w) { if (RANGE('1', field[i][j], '9')) { piece p; p.id = pnum; create_piece(&p, i, j); pieces.PB(p); ++pnum; } } } set<int> done; FOR(i, 0, h) { FOR(j, 0, w) { if (field[i][j] <= 0 && !EXIST(done, field[i][j])) { done.insert(field[i][j]); int id = abs(field[i][j]); piece *p = &pieces[id]; // cerr << "check #" << p->id << endl; int lowest_y = -1; int xl = 100, xr = -100; FOR(i, 0, p->blocks.size()) { block b = p->blocks[i]; if (b.y == h - 1 || (field[b.y + 1][b.x] <= 0 && field[b.y + 1][b.x] != -p->id)) { xl = min(xl, b.x); xr = max(xr, b.x + 1); } p->xl = xl; p->xr = xr; if (b.y - 1 >= 0) { if (field[b.y - 1][b.x] <= 0 && abs(field[b.y - 1][b.x]) != p->id) { bool t = true; FOR(i, 0, p->upper_pieces.size()) { if (p->upper_pieces[i]->id == abs(field[b.y - 1][b.x])) { t = false; } } if (t) { // cerr << "append #" << pieces[abs(field[b.y-1][b.x])].id << " // to #" << p->id << "'s upper" << endl; p->upper_pieces.PB(&pieces[abs(field[b.y - 1][b.x])]); } } } } } } } } /*}}}*/ bool dfs(piece *p, vector<block> *blocks) { // cerr << endl << "check piece #" << abs(p->id) << endl; vector<block> upper_blocks; FOR(i, 0, p->upper_pieces.size()) { piece *up = p->upper_pieces[i]; // cerr << "#" << up->id << " is upper" << endl; if (!dfs(up, &upper_blocks)) { return false; } } // merge FOR(i, 0, p->blocks.size()) { upper_blocks.PB(p->blocks[i]); } double mx = 0, my = 0; FOR(i, 0, upper_blocks.size()) { block b = upper_blocks[i]; // cerr << "block at (" << b.x << ", " << b.y << ")" << endl; mx += b.x + 0.5; my += b.y + 0.5; } mx /= (double)upper_blocks.size(); my /= (double)upper_blocks.size(); // cerr << "xl: " << p->xl << ", xr: " << p->xr << ", mx: " << mx << endl; if (p->xl < mx && mx < p->xr) { FOR(i, 0, upper_blocks.size()) { (*blocks).PB(upper_blocks[i]); } // cerr << "#" << p->id << " is stable" << endl; return true; } else { return false; } } int main(int argc, char const *argv[]) { while (cin >> w >> h, w || h) { FOR(i, 0, pieces.size()) { pieces[i].blocks.clear(); pieces[i].upper_pieces.clear(); } pieces.clear(); FOR(i, 0, h) { FOR(j, 0, w) { char c; cin >> c; field[i][j] = c; } } search_piece(); int lowest = 0; FOR(i, 0, w) { if (field[h - 1][i] <= 0) { lowest = abs(field[h - 1][i]); break; } } // cerr << "lowest is #" << lowest << endl; vector<block> b; darr2(field, h, w); if (dfs(&pieces[lowest], &b)) { cout << "STABLE" << endl; } else { cout << "UNSTABLE" << endl; } } return 0; }
replace
119
120
119
120
0
p00750
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < b; i++) using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } //--------------------------------------------------------------------------------------------------- /*--------------------------------------------------------------------------------------------------- ????????????????????????????????? ??§?????§ ??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space! ???????????? ??? ?´_???`??????/??? ???i ?????????????????????????????? ??? |???| ????????? /?????? /??£??£??£??£/??????| ??? ???_(__??????/??? ???/ .| .|???????????? ??? ????????????/????????????/??????u?????? ---------------------------------------------------------------------------------------------------*/ #define INF "#" int N, A, S, G, X[401], Y[401]; string LAB[401]; string ans[401]; //--------------------------------------------------------------------------------------------------- void sol() { rep(i, 0, A) cin >> X[i] >> Y[i] >> LAB[i]; vector<string> v; rep(i, 0, A) v.push_back(LAB[i]); rep(i, 0, N) ans[i] = INF; ans[G] = ""; rep(i, 0, N * 6) rep(j, 0, A) { int a = X[j], b = Y[j]; if (ans[b] == INF) continue; if (ans[a] == INF) ans[a] = LAB[j] + ans[b]; else { string aa = ans[a], bb = LAB[j] + ans[b]; if (bb < aa) { ans[a] = bb; } } } string pre = ans[S]; rep(i, 0, N * 6) rep(j, 0, A) { int a = X[j], b = Y[j]; if (ans[b] == INF) continue; if (ans[a] == INF) ans[a] = LAB[j] + ans[b]; else { string aa = ans[a], bb = LAB[j] + ans[b]; if (bb < aa) { ans[a] = bb; } } } if (ans[S] < pre || ans[S] == INF) { printf("NO\n"); return; } printf("%s\n", ans[S].c_str()); } //--------------------------------------------------------------------------------------------------- void _main() { int t = 1; while (cin >> N >> A >> S >> G) { if (N == 0) return; sol(); fprintf(stderr, "Finish : %d\n", t); t++; } }
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < b; i++) using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); } //--------------------------------------------------------------------------------------------------- /*--------------------------------------------------------------------------------------------------- ????????????????????????????????? ??§?????§ ??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space! ???????????? ??? ?´_???`??????/??? ???i ?????????????????????????????? ??? |???| ????????? /?????? /??£??£??£??£/??????| ??? ???_(__??????/??? ???/ .| .|???????????? ??? ????????????/????????????/??????u?????? ---------------------------------------------------------------------------------------------------*/ #define INF "#" int N, A, S, G, X[401], Y[401]; string LAB[401]; string ans[401]; //--------------------------------------------------------------------------------------------------- void sol() { rep(i, 0, A) cin >> X[i] >> Y[i] >> LAB[i]; vector<string> v; rep(i, 0, A) v.push_back(LAB[i]); rep(i, 0, N) ans[i] = INF; ans[G] = ""; rep(i, 0, N * 6) rep(j, 0, A) { int a = X[j], b = Y[j]; if (ans[b] == INF) continue; if (ans[a] == INF) ans[a] = LAB[j] + ans[b]; else { string aa = ans[a], bb = LAB[j] + ans[b]; if (bb < aa) { ans[a] = bb; } } } string pre = ans[S]; rep(i, 0, N * 6) rep(j, 0, A) { int a = X[j], b = Y[j]; if (ans[b] == INF) continue; if (ans[a] == INF) ans[a] = LAB[j] + ans[b]; else { string aa = ans[a], bb = LAB[j] + ans[b]; if (bb < aa) { ans[a] = bb; } } } if (ans[S] < pre || ans[S] == INF) { printf("NO\n"); return; } printf("%s\n", ans[S].c_str()); } //--------------------------------------------------------------------------------------------------- void _main() { int t = 1; while (cin >> N >> A >> S >> G) { if (N == 0) return; sol(); // fprintf(stderr, "Finish : %d\n", t); t++; } }
replace
79
81
79
80
0
Finish : 1 Finish : 2 Finish : 3 Finish : 4
p00750
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define LOG(...) printf(__VA_ARGS__) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) #define RSORT(c) sort((c).rbegin(), (c).rend()) #define CLR(a) memset((a), 0, sizeof(a)) #define WRAP(y, x, h, w) (0 <= y && y < h && 0 <= x && x < w) typedef long long ll; typedef unsigned long long ull; typedef string str; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<double> vd; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vll> vvll; typedef vector<vd> vvd; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; int main() { int n, m, start, goal; while (cin >> n >> m >> start >> goal, n | m | start | goal) { vector<vector<string>> DP(n, vector<string>(500, "~")); vector<vector<pair<string, int>>> E(n); REP(i, m) { int x, y; string s; cin >> x >> y >> s; E[x].push_back({s, y}); } bool clear = false; string ans; priority_queue<pair<string, int>, vector<pair<string, int>>, greater<pair<string, int>>> Q; Q.push({"", start}); DP[start][0] = ""; while (!Q.empty()) { pair<string, int> q = Q.top(); Q.pop(); if (q.first.length() > 500) { continue; } if (q.second == goal) { if ((q.first.length() < 400)) clear = true; ans = q.first; break; } REP(i, E[q.second].size()) { if (DP[E[q.second][i].second] [q.first.length() + E[q.second][i].first.length()] > q.first + E[q.second][i].first) { DP[E[q.second][i].second] [q.first.length() + E[q.second][i].first.length()] = q.first + E[q.second][i].first; Q.push({q.first + E[q.second][i].first, E[q.second][i].second}); } } } if (!clear) { cout << "NO" << endl; } else { cout << ans << endl; } } return 0; }
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define LOG(...) printf(__VA_ARGS__) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) #define RSORT(c) sort((c).rbegin(), (c).rend()) #define CLR(a) memset((a), 0, sizeof(a)) #define WRAP(y, x, h, w) (0 <= y && y < h && 0 <= x && x < w) typedef long long ll; typedef unsigned long long ull; typedef string str; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<double> vd; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vll> vvll; typedef vector<vd> vvd; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; int main() { int n, m, start, goal; while (cin >> n >> m >> start >> goal, n | m | start | goal) { vector<vector<string>> DP(n, vector<string>(500, "~")); vector<vector<pair<string, int>>> E(n); REP(i, m) { int x, y; string s; cin >> x >> y >> s; E[x].push_back({s, y}); } bool clear = false; string ans; priority_queue<pair<string, int>, vector<pair<string, int>>, greater<pair<string, int>>> Q; Q.push({"", start}); DP[start][0] = ""; while (!Q.empty()) { pair<string, int> q = Q.top(); Q.pop(); if (q.first.length() > 500) { continue; } if (q.second == goal) { if ((q.first.length() < 400)) clear = true; ans = q.first; break; } REP(i, E[q.second].size()) { if (q.first.length() + E[q.second][i].first.length() >= 500) continue; if (DP[E[q.second][i].second] [q.first.length() + E[q.second][i].first.length()] > q.first + E[q.second][i].first) { DP[E[q.second][i].second] [q.first.length() + E[q.second][i].first.length()] = q.first + E[q.second][i].first; Q.push({q.first + E[q.second][i].first, E[q.second][i].second}); } } } if (!clear) { cout << "NO" << endl; } else { cout << ans << endl; } } return 0; }
insert
79
79
79
81
-11
p00750
C++
Runtime Error
#include <fstream> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define MAX (6 * N) class Node { public: vector<int> to; vector<string> sp; Node() {} }; class State { public: int p; string str; State(int p, string str) : p(p), str(str) {} bool operator<(const State &s) const { return str > s.str; } }; int main() { ifstream cin("E1.txt"); ofstream cout("out.txt"); int N, A, S, G; while (cin >> N >> A >> S >> G, (N || A || S || G)) { Node node[45]; for (int i = 0; i < A; i++) { int s, d; string str; cin >> s >> d >> str; node[s].to.push_back(d); node[s].sp.push_back(str); } bool v[40][500] = {0}; priority_queue<State> q; q.push(State(S, "")); bool g = false; while (!q.empty()) { State s = q.top(); q.pop(); if (v[s.p][s.str.size()]) continue; v[s.p][s.str.size()] = 1; if (s.p == G) { if (s.str.size() > MAX) break; g = true; cout << s.str << endl; break; } for (int i = 0; i < node[s.p].to.size(); i++) { int next = node[s.p].to[i]; string spl = node[s.p].sp[i]; if (s.str.size() + spl.size() > MAX * 2) continue; if (v[next][s.str.size() + spl.size()]) continue; q.push(State(next, s.str + spl)); } } if (!g) cout << "NO" << endl; } }
#include <fstream> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define MAX (6 * N) class Node { public: vector<int> to; vector<string> sp; Node() {} }; class State { public: int p; string str; State(int p, string str) : p(p), str(str) {} bool operator<(const State &s) const { return str > s.str; } }; int main() { // ifstream cin("E1.txt"); // ofstream cout("out.txt"); int N, A, S, G; while (cin >> N >> A >> S >> G, (N || A || S || G)) { Node node[45]; for (int i = 0; i < A; i++) { int s, d; string str; cin >> s >> d >> str; node[s].to.push_back(d); node[s].sp.push_back(str); } bool v[40][500] = {0}; priority_queue<State> q; q.push(State(S, "")); bool g = false; while (!q.empty()) { State s = q.top(); q.pop(); if (v[s.p][s.str.size()]) continue; v[s.p][s.str.size()] = 1; if (s.p == G) { if (s.str.size() > MAX) break; g = true; cout << s.str << endl; break; } for (int i = 0; i < node[s.p].to.size(); i++) { int next = node[s.p].to[i]; string spl = node[s.p].sp[i]; if (s.str.size() + spl.size() > MAX * 2) continue; if (v[next][s.str.size() + spl.size()]) continue; q.push(State(next, s.str + spl)); } } if (!g) cout << "NO" << endl; } }
replace
27
29
27
29
0
p00750
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for ((i) = 0; (i) < (int)(n); (i)++) #define foreach(itr, c) \ for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); itr++) template <class T> void pp(T a, T b) { for (T i = a; i != b; ++i) cout << *i << ' '; cout << endl; } #define INF "|" struct Edge { int from, to; string cost; Edge(int from_, int to_, string cost_) { from = from_; to = to_; cost = cost_; } Edge() { from = to = 0; cost = ""; } }; int n, a, s, g; Edge edge[410]; string d[50]; int main() { int i; while (1) { scanf("%d %d %d %d", &n, &a, &s, &g); if (n == 0 && a == 0 && s == 0 && g == 0) break; rep(i, a) { int from, to; string cost; // cin >> from >> to >> cost; cin >> to >> from >> cost; Edge e(from, to, cost); edge[i] = e; } rep(i, n) d[i] = INF; d[g] = ""; int count = 0, cc = 0; while (1) { bool update = false; rep(i, a) { Edge e = edge[i]; if (d[e.from] != INF && d[e.to] > e.cost + d[e.from]) { // d[0] > d[0] + "a" // cout << d[e.to]<< ' ' << d[e.from] << ' ' << e.cost << endl; d[e.to] = e.cost + d[e.from]; update = true; if (e.to == s && count >= n + 1) cc++; } } count++; if (cc >= 1) break; if (count >= 1000) break; if (!update) break; } cout << ((d[s] == "|" || cc >= 1) ? "NO" : d[s]) << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for ((i) = 0; (i) < (int)(n); (i)++) #define foreach(itr, c) \ for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); itr++) template <class T> void pp(T a, T b) { for (T i = a; i != b; ++i) cout << *i << ' '; cout << endl; } #define INF "|" struct Edge { int from, to; string cost; Edge(int from_, int to_, string cost_) { from = from_; to = to_; cost = cost_; } Edge() { from = to = 0; cost = ""; } }; int n, a, s, g; Edge edge[410]; string d[50]; int main() { int i; while (1) { scanf("%d %d %d %d", &n, &a, &s, &g); if (n == 0 && a == 0 && s == 0 && g == 0) break; rep(i, a) { int from, to; string cost; // cin >> from >> to >> cost; cin >> to >> from >> cost; Edge e(from, to, cost); edge[i] = e; } rep(i, n) d[i] = INF; d[g] = ""; int count = 0, cc = 0; while (1) { bool update = false; rep(i, a) { Edge e = edge[i]; if (d[e.from] != INF && d[e.to] > e.cost + d[e.from]) { // d[0] > d[0] + "a" // cout << d[e.to]<< ' ' << d[e.from] << ' ' << e.cost << endl; d[e.to] = e.cost + d[e.from]; update = true; if (e.to == s && count >= n + 1) cc++; } } count++; if (cc >= 1) break; if (count >= 500) break; if (!update) break; } cout << ((d[s] == "|" || cc >= 1) ? "NO" : d[s]) << endl; } return 0; }
replace
81
82
81
82
TLE
p00752
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; double eps = 1e-8; bool eq(double a, double b) { return (-eps < a - b && a - b < eps); } bool eq(P a, P b) { return (abs(a - b) < eps); } double dot(P a, P b) { return real(b * conj(a)); } double cross(P a, P b) { return imag(b * conj(a)); } bool isParallel(P a, P b) { return eq(cross(a, b), 0); } struct S { P p, q; S(P a = P(0, 0), P b = P(0, 0)) : p(a), q(b) {} P base() { return q - p; } }; typedef S L; double getDistanceLP(L l, P p) { P a = l.p, b = l.q; return abs(cross(b - a, p - a)) / abs(b - a); } double getDistanceSP(S s, P p) { P a = s.p; P b = s.q; if (dot(b - a, p - a) < eps) return abs(p - a); if (dot(a - b, p - b) < eps) return abs(p - b); return getDistanceLP(s, p); } P reflect(S s, P p) { P a = s.p; P b = s.q; p -= a; b -= a; return a + conj(p / b) * b; } bool onLine(L l, P p) { P a = l.p; P b = l.q; return eq(0, cross(p - a, b - a)); } bool onSegment(S s, P p) { P a = s.p; P b = s.q; return eq(abs(a - b), abs(p - a) + abs(p - b)); } P getCrossPoint(S s1, S s2) { P a = s1.p, b = s1.q; P c = s2.p, d = s2.q; a -= d, b -= d, c -= d; return d + a + (b - a) * imag(a / c) / imag(a / c - b / c); } bool isIntersectLS(L li, S se) { P a = li.p; P b = li.q; double A = cross(b - a, se.p - a); double B = cross(b - a, se.q - a); if (A * B < eps) return true; } P input() { double x, y; cin >> x >> y; return P(x, y); } int N; S t[5]; P si, ti; int tl[10]; double ans; double calc(P p, P v, int depth) { if (eq(p, ti)) return 0; P np, nv; if (depth > 6) return 1e20; double mini = 1e20; for (int i = 0; i < N; i++) { S seg = t[i]; if (onSegment(seg, p)) continue; L li = L(p, p + v); if (!isIntersectLS(li, seg)) continue; P k = getCrossPoint(li, seg); assert(onSegment(seg, k)); assert(onLine(li, k)); /* cout<<"i="<<i<<endl; cout<<"k="<<k<<endl; cout<<"v="<<v<<endl; cout<<"p="<<p<<endl; cout<<endl; */ if (dot(k - p, v) < 0) continue; if (mini > abs(k - p)) { mini = abs(k - p); np = k; nv = reflect(seg, k + v) - k; } } if (isParallel(v, ti - p) && dot(v, ti - p) > 0) { if (mini > abs(ti - p)) { return abs(ti - p); } } if (mini == 1e20) return 1e20; return mini + calc(np, nv, depth + 1); } P ansve; void check(int size, P target) { P v = target - si; if (abs(v) < eps) return; double dist = calc(si, v, 0); if (ans > dist) { ans = dist; ansve = v; } } void dfs(int depth, P target) { check(depth, target); if (depth == 6) return; for (int i = 0; i < N; i++) { dfs(depth + 1, reflect(t[i], target)); } } int main() { while (1) { cin >> N; if (N == 0) break; for (int i = 0; i < N; i++) { P a = input(); P b = input(); t[i] = S(a, b); } ti = input(); si = input(); ans = 1e20; dfs(0, ti); printf("%.10f\n", ans); } return 0; }
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; double eps = 1e-8; bool eq(double a, double b) { return (-eps < a - b && a - b < eps); } bool eq(P a, P b) { return (abs(a - b) < eps); } double dot(P a, P b) { return real(b * conj(a)); } double cross(P a, P b) { return imag(b * conj(a)); } bool isParallel(P a, P b) { return eq(cross(a, b), 0); } struct S { P p, q; S(P a = P(0, 0), P b = P(0, 0)) : p(a), q(b) {} P base() { return q - p; } }; typedef S L; double getDistanceLP(L l, P p) { P a = l.p, b = l.q; return abs(cross(b - a, p - a)) / abs(b - a); } double getDistanceSP(S s, P p) { P a = s.p; P b = s.q; if (dot(b - a, p - a) < eps) return abs(p - a); if (dot(a - b, p - b) < eps) return abs(p - b); return getDistanceLP(s, p); } P reflect(S s, P p) { P a = s.p; P b = s.q; p -= a; b -= a; return a + conj(p / b) * b; } bool onLine(L l, P p) { P a = l.p; P b = l.q; return eq(0, cross(p - a, b - a)); } bool onSegment(S s, P p) { P a = s.p; P b = s.q; return eq(abs(a - b), abs(p - a) + abs(p - b)); } P getCrossPoint(S s1, S s2) { P a = s1.p, b = s1.q; P c = s2.p, d = s2.q; a -= d, b -= d, c -= d; return d + a + (b - a) * imag(a / c) / imag(a / c - b / c); } bool isIntersectLS(L li, S se) { P a = li.p; P b = li.q; double A = cross(b - a, se.p - a); double B = cross(b - a, se.q - a); return (A * B < eps); } P input() { double x, y; cin >> x >> y; return P(x, y); } int N; S t[5]; P si, ti; int tl[10]; double ans; double calc(P p, P v, int depth) { if (eq(p, ti)) return 0; P np, nv; if (depth > 6) return 1e20; double mini = 1e20; for (int i = 0; i < N; i++) { S seg = t[i]; if (onSegment(seg, p)) continue; L li = L(p, p + v); if (!isIntersectLS(li, seg)) continue; P k = getCrossPoint(li, seg); assert(onSegment(seg, k)); assert(onLine(li, k)); /* cout<<"i="<<i<<endl; cout<<"k="<<k<<endl; cout<<"v="<<v<<endl; cout<<"p="<<p<<endl; cout<<endl; */ if (dot(k - p, v) < 0) continue; if (mini > abs(k - p)) { mini = abs(k - p); np = k; nv = reflect(seg, k + v) - k; } } if (isParallel(v, ti - p) && dot(v, ti - p) > 0) { if (mini > abs(ti - p)) { return abs(ti - p); } } if (mini == 1e20) return 1e20; return mini + calc(np, nv, depth + 1); } P ansve; void check(int size, P target) { P v = target - si; if (abs(v) < eps) return; double dist = calc(si, v, 0); if (ans > dist) { ans = dist; ansve = v; } } void dfs(int depth, P target) { check(depth, target); if (depth == 6) return; for (int i = 0; i < N; i++) { dfs(depth + 1, reflect(t[i], target)); } } int main() { while (1) { cin >> N; if (N == 0) break; for (int i = 0; i < N; i++) { P a = input(); P b = input(); t[i] = S(a, b); } ti = input(); si = input(); ans = 1e20; dfs(0, ti); printf("%.10f\n", ans); } return 0; }
replace
71
73
71
72
-6
8f9f62b6-27d5-484a-a174-141eb9b7f3c9.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00752/C++/s688975210.cpp:113: double calc(P, P, int): Assertion `onSegment(seg,k)' failed.
p00752
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <vector> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) #define inf (1 << 29) #define EPS (1e-5) #define COUNTER_CLOCKWISE 1 #define CLOCKWISE -1 #define ONLINE_BACK 2 #define ONLINE_FRONT -2 #define ON_SEGMENT 0 #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; // class Point { public: double x, y; Point(double x = -inf, double y = -inf) : x(x), y(y) {} Point operator+(Point p) { return Point(x + p.x, y + p.y); } Point operator-(Point p) { return Point(x - p.x, y - p.y); } Point operator*(double a) { return Point(a * x, a * y); } Point operator/(double a) { return Point(x / a, y / a); } bool operator<(const Point &p) const { return !equals(x, p.x) ? x < p.x : y < p.y; } bool operator==(const Point &p) const { return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS; } }; struct Segment { Point p1, p2; Segment(Point p1 = Point(-inf, -inf), Point p2 = Point(-inf, -inf)) : p1(p1), p2(p2) {} bool operator==(const Segment &p) const { return p.p1 == p1 && p.p2 == p2; } }; typedef Point Vector; typedef Segment Line; typedef vector<Point> Polygon; ostream &operator<<(ostream &os, const Point &a) { os << "(" << a.x << "," << a.y << ")"; } ostream &operator<<(ostream &os, const Segment &a) { os << "( " << a.p1 << " , " << a.p2 << " )"; } double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; } double cross(Point a, Point b) { return a.x * b.y - a.y * b.x; } double norm(Point a) { return a.x * a.x + a.y * a.y; } double abs(Point a) { return sqrt(norm(a)); } // rad は角度をラジアンで持たせること Point rotate(Point a, double rad) { return Point(cos(rad) * a.x - sin(rad) * a.y, sin(rad) * a.x + cos(rad) * a.y); } // 度をラジアンに変換 double toRad(double agl) { return agl * M_PI / 180.0; } int ccw(Point p0, Point p1, Point p2) { Point a = p1 - p0; Point b = p2 - p0; if (cross(a, b) > EPS) return COUNTER_CLOCKWISE; if (cross(a, b) < -EPS) return CLOCKWISE; if (dot(a, b) < -EPS) return ONLINE_BACK; if (norm(a) < norm(b)) return ONLINE_FRONT; return ON_SEGMENT; } bool intersectLL(Line l, Line m) { return abs(cross(l.p2 - l.p1, m.p2 - m.p1)) > EPS || // non-parallel abs(cross(l.p2 - l.p1, m.p1 - l.p1)) < EPS; // same line } bool intersectLS(Line l, Line s) { return cross(l.p2 - l.p1, s.p1 - l.p1) * // s[0] is left of l cross(l.p2 - l.p1, s.p2 - l.p1) < EPS; // s[1] is right of l } bool intersectLP(Line l, Point p) { return abs(cross(l.p2 - p, l.p1 - p)) < EPS; } bool intersectSS(Line s, Line t) { return ccw(s.p1, s.p2, t.p1) * ccw(s.p1, s.p2, t.p2) <= 0 && ccw(t.p1, t.p2, s.p1) * ccw(t.p1, t.p2, s.p2) <= 0; } bool intersectSP(Line s, Point p) { return abs(s.p1 - p) + abs(s.p2 - p) - abs(s.p2 - s.p1) < EPS; // triangle inequality } Point projection(Line l, Point p) { double t = dot(p - l.p1, l.p1 - l.p2) / norm(l.p1 - l.p2); return l.p1 + (l.p1 - l.p2) * t; } Point reflection(Line l, Point p) { return p + (projection(l, p) - p) * 2; } double distanceLP(Line l, Point p) { return abs(p - projection(l, p)); } double distanceLL(Line l, Line m) { return intersectLL(l, m) ? 0 : distanceLP(l, m.p1); } double distanceLS(Line l, Line s) { if (intersectLS(l, s)) return 0; return min(distanceLP(l, s.p1), distanceLP(l, s.p2)); } double distanceSP(Line s, Point p) { Point r = projection(s, p); if (intersectSP(s, r)) return abs(r - p); return min(abs(s.p1 - p), abs(s.p2 - p)); } double distanceSS(Line s, Line t) { if (intersectSS(s, t)) return 0; return min(min(distanceSP(s, t.p1), distanceSP(s, t.p2)), min(distanceSP(t, s.p1), distanceSP(t, s.p2))); } Point crosspoint(Line l, Line m) { double A = cross(l.p2 - l.p1, m.p2 - m.p1); double B = cross(l.p2 - l.p1, l.p2 - m.p1); if (abs(A) < EPS && abs(B) < EPS) return m.p1; // same line if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!! return m.p1 + (m.p2 - m.p1) * (B / A); } // int n; vector<Segment> seg; Point s, t; double compute(double rad) { Point e = Point(cos(rad), sin(rad)); e = e * 1000; e = e + s; Segment UruruBeam = Segment(s, e); double ret = 0; Point sp; int onSeg = -1; sp = s; rep(i, 6) { double mdist = inf; Point mcp; int mp = -1; rep(j, n) if (onSeg != j && intersectSS(UruruBeam, seg[j])) { Point cp = crosspoint(UruruBeam, seg[j]); double dist = abs(sp - cp); if (!equals(mdist, dist) && mdist > dist) { mdist = dist; mcp = cp; mp = j; } } if (intersectSP(UruruBeam, t)) { double dist = abs(sp - t); if (!equals(mdist, dist) && mdist > dist) return ret + dist; } if (mp == -1) return inf; onSeg = mp; ret += abs(sp - mcp); UruruBeam = Segment(mcp, reflection(seg[mp], UruruBeam.p2)); sp = mcp; } return inf; } int main() { while (scanf("%d", &n), n) { seg.clear(); seg.resize(n); rep(i, n) scanf("%lf %lf %lf %lf", &seg[i].p1.x, &seg[i].p1.y, &seg[i].p2.x, &seg[i].p2.y); scanf("%lf %lf", &t.x, &t.y); scanf("%lf %lf", &s.x, &s.y); double ans = inf; for (double theta = 0.0, cnt = 0; cnt <= 3600000; theta += 0.0001, cnt++) { ans = min(ans, compute(toRad(theta))); } printf("%.10lf\n", ans); } return 0; }
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <vector> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) #define inf (1 << 29) #define EPS (1e-5) #define COUNTER_CLOCKWISE 1 #define CLOCKWISE -1 #define ONLINE_BACK 2 #define ONLINE_FRONT -2 #define ON_SEGMENT 0 #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; // class Point { public: double x, y; Point(double x = -inf, double y = -inf) : x(x), y(y) {} Point operator+(Point p) { return Point(x + p.x, y + p.y); } Point operator-(Point p) { return Point(x - p.x, y - p.y); } Point operator*(double a) { return Point(a * x, a * y); } Point operator/(double a) { return Point(x / a, y / a); } bool operator<(const Point &p) const { return !equals(x, p.x) ? x < p.x : y < p.y; } bool operator==(const Point &p) const { return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS; } }; struct Segment { Point p1, p2; Segment(Point p1 = Point(-inf, -inf), Point p2 = Point(-inf, -inf)) : p1(p1), p2(p2) {} bool operator==(const Segment &p) const { return p.p1 == p1 && p.p2 == p2; } }; typedef Point Vector; typedef Segment Line; typedef vector<Point> Polygon; ostream &operator<<(ostream &os, const Point &a) { os << "(" << a.x << "," << a.y << ")"; } ostream &operator<<(ostream &os, const Segment &a) { os << "( " << a.p1 << " , " << a.p2 << " )"; } double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; } double cross(Point a, Point b) { return a.x * b.y - a.y * b.x; } double norm(Point a) { return a.x * a.x + a.y * a.y; } double abs(Point a) { return sqrt(norm(a)); } // rad は角度をラジアンで持たせること Point rotate(Point a, double rad) { return Point(cos(rad) * a.x - sin(rad) * a.y, sin(rad) * a.x + cos(rad) * a.y); } // 度をラジアンに変換 double toRad(double agl) { return agl * M_PI / 180.0; } int ccw(Point p0, Point p1, Point p2) { Point a = p1 - p0; Point b = p2 - p0; if (cross(a, b) > EPS) return COUNTER_CLOCKWISE; if (cross(a, b) < -EPS) return CLOCKWISE; if (dot(a, b) < -EPS) return ONLINE_BACK; if (norm(a) < norm(b)) return ONLINE_FRONT; return ON_SEGMENT; } bool intersectLL(Line l, Line m) { return abs(cross(l.p2 - l.p1, m.p2 - m.p1)) > EPS || // non-parallel abs(cross(l.p2 - l.p1, m.p1 - l.p1)) < EPS; // same line } bool intersectLS(Line l, Line s) { return cross(l.p2 - l.p1, s.p1 - l.p1) * // s[0] is left of l cross(l.p2 - l.p1, s.p2 - l.p1) < EPS; // s[1] is right of l } bool intersectLP(Line l, Point p) { return abs(cross(l.p2 - p, l.p1 - p)) < EPS; } bool intersectSS(Line s, Line t) { return ccw(s.p1, s.p2, t.p1) * ccw(s.p1, s.p2, t.p2) <= 0 && ccw(t.p1, t.p2, s.p1) * ccw(t.p1, t.p2, s.p2) <= 0; } bool intersectSP(Line s, Point p) { return abs(s.p1 - p) + abs(s.p2 - p) - abs(s.p2 - s.p1) < EPS; // triangle inequality } Point projection(Line l, Point p) { double t = dot(p - l.p1, l.p1 - l.p2) / norm(l.p1 - l.p2); return l.p1 + (l.p1 - l.p2) * t; } Point reflection(Line l, Point p) { return p + (projection(l, p) - p) * 2; } double distanceLP(Line l, Point p) { return abs(p - projection(l, p)); } double distanceLL(Line l, Line m) { return intersectLL(l, m) ? 0 : distanceLP(l, m.p1); } double distanceLS(Line l, Line s) { if (intersectLS(l, s)) return 0; return min(distanceLP(l, s.p1), distanceLP(l, s.p2)); } double distanceSP(Line s, Point p) { Point r = projection(s, p); if (intersectSP(s, r)) return abs(r - p); return min(abs(s.p1 - p), abs(s.p2 - p)); } double distanceSS(Line s, Line t) { if (intersectSS(s, t)) return 0; return min(min(distanceSP(s, t.p1), distanceSP(s, t.p2)), min(distanceSP(t, s.p1), distanceSP(t, s.p2))); } Point crosspoint(Line l, Line m) { double A = cross(l.p2 - l.p1, m.p2 - m.p1); double B = cross(l.p2 - l.p1, l.p2 - m.p1); if (abs(A) < EPS && abs(B) < EPS) return m.p1; // same line if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!! return m.p1 + (m.p2 - m.p1) * (B / A); } // int n; vector<Segment> seg; Point s, t; double compute(double rad) { Point e = Point(cos(rad), sin(rad)); e = e * 1000; e = e + s; Segment UruruBeam = Segment(s, e); double ret = 0; Point sp; int onSeg = -1; sp = s; rep(i, 6) { double mdist = inf; Point mcp; int mp = -1; rep(j, n) if (onSeg != j && intersectSS(UruruBeam, seg[j])) { Point cp = crosspoint(UruruBeam, seg[j]); double dist = abs(sp - cp); if (!equals(mdist, dist) && mdist > dist) { mdist = dist; mcp = cp; mp = j; } } if (intersectSP(UruruBeam, t)) { double dist = abs(sp - t); if (!equals(mdist, dist) && mdist > dist) return ret + dist; } if (mp == -1) return inf; onSeg = mp; ret += abs(sp - mcp); UruruBeam = Segment(mcp, reflection(seg[mp], UruruBeam.p2)); sp = mcp; } return inf; } int main() { while (scanf("%d", &n), n) { seg.clear(); seg.resize(n); rep(i, n) scanf("%lf %lf %lf %lf", &seg[i].p1.x, &seg[i].p1.y, &seg[i].p2.x, &seg[i].p2.y); scanf("%lf %lf", &t.x, &t.y); scanf("%lf %lf", &s.x, &s.y); double ans = inf; for (double theta = 0.0, cnt = 0; cnt <= 360000; theta += 0.001, cnt++) { ans = min(ans, compute(toRad(theta))); } printf("%.10lf\n", ans); } return 0; }
replace
209
210
209
210
TLE
p00761
C++
Runtime Error
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; vector<int> a; int L; string intString(int n) { stringstream ss; int keta = 1, tmp; tmp = n; while (tmp != 0) { tmp /= 10; keta++; } for (int i = 0; i <= (L - keta); i++) ss << 0; ss << n; return ss.str(); } int func(string str) { sort(str.begin(), str.end()); int low = stoi(str); sort(str.rbegin(), str.rend()); int high = stoi(str); return high - low; } void solve() { // 桁変更 string str = intString(a[0]); for (int i = 1;; i++) { a[i] = func(str); for (int j = 0; j < i; j++) { if (a[i] == a[j]) { cout << j << ' ' << a[i] << ' ' << (i - j) << endl; a.clear(); return; } } str = intString(a[i]); } } int main() { int a0; while (true) { cin >> a0 >> L; if (a0 + L == 0) break; a.push_back(a0); solve(); } return 0; }
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; vector<int> a; int L; string intString(int n) { stringstream ss; int keta = 1, tmp; tmp = n; while (tmp != 0) { tmp /= 10; keta++; } for (int i = 0; i <= (L - keta); i++) ss << 0; ss << n; return ss.str(); } int func(string str) { sort(str.begin(), str.end()); int low = stoi(str); sort(str.rbegin(), str.rend()); int high = stoi(str); return high - low; } void solve() { // 桁変更 string str = intString(a[0]); for (int i = 1;; i++) { a.push_back(func(str)); for (int j = 0; j < i; j++) { if (a[i] == a[j]) { cout << j << ' ' << a[i] << ' ' << (i - j) << endl; a.clear(); return; } } str = intString(a[i]); } } int main() { int a0; while (true) { cin >> a0 >> L; if (a0 + L == 0) break; a.push_back(a0); solve(); } return 0; }
replace
37
38
37
38
0
p00761
C++
Runtime Error
// 18 #include <algorithm> #include <cstdlib> #include <iomanip> #include <iostream> #include <sstream> #include <string> using namespace std; int main() { for (int n, l; cin >> n >> l, n | l;) { stringstream ss; ss << setw(l) << setfill('0') << n; string a[20]; a[0] = ss.str(); for (int i = 1;; i++) { string h = a[i - 1], lo = a[i - 1]; sort(h.begin(), h.end()); sort(lo.rbegin(), lo.rend()); stringstream st; st << setw(l) << setfill('0') << atoi(lo.c_str()) - atoi(h.c_str()); a[i] = st.str(); string *p = find(a, a + i, a[i]); if (p != a + i) { cout << p - a << ' ' << atoi(p->c_str()) << ' ' << a + i - p << endl; break; } } } return 0; }
// 18 #include <algorithm> #include <cstdlib> #include <iomanip> #include <iostream> #include <sstream> #include <string> using namespace std; int main() { for (int n, l; cin >> n >> l, n | l;) { stringstream ss; ss << setw(l) << setfill('0') << n; string a[21]; a[0] = ss.str(); for (int i = 1;; i++) { string h = a[i - 1], lo = a[i - 1]; sort(h.begin(), h.end()); sort(lo.rbegin(), lo.rend()); stringstream st; st << setw(l) << setfill('0') << atoi(lo.c_str()) - atoi(h.c_str()); a[i] = st.str(); string *p = find(a, a + i, a[i]); if (p != a + i) { cout << p - a << ' ' << atoi(p->c_str()) << ' ' << a + i - p << endl; break; } } } return 0; }
replace
14
15
14
15
0
p00761
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; vector<string> tmp; int ans, cnt, n; string s; string rec(string x) { while (1) { // cout << x << endl; bool flag = false; sort(x.begin(), x.end()); string a = x; if (a.empty() == 1) while (a.front() != '0') a.erase(a.begin()); int mn = atoi(a.c_str()); reverse(x.begin(), x.end()); int mx = atoi(x.c_str()); x = to_string(mx - mn); if (x.size() != n) x = '0' + x; // cout << mx << " " << mx << " " << x << endl; for (int i = 0; i < tmp.size(); i++) { // cout << tmp[i] << " "; if (x == tmp[i]) { ans = i; flag = true; break; } } tmp.push_back(x); cnt++; if (flag == false) return rec(x); else return x; } return 0; } int main() { while (1) { cin >> s >> n; if (s == "0" && n == 0) break; cnt = 0; ans = 0; while (1) { while (s.size() != n) s = '0' + s; tmp.push_back(s); s = rec(s); cout << ans << " " << atoi(s.c_str()) << " " << cnt - ans << endl; tmp.clear(); } } return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; vector<string> tmp; int ans, cnt, n; string s; string rec(string x) { while (1) { // cout << x << endl; bool flag = false; sort(x.begin(), x.end()); string a = x; if (a.empty() == 1) while (a.front() != '0') a.erase(a.begin()); int mn = atoi(a.c_str()); reverse(x.begin(), x.end()); int mx = atoi(x.c_str()); x = to_string(mx - mn); if (x.size() != n) x = '0' + x; // cout << mx << " " << mx << " " << x << endl; for (int i = 0; i < tmp.size(); i++) { // cout << tmp[i] << " "; if (x == tmp[i]) { ans = i; flag = true; break; } } tmp.push_back(x); cnt++; if (flag == false) return rec(x); else return x; } return 0; } int main() { while (1) { cin >> s >> n; if (s == "0" && n == 0) break; cnt = 0; ans = 0; while (s.size() != n) s = '0' + s; tmp.push_back(s); s = rec(s); cout << ans << " " << atoi(s.c_str()) << " " << cnt - ans << endl; tmp.clear(); } return 0; }
replace
46
54
46
52
TLE
p00762
C++
Runtime Error
#include <iostream> using namespace std; int n; int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; int t[300][300], u[300][300]; void roll(int d[], int dir) { int tmp[6], z; for (int i = 1; i <= 6; i++) { tmp[d[i]] = i; } if (dir == 0) { z = tmp[0]; tmp[0] = tmp[3]; tmp[3] = tmp[5]; tmp[5] = tmp[1]; tmp[1] = z; for (int i = 0; i < 6; i++) d[tmp[i]] = i; } else if (dir == 1) { z = tmp[0]; tmp[0] = tmp[4]; tmp[4] = tmp[5]; tmp[5] = tmp[2]; tmp[2] = z; for (int i = 0; i < 6; i++) d[tmp[i]] = i; } else if (dir == 2) { roll(d, 0); roll(d, 0); roll(d, 0); } else if (dir == 3) { roll(d, 1); roll(d, 1); roll(d, 1); } } void rec(int y, int x, int d[]) { int dir, ny, nx; for (int i = 6; i >= 4; i--) { dir = d[i] - 1; ny = y + dy[dir], nx = x + dx[dir]; if (dir < 0 || 4 <= dir) continue; if (ny < 0 || nx < 0) continue; if (ny > 201 || nx > 201) continue; if (u[ny][nx] < u[y][x]) { roll(d, dir); rec(ny, nx, d); return; } } for (int i = 1; i <= 6; i++) if (d[i] == 0) t[y][x] = i; u[y][x]++; } void init() { for (int i = 0; i < 300; i++) for (int j = 0; j < 300; j++) t[i][j] = u[i][j] = 0; } void printf() { cout << "=============================" << endl; for (int i = 147; i <= 152; i++) { for (int j = 147; j <= 152; j++) { cout << t[i][j] << ' '; } cout << endl; } cout << "=============================" << endl; } int main() { while (1) { cin >> n; if (n == 0) break; init(); for (int i = 0; i < n; i++) { int a, b, c; cin >> a >> b; if (a == 1) { if (b == 2) c = 3; else if (b == 3) c = 5; else if (b == 4) c = 2; else if (b == 5) c = 4; } else if (a == 2) { if (b == 1) c = 4; else if (b == 3) c = 1; else if (b == 4) c = 6; else if (b == 6) c = 3; } else if (a == 3) { if (b == 1) c = 2; else if (b == 2) c = 6; else if (b == 5) c = 1; else if (b == 6) c = 5; } else if (a == 4) { if (b == 1) c = 5; else if (b == 2) c = 1; else if (b == 5) c = 6; else if (b == 6) c = 1; } else if (a == 5) { if (b == 1) c = 3; else if (b == 3) c = 6; else if (b == 4) c = 1; else if (b == 6) c = 4; } else { if (b == 2) c = 4; else if (b == 3) c = 2; else if (b == 4) c = 5; else if (b == 5) c = 3; } int d[7]; // cout<<a<<b<<c<<endl; d[a] = 0; d[b] = 1; d[c] = 2; d[7 - b] = 3; d[7 - c] = 4; d[7 - a] = 5; rec(150, 150, d); // printf(); } int ans[7] = {}; for (int i = 0; i < 300; i++) for (int j = 0; j < 300; j++) ans[t[i][j]]++; for (int i = 0; i < 6; i++) { if (i) cout << ' '; cout << ans[i + 1]; } cout << endl; } return 0; }
#include <iostream> using namespace std; int n; int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; int t[300][300], u[300][300]; void roll(int d[], int dir) { int tmp[6], z; for (int i = 1; i <= 6; i++) { tmp[d[i]] = i; } if (dir == 0) { z = tmp[0]; tmp[0] = tmp[3]; tmp[3] = tmp[5]; tmp[5] = tmp[1]; tmp[1] = z; for (int i = 0; i < 6; i++) d[tmp[i]] = i; } else if (dir == 1) { z = tmp[0]; tmp[0] = tmp[4]; tmp[4] = tmp[5]; tmp[5] = tmp[2]; tmp[2] = z; for (int i = 0; i < 6; i++) d[tmp[i]] = i; } else if (dir == 2) { roll(d, 0); roll(d, 0); roll(d, 0); } else if (dir == 3) { roll(d, 1); roll(d, 1); roll(d, 1); } } void rec(int y, int x, int d[]) { int dir, ny, nx; for (int i = 6; i >= 4; i--) { dir = d[i] - 1; ny = y + dy[dir], nx = x + dx[dir]; if (dir < 0 || 4 <= dir) continue; if (ny < 0 || nx < 0) continue; if (ny > 201 || nx > 201) continue; if (u[ny][nx] < u[y][x]) { roll(d, dir); rec(ny, nx, d); return; } } for (int i = 1; i <= 6; i++) if (d[i] == 0) t[y][x] = i; u[y][x]++; } void init() { for (int i = 0; i < 300; i++) for (int j = 0; j < 300; j++) t[i][j] = u[i][j] = 0; } void printf() { cout << "=============================" << endl; for (int i = 147; i <= 152; i++) { for (int j = 147; j <= 152; j++) { cout << t[i][j] << ' '; } cout << endl; } cout << "=============================" << endl; } int main() { while (1) { cin >> n; if (n == 0) break; init(); for (int i = 0; i < n; i++) { int a, b, c; cin >> a >> b; if (a == 1) { if (b == 2) c = 3; else if (b == 3) c = 5; else if (b == 4) c = 2; else if (b == 5) c = 4; } else if (a == 2) { if (b == 1) c = 4; else if (b == 3) c = 1; else if (b == 4) c = 6; else if (b == 6) c = 3; } else if (a == 3) { if (b == 1) c = 2; else if (b == 2) c = 6; else if (b == 5) c = 1; else if (b == 6) c = 5; } else if (a == 4) { if (b == 1) c = 5; else if (b == 2) c = 1; else if (b == 5) c = 6; else if (b == 6) c = 2; } else if (a == 5) { if (b == 1) c = 3; else if (b == 3) c = 6; else if (b == 4) c = 1; else if (b == 6) c = 4; } else { if (b == 2) c = 4; else if (b == 3) c = 2; else if (b == 4) c = 5; else if (b == 5) c = 3; } int d[7]; // cout<<a<<b<<c<<endl; d[a] = 0; d[b] = 1; d[c] = 2; d[7 - b] = 3; d[7 - c] = 4; d[7 - a] = 5; rec(150, 150, d); // printf(); } int ans[7] = {}; for (int i = 0; i < 300; i++) for (int j = 0; j < 300; j++) ans[t[i][j]]++; for (int i = 0; i < 6; i++) { if (i) cout << ' '; cout << ans[i + 1]; } cout << endl; } return 0; }
replace
126
127
126
127
0
p00762
C++
Runtime Error
#include <iostream> using namespace std; #define VAR 150 struct S { int U, D, R, L, F, B, h, x, y; }; int main() { int field[VAR][VAR][VAR]; int n; int t, f; int tmp; int cnt[7]; S dice; while (1) { cin >> n; if (n == 0) break; for (int i = 0; i < VAR; i++) { for (int j = 0; j < VAR; j++) { for (int k = 0; k < VAR; k++) { field[i][j][k] = -1; } } } for (int i = 0; i < n; i++) { cin >> t >> f; dice.U = t; dice.D = 7 - t; dice.F = f; dice.B = 7 - f; if (t == 1 && f == 2) dice.R = 3, dice.L = 4; if (t == 1 && f == 3) dice.R = 5, dice.L = 2; if (t == 1 && f == 4) dice.R = 2, dice.L = 5; if (t == 1 && f == 5) dice.R = 4, dice.L = 3; if (t == 2 && f == 1) dice.R = 4, dice.L = 3; if (t == 2 && f == 3) dice.R = 1, dice.L = 6; if (t == 2 && f == 4) dice.R = 6, dice.L = 1; if (t == 2 && f == 6) dice.R = 3, dice.L = 4; if (t == 3 && f == 1) dice.R = 2, dice.L = 5; if (t == 3 && f == 2) dice.R = 6, dice.L = 1; if (t == 3 && f == 5) dice.R = 1, dice.L = 6; if (t == 3 && f == 6) dice.R = 5, dice.L = 2; if (t == 4 && f == 1) dice.R = 5, dice.L = 2; if (t == 4 && f == 2) dice.R = 1, dice.L = 6; if (t == 4 && f == 5) dice.R = 6, dice.L = 1; if (t == 4 && f == 6) dice.R = 2, dice.L = 5; if (t == 5 && f == 1) dice.R = 3, dice.L = 4; if (t == 5 && f == 3) dice.R = 6, dice.L = 1; if (t == 5 && f == 4) dice.R = 1, dice.L = 6; if (t == 5 && f == 6) dice.R = 4, dice.L = 3; if (t == 6 && f == 2) dice.R = 4, dice.L = 3; if (t == 6 && f == 3) dice.R = 2, dice.L = 5; if (t == 6 && f == 4) dice.R = 5, dice.L = 2; if (t == 6 && f == 5) dice.R = 3, dice.L = 4; dice.h = VAR - 1; dice.x = VAR / 2, dice.y = VAR / 2; while (1) { while (dice.h != 0 && field[dice.h - 1][dice.y][dice.x] == -1) dice.h--; int dir = -1; int dirmax = -1; if (dice.h != 0 && field[dice.h - 1][dice.y][dice.x + 1] == -1) { if (dirmax < dice.R && dice.R >= 4) { dir = 3; dirmax = dice.R; } } if (dice.h != 0 && field[dice.h - 1][dice.y][dice.x - 1] == -1) { if (dirmax < dice.L && dice.L >= 4) { dir = 4; dirmax = dice.L; } } if (dice.h != 0 && field[dice.h - 1][dice.y + 1][dice.x] == -1) { if (dirmax < dice.B && dice.B >= 4) { dir = 2; dirmax = dice.B; } } if (dice.h != 0 && field[dice.h - 1][dice.y - 1][dice.x] == -1) { if (dirmax < dice.F && dice.F >= 4) { dir = 1; dirmax = dice.F; } } if (dir == -1) { field[dice.h][dice.y][dice.x] = dice.U; break; } if (dir == 1) { dice.y--; tmp = dice.U; dice.U = dice.B; dice.B = dice.D; dice.D = dice.F; dice.F = tmp; } if (dir == 2) { dice.y++; tmp = dice.U; dice.U = dice.F; dice.F = dice.D; dice.D = dice.B; dice.B = tmp; } if (dir == 3) { dice.x++; tmp = dice.U; dice.U = dice.L; dice.L = dice.D; dice.D = dice.R; dice.R = tmp; } if (dir == 4) { dice.x--; tmp = dice.U; dice.U = dice.R; dice.R = dice.D; dice.D = dice.L; dice.L = tmp; } } } for (int i = 0; i < 7; i++) cnt[i] = 0; for (int i = 0; i < VAR; i++) { for (int j = 0; j < VAR; j++) { for (int k = 0; k <= VAR; k++) { if (k == VAR || field[k][i][j] == -1) { if (k != 0) { cnt[field[k - 1][i][j]]++; } break; } } } } for (int i = 1; i < 6; i++) cout << cnt[i] << " "; cout << cnt[6] << endl; } }
#include <iostream> using namespace std; #define VAR 100 struct S { int U, D, R, L, F, B, h, x, y; }; int main() { int field[VAR][VAR][VAR]; int n; int t, f; int tmp; int cnt[7]; S dice; while (1) { cin >> n; if (n == 0) break; for (int i = 0; i < VAR; i++) { for (int j = 0; j < VAR; j++) { for (int k = 0; k < VAR; k++) { field[i][j][k] = -1; } } } for (int i = 0; i < n; i++) { cin >> t >> f; dice.U = t; dice.D = 7 - t; dice.F = f; dice.B = 7 - f; if (t == 1 && f == 2) dice.R = 3, dice.L = 4; if (t == 1 && f == 3) dice.R = 5, dice.L = 2; if (t == 1 && f == 4) dice.R = 2, dice.L = 5; if (t == 1 && f == 5) dice.R = 4, dice.L = 3; if (t == 2 && f == 1) dice.R = 4, dice.L = 3; if (t == 2 && f == 3) dice.R = 1, dice.L = 6; if (t == 2 && f == 4) dice.R = 6, dice.L = 1; if (t == 2 && f == 6) dice.R = 3, dice.L = 4; if (t == 3 && f == 1) dice.R = 2, dice.L = 5; if (t == 3 && f == 2) dice.R = 6, dice.L = 1; if (t == 3 && f == 5) dice.R = 1, dice.L = 6; if (t == 3 && f == 6) dice.R = 5, dice.L = 2; if (t == 4 && f == 1) dice.R = 5, dice.L = 2; if (t == 4 && f == 2) dice.R = 1, dice.L = 6; if (t == 4 && f == 5) dice.R = 6, dice.L = 1; if (t == 4 && f == 6) dice.R = 2, dice.L = 5; if (t == 5 && f == 1) dice.R = 3, dice.L = 4; if (t == 5 && f == 3) dice.R = 6, dice.L = 1; if (t == 5 && f == 4) dice.R = 1, dice.L = 6; if (t == 5 && f == 6) dice.R = 4, dice.L = 3; if (t == 6 && f == 2) dice.R = 4, dice.L = 3; if (t == 6 && f == 3) dice.R = 2, dice.L = 5; if (t == 6 && f == 4) dice.R = 5, dice.L = 2; if (t == 6 && f == 5) dice.R = 3, dice.L = 4; dice.h = VAR - 1; dice.x = VAR / 2, dice.y = VAR / 2; while (1) { while (dice.h != 0 && field[dice.h - 1][dice.y][dice.x] == -1) dice.h--; int dir = -1; int dirmax = -1; if (dice.h != 0 && field[dice.h - 1][dice.y][dice.x + 1] == -1) { if (dirmax < dice.R && dice.R >= 4) { dir = 3; dirmax = dice.R; } } if (dice.h != 0 && field[dice.h - 1][dice.y][dice.x - 1] == -1) { if (dirmax < dice.L && dice.L >= 4) { dir = 4; dirmax = dice.L; } } if (dice.h != 0 && field[dice.h - 1][dice.y + 1][dice.x] == -1) { if (dirmax < dice.B && dice.B >= 4) { dir = 2; dirmax = dice.B; } } if (dice.h != 0 && field[dice.h - 1][dice.y - 1][dice.x] == -1) { if (dirmax < dice.F && dice.F >= 4) { dir = 1; dirmax = dice.F; } } if (dir == -1) { field[dice.h][dice.y][dice.x] = dice.U; break; } if (dir == 1) { dice.y--; tmp = dice.U; dice.U = dice.B; dice.B = dice.D; dice.D = dice.F; dice.F = tmp; } if (dir == 2) { dice.y++; tmp = dice.U; dice.U = dice.F; dice.F = dice.D; dice.D = dice.B; dice.B = tmp; } if (dir == 3) { dice.x++; tmp = dice.U; dice.U = dice.L; dice.L = dice.D; dice.D = dice.R; dice.R = tmp; } if (dir == 4) { dice.x--; tmp = dice.U; dice.U = dice.R; dice.R = dice.D; dice.D = dice.L; dice.L = tmp; } } } for (int i = 0; i < 7; i++) cnt[i] = 0; for (int i = 0; i < VAR; i++) { for (int j = 0; j < VAR; j++) { for (int k = 0; k <= VAR; k++) { if (k == VAR || field[k][i][j] == -1) { if (k != 0) { cnt[field[k - 1][i][j]]++; } break; } } } } for (int i = 1; i < 6; i++) cout << cnt[i] << " "; cout << cnt[6] << endl; } }
replace
4
5
4
5
-11
p00762
C++
Memory 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 = (b)-1; i >= (a); i--) #define all(a) (a).begin(), (a).end() typedef long long ll; typedef pair<int, int> Pii; typedef tuple<int, int, int> TUPLE; typedef vector<int> V; typedef vector<V> VV; typedef vector<VV> VVV; typedef vector<vector<int>> Graph; const int inf = 1e9; const int mod = 1e9 + 7; // N, E, S, W const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {1, 0, -1, 0}; struct Dice { V v; Dice() {} Dice(V _v) : v(_v) {} Dice(int _t, int _f) : v(6) { v[0] = _t; v[1] = _f; v[2] = getRight(_t, _f); v[5] = 7 - v[0]; v[4] = 7 - v[1]; v[3] = 7 - v[2]; } int getRight(int t, int f) { bool swapped = false; if (t > f) { swap(t, f); swapped = true; } int r = -1; if (t == 1 && f == 2) r = 3; if (t == 1 && f == 3) r = 5; if (t == 1 && f == 4) r = 2; if (t == 1 && f == 5) r = 4; if (t == 2 && f == 3) r = 1; if (t == 2 && f == 4) r = 6; if (t == 2 && f == 6) r = 3; if (t == 3 && f == 5) r = 1; if (t == 3 && f == 6) r = 5; if (t == 4 && f == 5) r = 6; if (t == 4 && f == 6) r = 2; if (t == 5 && f == 6) r = 4; // assert(r != -1); if (swapped) r = 7 - r; return r; } void rot(int dir) { int t = v[0]; switch (dir) { case 0: // 'N' v[0] = v[1]; v[1] = v[5]; v[5] = v[4]; v[4] = t; break; case 1: // 'E' v[0] = v[3]; v[3] = v[5]; v[5] = v[2]; v[2] = t; break; case 2: // 'S' v[0] = v[4]; v[4] = v[5]; v[5] = v[1]; v[1] = t; break; case 3: // 'W' v[0] = v[2]; v[2] = v[5]; v[5] = v[3]; v[3] = t; break; } // assert(1); } int at(int dir) { switch (dir) { case 0: return v[4]; break; // 'N' case 1: return v[2]; break; // 'E' case 2: return v[1]; break; // 'S' case 3: return v[3]; break; // 'W' } // assert(1); } void print() { rep(i, 6) cerr << v[i] << " "; cerr << endl; } }; const int MAX = 200; int field[MAX][MAX][MAX]; void drop(int x, int y, Dice dice) { // fall int z = 0; while (field[x][y][z]) z++; // cerr << "drop: (" << x << ", " << y << ", " << z << ") "; // rep(i, 6) cerr << dice.v[i] << " "; // cerr << endl; int nz = z - 1; bool dropped = false; if (nz >= 0) { int dir = -1; int ma_num = -1; rep(k, 4) { int nx = x + dx[k], ny = y + dy[k]; // ??????4??\??? ?????? ????????????????????? -> // ???????????§????????????????????? if (dice.at(k) >= 4 && !field[nx][ny][nz] && ma_num < dice.at(k)) { dir = k; ma_num = dice.at(k); } } if (dir != -1) { dice.rot(dir); // cerr << "move to: " << dir << ": (" << x + dx[dir] << ", " << y + // dy[dir] << ")"; dice.print(); drop(x + dx[dir], y + dy[dir], dice); dropped = true; } } if (!dropped) { field[x][y][z] = dice.v[0]; } } void solve(int n) { rep(x, MAX) rep(y, MAX) rep(z, MAX) field[x][y][z] = 0; rep(i, n) { int t, f; cin >> t >> f; Dice dice(t, f); drop(MAX / 2, MAX / 2, dice); } V cnt(6); rep(x, MAX) { rep(y, MAX) { rrep(z, MAX) { if (field[x][y][z]) { // cerr << x - 100 << " " << y - 100 << " " << z << " " << // field[x][y][z] << endl; ++cnt[field[x][y][z] - 1]; break; } } } } // cerr << "Ans:"; rep(i, 6) { cout << (i != 0 ? " " : "") << cnt[i]; } cout << endl; } signed main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n; while (cin >> n, n) { solve(n); } }
#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 = (b)-1; i >= (a); i--) #define all(a) (a).begin(), (a).end() typedef long long ll; typedef pair<int, int> Pii; typedef tuple<int, int, int> TUPLE; typedef vector<int> V; typedef vector<V> VV; typedef vector<VV> VVV; typedef vector<vector<int>> Graph; const int inf = 1e9; const int mod = 1e9 + 7; // N, E, S, W const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {1, 0, -1, 0}; struct Dice { V v; Dice() {} Dice(V _v) : v(_v) {} Dice(int _t, int _f) : v(6) { v[0] = _t; v[1] = _f; v[2] = getRight(_t, _f); v[5] = 7 - v[0]; v[4] = 7 - v[1]; v[3] = 7 - v[2]; } int getRight(int t, int f) { bool swapped = false; if (t > f) { swap(t, f); swapped = true; } int r = -1; if (t == 1 && f == 2) r = 3; if (t == 1 && f == 3) r = 5; if (t == 1 && f == 4) r = 2; if (t == 1 && f == 5) r = 4; if (t == 2 && f == 3) r = 1; if (t == 2 && f == 4) r = 6; if (t == 2 && f == 6) r = 3; if (t == 3 && f == 5) r = 1; if (t == 3 && f == 6) r = 5; if (t == 4 && f == 5) r = 6; if (t == 4 && f == 6) r = 2; if (t == 5 && f == 6) r = 4; // assert(r != -1); if (swapped) r = 7 - r; return r; } void rot(int dir) { int t = v[0]; switch (dir) { case 0: // 'N' v[0] = v[1]; v[1] = v[5]; v[5] = v[4]; v[4] = t; break; case 1: // 'E' v[0] = v[3]; v[3] = v[5]; v[5] = v[2]; v[2] = t; break; case 2: // 'S' v[0] = v[4]; v[4] = v[5]; v[5] = v[1]; v[1] = t; break; case 3: // 'W' v[0] = v[2]; v[2] = v[5]; v[5] = v[3]; v[3] = t; break; } // assert(1); } int at(int dir) { switch (dir) { case 0: return v[4]; break; // 'N' case 1: return v[2]; break; // 'E' case 2: return v[1]; break; // 'S' case 3: return v[3]; break; // 'W' } // assert(1); } void print() { rep(i, 6) cerr << v[i] << " "; cerr << endl; } }; const int MAX = 200; int field[MAX][MAX][MAX]; void drop(int x, int y, Dice dice) { // fall int z = 0; while (field[x][y][z]) z++; // cerr << "drop: (" << x << ", " << y << ", " << z << ") "; // rep(i, 6) cerr << dice.v[i] << " "; // cerr << endl; int nz = z - 1; bool dropped = false; if (nz >= 0) { int dir = -1; int ma_num = -1; rep(k, 4) { int nx = x + dx[k], ny = y + dy[k]; // ??????4??\??? ?????? ????????????????????? -> // ???????????§????????????????????? if (dice.at(k) >= 4 && !field[nx][ny][nz] && ma_num < dice.at(k)) { dir = k; ma_num = dice.at(k); } } if (dir != -1) { dice.rot(dir); // cerr << "move to: " << dir << ": (" << x + dx[dir] << ", " << y + // dy[dir] << ")"; dice.print(); drop(x + dx[dir], y + dy[dir], dice); dropped = true; } } if (!dropped) { field[x][y][z] = dice.v[0]; } } void solve(int n) { rep(x, MAX) rep(y, MAX) rep(z, MAX) field[x][y][z] = 0; rep(i, n) { int t, f; cin >> t >> f; Dice dice(t, f); drop(MAX / 2, MAX / 2, dice); } V cnt(6); rep(x, MAX) { rep(y, MAX) { rrep(z, MAX) { if (field[x][y][z]) { // cerr << x - 100 << " " << y - 100 << " " << z << " " << // field[x][y][z] << endl; ++cnt[field[x][y][z] - 1]; break; } } } } // cerr << "Ans:"; rep(i, 6) { cout << (i != 0 ? " " : "") << cnt[i]; } cout << endl; } signed main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n; while (cin >> n, n) { solve(n); } }
replace
2
3
2
3
MLE
p00762
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> Pair; int getRightSide(Pair p) { if (p.first == 1 && p.second == 2) return 3; if (p.first == 1 && p.second == 3) return 5; if (p.first == 1 && p.second == 4) return 2; if (p.first == 1 && p.second == 5) return 4; if (p.first == 2 && p.second == 1) return 4; if (p.first == 2 && p.second == 3) return 1; if (p.first == 2 && p.second == 4) return 6; if (p.first == 2 && p.second == 6) return 3; if (p.first == 3 && p.second == 1) return 2; if (p.first == 3 && p.second == 2) return 6; if (p.first == 3 && p.second == 5) return 1; if (p.first == 3 && p.second == 6) return 5; if (p.first == 4 && p.second == 1) return 5; if (p.first == 4 && p.second == 2) return 1; if (p.first == 4 && p.second == 5) return 6; if (p.first == 4 && p.second == 6) return 2; if (p.first == 5 && p.second == 1) return 3; if (p.first == 5 && p.second == 3) return 6; if (p.first == 5 && p.second == 4) return 1; if (p.first == 5 && p.second == 6) return 4; if (p.first == 6 && p.second == 2) return 4; if (p.first == 6 && p.second == 3) return 2; if (p.first == 6 && p.second == 4) return 5; if (p.first == 6 && p.second == 5) return 3; } const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; Pair rotate(Pair p, int d) { if (d == 0) return Pair(7 - getRightSide(p), p.second); if (d == 1) return Pair(7 - p.second, p.first); if (d == 2) return Pair(getRightSide(p), p.second); if (d == 3) return Pair(p.second, 7 - p.first); } int getSide(Pair p, int d) { if (d == 0) return getRightSide(p); if (d == 1) return p.second; if (d == 2) return 7 - getRightSide(p); if (d == 3) return 7 - p.second; } const int MAXN = 202; Pair G[MAXN][MAXN][MAXN]; int main() { for (int n; cin >> n && n;) { fill(G[0][0], G[MAXN][0], Pair(0, 0)); while (n--) { Pair p; cin >> p.first >> p.second; int x = MAXN / 2, y = MAXN / 2, z = MAXN - 1; while (1) { if (z == 0) { G[z][y][x] = p; break; } if (G[z - 1][y][x].first) { Pair v; for (int k = 0; k < 4; ++k) { if (getSide(p, k) >= 4 && !G[z][y + dy[k]][x + dx[k]].first && !G[z - 1][y + dy[k]][x + dx[k]].first) { v = max(v, Pair(getSide(p, k), k)); } } if (!v.first) { G[z][y][x] = p; break; } int k = v.second; p = rotate(p, k); x += dx[k]; y += dy[k]; --z; } else { --z; } } } vector<int> res(6); for (int y = 0; y < MAXN; ++y) { for (int x = 0; x < MAXN; ++x) { for (int z = MAXN - 1; z >= 0; --z) { if (G[z][y][x].first) { res[G[z][y][x].first - 1] += 1; break; } } } } for (int i = 0; i < res.size(); ++i) { if (i) cout << " "; cout << res[i]; } cout << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> Pair; int getRightSide(Pair p) { if (p.first == 1 && p.second == 2) return 3; if (p.first == 1 && p.second == 3) return 5; if (p.first == 1 && p.second == 4) return 2; if (p.first == 1 && p.second == 5) return 4; if (p.first == 2 && p.second == 1) return 4; if (p.first == 2 && p.second == 3) return 1; if (p.first == 2 && p.second == 4) return 6; if (p.first == 2 && p.second == 6) return 3; if (p.first == 3 && p.second == 1) return 2; if (p.first == 3 && p.second == 2) return 6; if (p.first == 3 && p.second == 5) return 1; if (p.first == 3 && p.second == 6) return 5; if (p.first == 4 && p.second == 1) return 5; if (p.first == 4 && p.second == 2) return 1; if (p.first == 4 && p.second == 5) return 6; if (p.first == 4 && p.second == 6) return 2; if (p.first == 5 && p.second == 1) return 3; if (p.first == 5 && p.second == 3) return 6; if (p.first == 5 && p.second == 4) return 1; if (p.first == 5 && p.second == 6) return 4; if (p.first == 6 && p.second == 2) return 4; if (p.first == 6 && p.second == 3) return 2; if (p.first == 6 && p.second == 4) return 5; if (p.first == 6 && p.second == 5) return 3; } const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; Pair rotate(Pair p, int d) { if (d == 0) return Pair(7 - getRightSide(p), p.second); if (d == 1) return Pair(7 - p.second, p.first); if (d == 2) return Pair(getRightSide(p), p.second); if (d == 3) return Pair(p.second, 7 - p.first); } int getSide(Pair p, int d) { if (d == 0) return getRightSide(p); if (d == 1) return p.second; if (d == 2) return 7 - getRightSide(p); if (d == 3) return 7 - p.second; } const int MAXN = 102; Pair G[MAXN][MAXN][MAXN]; int main() { for (int n; cin >> n && n;) { fill(G[0][0], G[MAXN][0], Pair(0, 0)); while (n--) { Pair p; cin >> p.first >> p.second; int x = MAXN / 2, y = MAXN / 2, z = MAXN - 1; while (1) { if (z == 0) { G[z][y][x] = p; break; } if (G[z - 1][y][x].first) { Pair v; for (int k = 0; k < 4; ++k) { if (getSide(p, k) >= 4 && !G[z][y + dy[k]][x + dx[k]].first && !G[z - 1][y + dy[k]][x + dx[k]].first) { v = max(v, Pair(getSide(p, k), k)); } } if (!v.first) { G[z][y][x] = p; break; } int k = v.second; p = rotate(p, k); x += dx[k]; y += dy[k]; --z; } else { --z; } } } vector<int> res(6); for (int y = 0; y < MAXN; ++y) { for (int x = 0; x < MAXN; ++x) { for (int z = MAXN - 1; z >= 0; --z) { if (G[z][y][x].first) { res[G[z][y][x].first - 1] += 1; break; } } } } for (int i = 0; i < res.size(); ++i) { if (i) cout << " "; cout << res[i]; } cout << endl; } return 0; }
replace
80
81
80
81
MLE
p00762
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdlib.h> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; #define ll long long #define ld long double #define EPS 0.0000000001 #define INF 1e9 #define MOD 1000000007 #define rep(i, n) for (i = 0; i < (n); i++) #define loop(i, a, n) for (i = a; i < (n); i++) #define all(in) in.begin(), in.end() #define shosu(x) fixed << setprecision(x) typedef vector<int> vi; typedef vector<string> vs; typedef pair<int, int> pii; #define max_n 100 int v[max_n][max_n]; // 上面にかかれた数 int h[max_n][max_n]; // サイコロの高さ int geta = max_n / 2; // 中央(geta,geta) int p[7][7] = {}; void fall(int x, int y, int top, int front, int side) { for (int i = 6; i >= 4; i--) { if (top != i && top != 7 - i) { // iが側面にある if (front == i) { if (h[x - 1][y] >= h[x][y]) continue; fall(x - 1, y, 7 - front, top, p[7 - front][top]); } else if (front == 7 - i) { if (h[x + 1][y] >= h[x][y]) continue; fall(x + 1, y, front, 7 - top, p[front][7 - top]); } else if (side == i) { if (h[x][y + 1] >= h[x][y]) continue; fall(x, y + 1, 7 - side, front, top); } else if (side == 7 - i) { if (h[x][y - 1] >= h[x][y]) continue; fall(x, y - 1, side, front, 7 - top); } return; } } h[x][y]++; v[x][y] = top; } int main(void) { int i, j; int n; p[1][2] = 3; p[1][3] = 5; p[1][4] = 2; p[1][5] = 4; p[2][1] = 4; p[2][3] = 1; p[2][4] = 6; p[2][6] = 3; p[3][1] = 2; p[3][2] = 6; p[3][5] = 1; p[3][6] = 5; p[4][1] = 5; p[4][2] = 1; p[4][5] = 6; p[4][6] = 2; p[5][1] = 3; p[5][3] = 6; p[5][4] = 1; p[5][6] = 4; p[6][2] = 4; p[6][3] = 2; p[6][4] = 5; p[6][5] = 3; while (cin >> n, n) { rep(i, max_n) rep(j, max_n) { v[i][j] = 0; h[i][j] = 0; } rep(i, n) { int t, f; cin >> t >> f; fall(geta, geta, t, f, p[t][f]); } vi ans(6, 0); rep(i, max_n) rep(j, max_n) { ans[v[i][j] - 1]++; } rep(i, 6) { cout << ans[i]; if (i < 5) cout << " "; else cout << endl; } } }
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdlib.h> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; #define ll long long #define ld long double #define EPS 0.0000000001 #define INF 1e9 #define MOD 1000000007 #define rep(i, n) for (i = 0; i < (n); i++) #define loop(i, a, n) for (i = a; i < (n); i++) #define all(in) in.begin(), in.end() #define shosu(x) fixed << setprecision(x) typedef vector<int> vi; typedef vector<string> vs; typedef pair<int, int> pii; #define max_n 100 int v[max_n][max_n]; // 上面にかかれた数 int h[max_n][max_n]; // サイコロの高さ int geta = max_n / 2; // 中央(geta,geta) int p[7][7] = {}; void fall(int x, int y, int top, int front, int side) { for (int i = 6; i >= 4; i--) { if (top != i && top != 7 - i) { // iが側面にある if (front == i) { if (h[x - 1][y] >= h[x][y]) continue; fall(x - 1, y, 7 - front, top, p[7 - front][top]); } else if (front == 7 - i) { if (h[x + 1][y] >= h[x][y]) continue; fall(x + 1, y, front, 7 - top, p[front][7 - top]); } else if (side == i) { if (h[x][y + 1] >= h[x][y]) continue; fall(x, y + 1, 7 - side, front, top); } else if (side == 7 - i) { if (h[x][y - 1] >= h[x][y]) continue; fall(x, y - 1, side, front, 7 - top); } return; } } h[x][y]++; v[x][y] = top; } int main(void) { int i, j; int n; p[1][2] = 3; p[1][3] = 5; p[1][4] = 2; p[1][5] = 4; p[2][1] = 4; p[2][3] = 1; p[2][4] = 6; p[2][6] = 3; p[3][1] = 2; p[3][2] = 6; p[3][5] = 1; p[3][6] = 5; p[4][1] = 5; p[4][2] = 1; p[4][5] = 6; p[4][6] = 2; p[5][1] = 3; p[5][3] = 6; p[5][4] = 1; p[5][6] = 4; p[6][2] = 4; p[6][3] = 2; p[6][4] = 5; p[6][5] = 3; while (cin >> n, n) { rep(i, max_n) rep(j, max_n) { v[i][j] = 0; h[i][j] = 0; } rep(i, n) { int t, f; cin >> t >> f; fall(geta, geta, t, f, p[t][f]); } vi ans(6, 0); rep(i, max_n) rep(j, max_n) if (v[i][j] >= 1 && v[i][j] <= 6) { ans[v[i][j] - 1]++; } rep(i, 6) { cout << ans[i]; if (i < 5) cout << " "; else cout << endl; } } }
replace
117
118
117
120
-6
double free or corruption (out)
p00762
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int xRoll[4] = {0, 2, 5, 3}; const int yRoll[4] = {0, 4, 5, 1}; const int zRoll[4] = {1, 2, 4, 3}; const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {-1, 0, 1, 0}; struct Dice { bool empty = true; vector<int> num; void rotate(int dir) { if (dx[dir] == 0) { rotateY(dy[dir]); } else { rotateX(dx[dir]); } } void rotateX(int dir) { int tmp[6]; for (int i = 0; i < 6; i++) tmp[i] = num[i]; for (int i = 0; i < 4; i++) { tmp[xRoll[i]] = num[xRoll[(i - dir + 4) % 4]]; } for (int i = 0; i < 6; i++) num[i] = tmp[i]; } void rotateY(int dir) { int tmp[6]; for (int i = 0; i < 6; i++) tmp[i] = num[i]; for (int i = 0; i < 4; i++) { tmp[yRoll[i]] = num[yRoll[(i - dir + 4) % 4]]; } for (int i = 0; i < 6; i++) num[i] = tmp[i]; } Dice() : empty(true), num(6){}; Dice(int t, int f) : num(6) { empty = false; num[0] = t; num[2] = f; num[5] = 5 - t; num[3] = 5 - f; for (int i = 0; i < 4; i++) { if (xRoll[i] == t && xRoll[(i + 1) % 4] == f) { num[1] = 1; num[4] = 4; return; } if (xRoll[i] == t && xRoll[(i - 1 + 4) % 4] == f) { num[1] = 4; num[4] = 1; return; } } for (int i = 0; i < 4; i++) { if (yRoll[i] == t && yRoll[(i + 1) % 4] == f) { num[1] = 2; num[4] = 3; return; } if (yRoll[i] == t && yRoll[(i - 1 + 4) % 4] == f) { num[1] = 3; num[4] = 2; return; } } for (int i = 0; i < 4; i++) { if (zRoll[i] == t && zRoll[(i + 1) % 4] == f) { num[1] = 5; num[4] = 0; return; } if (zRoll[i] == t && zRoll[(i - 1 + 4) % 4] == f) { num[1] = 0; num[4] = 5; return; } } } }; const int SIZE = 220; const int HEIGHT = 60; const int iniX = 110; const int iniY = 110; struct Field { vector<vector<vector<Dice>>> f; void drop_impl(int posX, int posY, int posZ, Dice x) { if (posZ == 0) { f[posX][posY][posZ] = x; return; } pair<int, int> dir = make_pair(-1, -1); for (int i = 0; i < 4; i++) { int toX = posX + dx[i]; int toY = posY + dy[i]; if (f[toX][toY][posZ - 1].empty) { dir = max(dir, make_pair(x.num[zRoll[i]], i)); } } if (dir.first < 3) { f[posX][posY][posZ] = x; return; } x.rotate(dir.second); posX += dx[dir.second]; posY += dy[dir.second]; for (int i = posZ; i >= 0; i--) { if (!f[posX][posY][i].empty) { drop_impl(posX, posY, i + 1, x); return; } } drop_impl(posX, posY, 0, x); } public: Field() : f(SIZE, vector<vector<Dice>>(SIZE, vector<Dice>(HEIGHT))){}; void drop(Dice x) { for (int i = HEIGHT - 1; i >= 0; i--) { if (!f[iniX][iniY][i].empty) { drop_impl(iniX, iniY, i + 1, x); return; } } drop_impl(iniX, iniY, 0, x); } void query() { vector<int> cnt(6, 0); for (int x = 0; x < SIZE; x++) { for (int y = 0; y < SIZE; y++) { for (int z = HEIGHT - 1; z >= 0; z--) { if (!f[x][y][z].empty) { cnt[f[x][y][z].num[0]]++; break; } } } } for (int i = 0; i < 6; i++) { cout << cnt[i] << (i == 5 ? "\n" : " "); } } }; int main() { int n; while (cin >> n, n) { Field ff; for (int i = 0; i < n; i++) { int t, f; cin >> t >> f; t--, f--; Dice x(t, f); ff.drop(Dice(t, f)); } ff.query(); } return 0; }
#include <bits/stdc++.h> using namespace std; const int xRoll[4] = {0, 2, 5, 3}; const int yRoll[4] = {0, 4, 5, 1}; const int zRoll[4] = {1, 2, 4, 3}; const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {-1, 0, 1, 0}; struct Dice { bool empty = true; vector<int> num; void rotate(int dir) { if (dx[dir] == 0) { rotateY(dy[dir]); } else { rotateX(dx[dir]); } } void rotateX(int dir) { int tmp[6]; for (int i = 0; i < 6; i++) tmp[i] = num[i]; for (int i = 0; i < 4; i++) { tmp[xRoll[i]] = num[xRoll[(i - dir + 4) % 4]]; } for (int i = 0; i < 6; i++) num[i] = tmp[i]; } void rotateY(int dir) { int tmp[6]; for (int i = 0; i < 6; i++) tmp[i] = num[i]; for (int i = 0; i < 4; i++) { tmp[yRoll[i]] = num[yRoll[(i - dir + 4) % 4]]; } for (int i = 0; i < 6; i++) num[i] = tmp[i]; } Dice() : empty(true), num(0){}; Dice(int t, int f) : num(6) { empty = false; num[0] = t; num[2] = f; num[5] = 5 - t; num[3] = 5 - f; for (int i = 0; i < 4; i++) { if (xRoll[i] == t && xRoll[(i + 1) % 4] == f) { num[1] = 1; num[4] = 4; return; } if (xRoll[i] == t && xRoll[(i - 1 + 4) % 4] == f) { num[1] = 4; num[4] = 1; return; } } for (int i = 0; i < 4; i++) { if (yRoll[i] == t && yRoll[(i + 1) % 4] == f) { num[1] = 2; num[4] = 3; return; } if (yRoll[i] == t && yRoll[(i - 1 + 4) % 4] == f) { num[1] = 3; num[4] = 2; return; } } for (int i = 0; i < 4; i++) { if (zRoll[i] == t && zRoll[(i + 1) % 4] == f) { num[1] = 5; num[4] = 0; return; } if (zRoll[i] == t && zRoll[(i - 1 + 4) % 4] == f) { num[1] = 0; num[4] = 5; return; } } } }; const int SIZE = 220; const int HEIGHT = 60; const int iniX = 110; const int iniY = 110; struct Field { vector<vector<vector<Dice>>> f; void drop_impl(int posX, int posY, int posZ, Dice x) { if (posZ == 0) { f[posX][posY][posZ] = x; return; } pair<int, int> dir = make_pair(-1, -1); for (int i = 0; i < 4; i++) { int toX = posX + dx[i]; int toY = posY + dy[i]; if (f[toX][toY][posZ - 1].empty) { dir = max(dir, make_pair(x.num[zRoll[i]], i)); } } if (dir.first < 3) { f[posX][posY][posZ] = x; return; } x.rotate(dir.second); posX += dx[dir.second]; posY += dy[dir.second]; for (int i = posZ; i >= 0; i--) { if (!f[posX][posY][i].empty) { drop_impl(posX, posY, i + 1, x); return; } } drop_impl(posX, posY, 0, x); } public: Field() : f(SIZE, vector<vector<Dice>>(SIZE, vector<Dice>(HEIGHT))){}; void drop(Dice x) { for (int i = HEIGHT - 1; i >= 0; i--) { if (!f[iniX][iniY][i].empty) { drop_impl(iniX, iniY, i + 1, x); return; } } drop_impl(iniX, iniY, 0, x); } void query() { vector<int> cnt(6, 0); for (int x = 0; x < SIZE; x++) { for (int y = 0; y < SIZE; y++) { for (int z = HEIGHT - 1; z >= 0; z--) { if (!f[x][y][z].empty) { cnt[f[x][y][z].num[0]]++; break; } } } } for (int i = 0; i < 6; i++) { cout << cnt[i] << (i == 5 ? "\n" : " "); } } }; int main() { int n; while (cin >> n, n) { Field ff; for (int i = 0; i < n; i++) { int t, f; cin >> t >> f; t--, f--; Dice x(t, f); ff.drop(Dice(t, f)); } ff.query(); } return 0; }
replace
38
39
38
39
MLE
p00763
C++
Runtime Error
#include <bits/stdc++.h> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define all(c) begin(c), end(c) int n, m, c, s, g; int d_dist[30][110][110]; int d_final[110][110]; int p[30], q[30][60], r[30][60]; const int inf = 1e9; int getcost(int dist, int *q, int *p) { if (dist == inf) return inf; int res = 0; rep(i, 1000000) { if (dist <= q[i + 1]) { res += (dist - q[i]) * p[i]; break; } else { res += (q[i + 1] - q[i]) * p[i]; } } return res; } signed main() { /* ????´?????????¢??§???????????¨???WF 1 ??????????????¨???????????¨????????? 2 ??????????????§WF 3 */ while (cin >> n >> m >> c >> s >> g && n) { --s, --g; fill(&d_dist[0][0][0], &d_dist[30][110][0], inf); fill(&d_final[0][0], &d_final[110][0], inf); rep(i, c) rep(j, n) d_dist[i][j][j] = 0; rep(i, n) d_final[i][i] = 0; rep(i, m) { int x, y, d, c; cin >> x >> y >> d >> c; --x, --y, --c; d_dist[c][x][y] = min(d_dist[c][x][y], d); d_dist[c][y][x] = min(d_dist[c][y][x], d); } rep(i, c) cin >> p[i]; rep(i, c) { q[i][0] = 0; rep(j, p[i] - 1) cin >> q[i][j + 1]; q[i][p[i]] = inf * 2; rep(j, p[i]) cin >> r[i][j]; } // rep(i,c){ // rep(j,p[i]+10) cout << q[i][j] << ' '; // cout << endl; // rep(j,p[i]+10) cout << r[i][j] << ' '; // cout << endl; // } // while(1); rep(ic, c) rep(k, n) rep(i, n) rep(j, n) { d_dist[ic][i][j] = min(d_dist[ic][i][j], d_dist[ic][i][k] + d_dist[ic][k][j]); } // rep(ic,c){ // rep(i,n){ // rep(j,n) { // cout << d_dist[ic][i][j] << ' '; // } // cout << endl; // } // } // while(1); rep(ic, c) rep(i, n) rep(j, n) { d_final[i][j] = min(d_final[i][j], getcost(d_dist[ic][i][j], q[ic], r[ic])); // cout << getcost(d_dist[ic][i][j], r[ic], q[ic]) << endl; } // rep(i,n){ // rep(j,n) { // cout << d_final[i][j] << ' '; // } // cout << endl; // } rep(k, n) rep(i, n) rep(j, n) { d_final[i][j] = min(d_final[i][j], d_final[i][k] + d_final[k][j]); } int ans = d_final[s][g]; cout << (ans == inf ? -1 : ans) << endl; } }
#include <bits/stdc++.h> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define all(c) begin(c), end(c) int n, m, c, s, g; int d_dist[30][110][110]; int d_final[110][110]; int p[30], q[30][60], r[30][60]; const int inf = 1e9; int getcost(int dist, int *q, int *p) { if (dist == inf) return inf; int res = 0; rep(i, 1000000) { if (dist <= q[i + 1]) { res += (dist - q[i]) * p[i]; break; } else { res += (q[i + 1] - q[i]) * p[i]; } } return res; } signed main() { /* ????´?????????¢??§???????????¨???WF 1 ??????????????¨???????????¨????????? 2 ??????????????§WF 3 */ while (cin >> n >> m >> c >> s >> g && n) { --s, --g; rep(ic, c) rep(i, n) rep(j, n) d_dist[ic][i][j] = inf; rep(i, n) rep(j, n) d_final[i][j] = inf; rep(i, c) rep(j, n) d_dist[i][j][j] = 0; rep(i, n) d_final[i][i] = 0; rep(i, m) { int x, y, d, c; cin >> x >> y >> d >> c; --x, --y, --c; d_dist[c][x][y] = min(d_dist[c][x][y], d); d_dist[c][y][x] = min(d_dist[c][y][x], d); } rep(i, c) cin >> p[i]; rep(i, c) { q[i][0] = 0; rep(j, p[i] - 1) cin >> q[i][j + 1]; q[i][p[i]] = inf * 2; rep(j, p[i]) cin >> r[i][j]; } // rep(i,c){ // rep(j,p[i]+10) cout << q[i][j] << ' '; // cout << endl; // rep(j,p[i]+10) cout << r[i][j] << ' '; // cout << endl; // } // while(1); rep(ic, c) rep(k, n) rep(i, n) rep(j, n) { d_dist[ic][i][j] = min(d_dist[ic][i][j], d_dist[ic][i][k] + d_dist[ic][k][j]); } // rep(ic,c){ // rep(i,n){ // rep(j,n) { // cout << d_dist[ic][i][j] << ' '; // } // cout << endl; // } // } // while(1); rep(ic, c) rep(i, n) rep(j, n) { d_final[i][j] = min(d_final[i][j], getcost(d_dist[ic][i][j], q[ic], r[ic])); // cout << getcost(d_dist[ic][i][j], r[ic], q[ic]) << endl; } // rep(i,n){ // rep(j,n) { // cout << d_final[i][j] << ' '; // } // cout << endl; // } rep(k, n) rep(i, n) rep(j, n) { d_final[i][j] = min(d_final[i][j], d_final[i][k] + d_final[k][j]); } int ans = d_final[s][g]; cout << (ans == inf ? -1 : ans) << endl; } }
replace
38
40
38
40
0
p00763
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define LOG(...) printf(__VA_ARGS__) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) #define RSORT(c) sort((c).rbegin(), (c).rend()) #define CLR(a) memset((a), 0, sizeof(a)) #define WRAP(y, x, h, w) (0 <= y && y < h && 0 <= x && x < w) typedef long long ll; typedef unsigned long long ull; typedef string str; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<double> vd; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vll> vvll; typedef vector<vd> vvd; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; int main() { int n, m, c, start, goal; while (cin >> n >> m >> c >> start >> goal, n) { start--; goal--; vector<vector<vector<pll>>> E(c, vector<vector<pll>>(n)); REP(i, m) { int x, y, d, co; cin >> x >> y >> d >> co; x--; y--; co--; E[co][x].push_back({y, d}); E[co][y].push_back({x, d}); } vector<int> num(n); REP(i, c) { cin >> num[i]; } vvll cost(c, vll(n * 200, 0)); REP(i, c) { vi q(num[i] - 1); vi r(num[i]); REP(j, num[i] - 1) cin >> q[j]; REP(j, num[i]) cin >> r[j]; int qidx = 0; int ridx = 0; FOR(j, 1, n * 200) { cost[i][j] = cost[i][j - 1] + r[ridx]; if (!q.empty() && qidx < q.size() && j == q[qidx]) { qidx++; ridx++; } } } vvll E2(n, vll(n, 1e9)); REP(i, c) { vvll E3(n, vll(n, 1e9)); REP(j, n) E3[j][j] = 0; REP(j, n) if (!E[i][j].empty()) REP(k, E[i][j].size()) E3[j][E[i][j][k].first] = min(E3[j][E[i][j][k].first], E[i][j][k].second); REP(l, n) REP(j, n) REP(k, n) E3[j][k] = min(E3[j][k], E3[j][l] + E3[l][k]); REP(j, n) REP(k, n) if (E3[j][k] != 1e9) E2[j][k] = min(E2[j][k], cost[i][E3[j][k]]); } REP(i, n) REP(j, n) REP(k, n) E2[j][k] = min(E2[j][k], E2[j][i] + E2[i][k]); if (E2[start][goal] == 1e9) cout << -1 << endl; else cout << E2[start][goal] << endl; } return 0; }
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define LOG(...) printf(__VA_ARGS__) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) #define RSORT(c) sort((c).rbegin(), (c).rend()) #define CLR(a) memset((a), 0, sizeof(a)) #define WRAP(y, x, h, w) (0 <= y && y < h && 0 <= x && x < w) typedef long long ll; typedef unsigned long long ull; typedef string str; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<double> vd; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vll> vvll; typedef vector<vd> vvd; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; int main() { int n, m, c, start, goal; while (cin >> n >> m >> c >> start >> goal, n) { start--; goal--; vector<vector<vector<pll>>> E(c, vector<vector<pll>>(n)); REP(i, m) { int x, y, d, co; cin >> x >> y >> d >> co; x--; y--; co--; E[co][x].push_back({y, d}); E[co][y].push_back({x, d}); } vector<int> num(c); REP(i, c) { cin >> num[i]; } vvll cost(c, vll(n * 200, 0)); REP(i, c) { vi q(num[i] - 1); vi r(num[i]); REP(j, num[i] - 1) cin >> q[j]; REP(j, num[i]) cin >> r[j]; int qidx = 0; int ridx = 0; FOR(j, 1, n * 200) { cost[i][j] = cost[i][j - 1] + r[ridx]; if (!q.empty() && qidx < q.size() && j == q[qidx]) { qidx++; ridx++; } } } vvll E2(n, vll(n, 1e9)); REP(i, c) { vvll E3(n, vll(n, 1e9)); REP(j, n) E3[j][j] = 0; REP(j, n) if (!E[i][j].empty()) REP(k, E[i][j].size()) E3[j][E[i][j][k].first] = min(E3[j][E[i][j][k].first], E[i][j][k].second); REP(l, n) REP(j, n) REP(k, n) E3[j][k] = min(E3[j][k], E3[j][l] + E3[l][k]); REP(j, n) REP(k, n) if (E3[j][k] != 1e9) E2[j][k] = min(E2[j][k], cost[i][E3[j][k]]); } REP(i, n) REP(j, n) REP(k, n) E2[j][k] = min(E2[j][k], E2[j][i] + E2[i][k]); if (E2[start][goal] == 1e9) cout << -1 << endl; else cout << E2[start][goal] << endl; } return 0; }
replace
64
65
64
65
0
p00763
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define INF (1e9) #define M 10005 #define N 105 #define L 55 #define C 20 using namespace std; typedef pair<int, int> P; int n, m, c, s, g, x, y, id, ic, p[C], q[L], r[L]; int cost1[C][N][N]; int cost2[C][M]; int d[N]; int tocost(int a, int b) { if (b < M) return cost2[a][b]; while (1) ; return cost2[a][M - 1] + (b - M - 1) * (cost2[a][M - 1] - cost2[a][M - 2]); } int dijkstra() { priority_queue<P, vector<P>, greater<P>> Q; for (int i = 0; i < n; i++) d[i] = INF; d[s] = 0; Q.push(P(0, s)); while (!Q.empty()) { P t = Q.top(); Q.pop(); int cost = t.first, u = t.second; if (u == g) return cost; if (d[u] < cost) continue; for (int k = 0; k < c; k++) { for (int i = 0; i < n; i++) { if (cost1[k][u][i] == INF) continue; int ncost = cost + tocost(k, cost1[k][u][i]); if (d[i] > ncost) { d[i] = ncost; Q.push(P(ncost, i)); } } } } return -1; } int main() { while (1) { cin >> n >> m >> c >> s >> g; if (!n && !m && !c && !s && !g) break; s--, g--; for (int i = 0; i < C; i++) for (int j = 0; j < N; j++) for (int k = 0; k < N; k++) cost1[i][j][k] = INF; for (int i = 0; i < m; i++) { cin >> x >> y >> id >> ic; x--, y--, ic--; cost1[ic][x][y] = cost1[ic][y][x] = min(cost1[ic][x][y], id); } for (int l = 0; l < c; l++) for (int k = 0; k < n; k++) for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cost1[l][i][j] = min(cost1[l][i][j], cost1[l][i][k] + cost1[l][k][j]); for (int i = 0; i < c; i++) cin >> p[i]; for (int i = 0; i < c; i++) { for (int j = 0; j < p[i] - 1; j++) cin >> q[j]; for (int j = 0; j < p[i]; j++) cin >> r[j]; int idx = 0; for (int j = 1; j < M; j++) { cost2[i][j] = cost2[i][j - 1] + r[idx]; if (idx < p[i] - 1 && j == q[idx]) idx++; } } cout << dijkstra() << endl; memset(cost2, 0, sizeof(cost2)); } return 0; }
#include <bits/stdc++.h> #define INF (1e9) #define M 10005 #define N 105 #define L 55 #define C 20 using namespace std; typedef pair<int, int> P; int n, m, c, s, g, x, y, id, ic, p[C], q[L], r[L]; int cost1[C][N][N]; int cost2[C][M]; int d[N]; int tocost(int a, int b) { if (b < M) return cost2[a][b]; return cost2[a][M - 1] + (b - M + 1) * (cost2[a][M - 1] - cost2[a][M - 2]); } int dijkstra() { priority_queue<P, vector<P>, greater<P>> Q; for (int i = 0; i < n; i++) d[i] = INF; d[s] = 0; Q.push(P(0, s)); while (!Q.empty()) { P t = Q.top(); Q.pop(); int cost = t.first, u = t.second; if (u == g) return cost; if (d[u] < cost) continue; for (int k = 0; k < c; k++) { for (int i = 0; i < n; i++) { if (cost1[k][u][i] == INF) continue; int ncost = cost + tocost(k, cost1[k][u][i]); if (d[i] > ncost) { d[i] = ncost; Q.push(P(ncost, i)); } } } } return -1; } int main() { while (1) { cin >> n >> m >> c >> s >> g; if (!n && !m && !c && !s && !g) break; s--, g--; for (int i = 0; i < C; i++) for (int j = 0; j < N; j++) for (int k = 0; k < N; k++) cost1[i][j][k] = INF; for (int i = 0; i < m; i++) { cin >> x >> y >> id >> ic; x--, y--, ic--; cost1[ic][x][y] = cost1[ic][y][x] = min(cost1[ic][x][y], id); } for (int l = 0; l < c; l++) for (int k = 0; k < n; k++) for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cost1[l][i][j] = min(cost1[l][i][j], cost1[l][i][k] + cost1[l][k][j]); for (int i = 0; i < c; i++) cin >> p[i]; for (int i = 0; i < c; i++) { for (int j = 0; j < p[i] - 1; j++) cin >> q[j]; for (int j = 0; j < p[i]; j++) cin >> r[j]; int idx = 0; for (int j = 1; j < M; j++) { cost2[i][j] = cost2[i][j - 1] + r[idx]; if (idx < p[i] - 1 && j == q[idx]) idx++; } } cout << dijkstra() << endl; memset(cost2, 0, sizeof(cost2)); } return 0; }
replace
16
19
16
17
TLE
p00763
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; int n, m, C, S, T, p[21], q[21][51], r[21][51]; int G[20][101][101]; void init() { for (int i = 0; i < 20; i++) for (int j = 0; j < 100; j++) for (int k = 0; k < 100; k++) G[i][j][k] = 1e9; } int calc(int c, int D) { int res = 0; for (int i = 1; i < p[c] && D; i++) { int d = min(D, q[c][i] - q[c][i - 1]); D -= d; res += d * r[c][i - 1]; } if (D) res += D * r[c][p[c] - 1]; return res; } int dijkstra() { int D[101]; for (int i = 0; i < 101; i++) D[i] = 1e9; priority_queue<P, vector<P>, greater<P>> Q; Q.push(P(0, S)); D[S] = 0; while (!Q.empty()) { P t = Q.top(); Q.pop(); int pos = t.second, cost = t.first; if (pos == T) return cost; if (D[pos] < cost) continue; for (int c = 0; c < C; c++) for (int i = 0; i < n; i++) { if (G[c][pos][i] == 1e9) continue; int ncost = cost + calc(c, G[c][pos][i]); D[i] = min(D[i], ncost); Q.push(P(ncost, i)); } } return -1; } void WF() { for (int c = 0; c < C; c++) for (int k = 0; k < n; k++) for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) G[c][i][j] = min(G[c][i][j], G[c][i][k] + G[c][k][j]); } int main() { while (1) { cin >> n >> m >> C >> S >> T; S--, T--; if (!n) break; init(); for (int i = 0, a, b, d, c; i < m; i++) { cin >> a >> b >> d >> c; a--, b--, c--; G[c][a][b] = G[c][b][a] = min(G[c][a][b], d); } for (int i = 0; i < C; i++) cin >> p[i]; for (int i = 0; i < C; i++) { for (int j = 1; j < p[i]; j++) cin >> q[i][j]; for (int j = 0; j < p[i]; j++) cin >> r[i][j]; } WF(); cout << dijkstra() << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; int n, m, C, S, T, p[21], q[21][51], r[21][51]; int G[20][101][101]; void init() { for (int i = 0; i < 20; i++) for (int j = 0; j < 100; j++) for (int k = 0; k < 100; k++) G[i][j][k] = 1e9; } int calc(int c, int D) { int res = 0; for (int i = 1; i < p[c] && D; i++) { int d = min(D, q[c][i] - q[c][i - 1]); D -= d; res += d * r[c][i - 1]; } if (D) res += D * r[c][p[c] - 1]; return res; } int dijkstra() { int D[101]; for (int i = 0; i < 101; i++) D[i] = 1e9; priority_queue<P, vector<P>, greater<P>> Q; Q.push(P(0, S)); D[S] = 0; while (!Q.empty()) { P t = Q.top(); Q.pop(); int pos = t.second, cost = t.first; if (pos == T) return cost; if (D[pos] < cost) continue; for (int c = 0; c < C; c++) for (int i = 0; i < n; i++) { if (G[c][pos][i] == 1e9) continue; int ncost = cost + calc(c, G[c][pos][i]); if (D[i] > ncost) D[i] = ncost, Q.push(P(ncost, i)); } } return -1; } void WF() { for (int c = 0; c < C; c++) for (int k = 0; k < n; k++) for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) G[c][i][j] = min(G[c][i][j], G[c][i][k] + G[c][k][j]); } int main() { while (1) { cin >> n >> m >> C >> S >> T; S--, T--; if (!n) break; init(); for (int i = 0, a, b, d, c; i < m; i++) { cin >> a >> b >> d >> c; a--, b--, c--; G[c][a][b] = G[c][b][a] = min(G[c][a][b], d); } for (int i = 0; i < C; i++) cin >> p[i]; for (int i = 0; i < C; i++) { for (int j = 1; j < p[i]; j++) cin >> q[i][j]; for (int j = 0; j < p[i]; j++) cin >> r[i][j]; } WF(); cout << dijkstra() << endl; } return 0; }
replace
46
48
46
48
0
p00763
C++
Runtime Error
#include <algorithm> #include <cstdio> using namespace std; #define INF (1 << 28) #define REP(i, n) for (int i = 0; i < n; i++) int a[110][110], wf[30][110][110], p[30], q[30][100], r[30][100]; int n, m, c, s, g, x, y, d, id, tmp; int main() { while (scanf("%d%d%d%d%d", &n, &m, &c, &s, &g), n) { REP(i, n) REP(j, n) { a[i][j] = INF; REP(k, n) wf[k][i][j] = INF; } REP(i, m) { scanf("%d%d%d%d", &x, &y, &d, &id); x--; y--; id--; wf[id][x][y] = min(wf[id][x][y], d); wf[id][y][x] = min(wf[id][y][x], d); } REP(l, c) { scanf("%d", &p[l]); REP(k, n) REP(i, n) REP(j, n) wf[l][i][j] = min(wf[l][i][j], wf[l][i][k] + wf[l][k][j]); } REP(k, c) { q[k][0] = 0; REP(i, p[k] - 1) scanf("%d", &q[k][i + 1]); q[k][p[k]] = INF; REP(i, p[k]) scanf("%d", &r[k][i]); REP(i, n) for (int j = i; j < n; j++) { if (wf[k][i][j] < INF) { tmp = 0; REP(l, p[k]) { if (wf[k][i][j] <= q[k][l + 1]) { tmp += r[k][l] * (wf[k][i][j] - q[k][l]); break; } else tmp += r[k][l] * (q[k][l + 1] - q[k][l]); } a[i][j] = a[j][i] = min(a[i][j], tmp); } } } REP(k, n) REP(i, n) REP(j, n) a[i][j] = min(a[i][j], a[i][k] + a[k][j]); if (a[s - 1][g - 1] >= INF) printf("-1\n"); else printf("%d\n", a[s - 1][g - 1]); } }
#include <algorithm> #include <cstdio> using namespace std; #define INF (1 << 28) #define REP(i, n) for (int i = 0; i < n; i++) int a[110][110], wf[30][110][110], p[30], q[30][100], r[30][100]; int n, m, c, s, g, x, y, d, id, tmp; int main() { while (scanf("%d%d%d%d%d", &n, &m, &c, &s, &g), n) { REP(i, n) REP(j, n) { a[i][j] = INF; REP(k, c) wf[k][i][j] = INF; } REP(i, m) { scanf("%d%d%d%d", &x, &y, &d, &id); x--; y--; id--; wf[id][x][y] = min(wf[id][x][y], d); wf[id][y][x] = min(wf[id][y][x], d); } REP(l, c) { scanf("%d", &p[l]); REP(k, n) REP(i, n) REP(j, n) wf[l][i][j] = min(wf[l][i][j], wf[l][i][k] + wf[l][k][j]); } REP(k, c) { q[k][0] = 0; REP(i, p[k] - 1) scanf("%d", &q[k][i + 1]); q[k][p[k]] = INF; REP(i, p[k]) scanf("%d", &r[k][i]); REP(i, n) for (int j = i; j < n; j++) { if (wf[k][i][j] < INF) { tmp = 0; REP(l, p[k]) { if (wf[k][i][j] <= q[k][l + 1]) { tmp += r[k][l] * (wf[k][i][j] - q[k][l]); break; } else tmp += r[k][l] * (q[k][l + 1] - q[k][l]); } a[i][j] = a[j][i] = min(a[i][j], tmp); } } } REP(k, n) REP(i, n) REP(j, n) a[i][j] = min(a[i][j], a[i][k] + a[k][j]); if (a[s - 1][g - 1] >= INF) printf("-1\n"); else printf("%d\n", a[s - 1][g - 1]); } }
replace
14
15
14
15
0
p00763
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define inf 1000000000000 long long dp[101][101]; long long dist[101][101][21]; long long solve(int n, int m, int c, int s, int g) { for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { dp[i][j] = inf; } } for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { for (int k = 0; k <= c; k++) { dist[i][j][k] = inf; if (i == j) { dist[i][j][k] = 0; } } } } long long x, y, z, w; for (int i = 0; i < m; i++) { cin >> x >> y >> z >> w; dist[x][y][w] = min(dist[x][y][w], z); dist[y][x][w] = min(dist[y][x][w], z); } for (int q = 1; q <= c; q++) { for (int k = 1; k <= n; k++) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { dist[i][j][q] = min(dist[i][j][q], dist[i][k][q] + dist[k][j][q]); } } } } vector<int> p(n + 1); for (int i = 1; i <= c; i++) { cin >> p[i]; } for (int i = 1; i <= c; i++) { vector<int> q(p[i]); for (int j = 1; j < p[i]; j++) { cin >> q[j]; } vector<long long> r(p[i] + 1, 0); for (int j = 1; j <= p[i]; j++) { cin >> r[j]; } for (int j = 1; j <= n; j++) { for (int k = 1; k <= n; k++) { long long dis = dist[j][k][i]; long long cost = 0; for (int l = 1; l <= p[i]; l++) { if (l == p[i]) { cost += r[l] * (dis - q[l - 1]); break; } if (dis <= q[l]) { cost += r[l] * (dis - q[l - 1]); break; } else { cost += r[l] * (q[l] - q[l - 1]); } } dp[j][k] = min(dp[j][k], cost); } } } for (int k = 1; k <= n; k++) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]); } } } if (dp[s][g] == inf) { dp[s][g] = -1; } return dp[s][g]; } int main() { int n, m, c, s, g; while (1) { cin >> n >> m >> c >> s >> g; if (n == 0) break; cout << solve(n, m, c, s, g) << endl; } return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define inf 1000000000000 long long dp[101][101]; long long dist[101][101][21]; long long solve(int n, int m, int c, int s, int g) { for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { dp[i][j] = inf; } } for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { for (int k = 0; k <= c; k++) { dist[i][j][k] = inf; if (i == j) { dist[i][j][k] = 0; } } } } long long x, y, z, w; for (int i = 0; i < m; i++) { cin >> x >> y >> z >> w; dist[x][y][w] = min(dist[x][y][w], z); dist[y][x][w] = min(dist[y][x][w], z); } for (int q = 1; q <= c; q++) { for (int k = 1; k <= n; k++) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { dist[i][j][q] = min(dist[i][j][q], dist[i][k][q] + dist[k][j][q]); } } } } vector<int> p(c + 1); for (int i = 1; i <= c; i++) { cin >> p[i]; } for (int i = 1; i <= c; i++) { vector<int> q(p[i]); for (int j = 1; j < p[i]; j++) { cin >> q[j]; } vector<long long> r(p[i] + 1, 0); for (int j = 1; j <= p[i]; j++) { cin >> r[j]; } for (int j = 1; j <= n; j++) { for (int k = 1; k <= n; k++) { long long dis = dist[j][k][i]; long long cost = 0; for (int l = 1; l <= p[i]; l++) { if (l == p[i]) { cost += r[l] * (dis - q[l - 1]); break; } if (dis <= q[l]) { cost += r[l] * (dis - q[l - 1]); break; } else { cost += r[l] * (q[l] - q[l - 1]); } } dp[j][k] = min(dp[j][k], cost); } } } for (int k = 1; k <= n; k++) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]); } } } if (dp[s][g] == inf) { dp[s][g] = -1; } return dp[s][g]; } int main() { int n, m, c, s, g; while (1) { cin >> n >> m >> c >> s >> g; if (n == 0) break; cout << solve(n, m, c, s, g) << endl; } return 0; }
replace
46
47
46
47
0
p00763
C++
Memory Limit Exceeded
// 考察 //?単純な場合を求める // ・(今いる頂点i, // 前使った鉄道の種類j, 種類jの鉄道を連続で使った距離k)が同じなら、合計運賃(コスト)は小さいほうがよい // ・でもこれを状態とすると、状態数はO(n * c * 合計距離MAX ), // 合計距離MAXは最悪1万は軽く超えるので、TLE&MLE不可避。 // ・経路中で用いられる鉄道の種類はたくさん&複雑 // ・一つの鉄道を使ってある地点からある地点へ行く最適な経路自体は、頂点だけを状態とした最短経路問題を解けば求まる。 // ↑の場合、今までの合計距離 = // 前に使った鉄道と同じ種類の鉄道を連続で用いた距離なので、状態が減る。 // ただし、このときのグラフは非連結になるかもしれないので、注意。どうせワーシャルフロイドするので問題ないけど。 // ちなみに、直接最小運賃を求めるのは難しいので一工夫する。 // 運賃は距離について単調増加だから、最短距離をワーシャルフロイドなどで求めてから、それを運賃に変換する。 //?実はこれが状態数増加の元凶!、元の問題を解く // さて、元のグラフについて考えてみる。元のグラフ中の経路でも、所詮は、”一つの鉄道をある頂点からある頂点まで使う”を繰り返している。 // 前に使った種類の鉄道を続けて使う場合を考えず、今いるノードで”必ず鉄道の種類を切り替える”すなわち”ここで小計運賃を精//算する”としても、よいのでは? // →ある地点からある地点まである鉄道だけを使って行くときの最小運賃が分かっていればできそう。(なんとなく) // そうすれば、状態としては、やはり”頂点”しか持たなくてよくなる。鉄道を切り替えるので、合計距離や前の鉄道の種類が // これからの合計運賃の増分に影響しないから。 // このようにすれば、?は全点対を各種鉄道について行うのでO(counter * n^3 + m) //?は、各頂点での遷移数がO(counter * n)あるので、 // priority_queueダイクストラならO(counter * n^2log(counter * // n^2))、queueダイクストラならO(counter * n^2) // で求まる。(?をpriority_queueで実装しても)多分間に合うし、メモリは大丈夫だろう。ワーシャルフロイドは定数軽いし… #include <cstdio> #include <functional> #include <iostream> #include <queue> #define int long long using namespace std; // 入力に関するもの。入力値の編集はこの中で・入力値はここから取得 class Input { public: int n, m, counter, s, g; int from[10000], to[10000], dist[10000], type[10000]; // 全部0-indexedに変換する int segNum[20]; // segNum[i] = 鉄道会社i(>=0)の距離→運賃グラフの折れ線の数 int seg[20][50]; // seg[][i] = 折れ線i(>=0)の終点(区切り) int toler[20][50]; // toler[][i] = 折れ線i(>=0)の公差(iについて単調減少) int feeTable[20][22001]; // feeTable[i][j] = // 鉄道会社iの鉄道を連続で距離jだけ使った時の料金 int superDist[20]; // superDist[i] = seg[i][segNum[i]-2] int superFeeConst[20], superFeeToler[20]; // 鉄道会社iの鉄道を連続で距離j(>superDist[i])だけ使った時の料金 // = superFeeConst[i] // + superFeeToler[i] * (j - // superDist[i]) bool input() { scanf("%d%d%d%d%d", &n, &m, &counter, &s, &g); s--; g--; if (n == 0) { return false; } for (int i = 0; i < m; i++) { scanf("%d%d%d%d", from + i, to + i, dist + i, type + i); from[i]--; to[i]--; type[i]--; } for (int i = 0; i < counter; i++) { scanf("%d", segNum + i); } for (int i = 0; i < counter; i++) { for (int j = 0; j < segNum[i] - 1; j++) { scanf("%d", seg[i] + j); } for (int j = 0; j < segNum[i]; j++) { scanf("%d", toler[i] + j); } } for (int i = 0; i < counter; i++) { feeTable[i][0] = 0; for (int k = 1; k <= seg[i][0]; k++) { feeTable[i][k] = feeTable[i][k - 1] + toler[i][0]; } for (int j = 1; j < segNum[i] - 1; j++) { for (int k = seg[i][j - 1] + 1; k <= seg[i][j]; k++) { feeTable[i][k] = feeTable[i][k - 1] + toler[i][j]; } } superDist[i] = seg[i][segNum[i] - 2]; superFeeConst[i] = feeTable[i][superDist[i]]; superFeeToler[i] = toler[i][segNum[i] - 1]; } return true; } }; // 解くもの(入力そのまま使いたいから入力系を継承する) class Solver : public Input { public: int costTable [20][101] [101]; // costTable[i][j][k] = // 種類iの鉄道だけで頂点jから頂点kまで行くのにかかる合計運賃の最小値 void initWorshal() { for (int i = 0; i < counter; i++) { for (int j = 0; j < n; j++) { for (int k = 0; k < n; k++) { costTable[i][j][k] = 1000000000; if (j == k) { costTable[i][j][k] = 0; } } } } for (int i = 0; i < m; i++) { costTable[type[i]][from[i]][to[i]] = min(dist[i], costTable[type[i]][from[i]][to[i]]); costTable[type[i]][to[i]][from[i]] = min(dist[i], costTable[type[i]][to[i]][from[i]]); } } void worshal() { for (int t = 0; t < counter; t++) { // 最短距離 for (int k = 0; k < n; ++k) // 中間ノード番号 for (int i = 0; i < n; ++i) // 始点ノード番号 for (int j = 0; j < n; ++j) // 終点ノード番号 costTable[t][i][j] = min(costTable[t][i][j], costTable[t][i][k] + costTable[t][k][j]); // 最小運賃への変換 for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int diff = costTable[t][i][j] - superDist[t]; if (diff < 0) { costTable[t][i][j] = feeTable[t][costTable[t][i][j]]; } else { costTable[t][i][j] = superFeeConst[t] + diff * superFeeToler[t]; } } } } } // priority_queueだと間に合わないらしい。 typedef pair<int, int> P; queue<P> que; int Dijkstra(int st, int ed) { int mincost[101]; for (int i = 0; i < n; i++) { mincost[i] = 1145141919; } que.push(P(0, st)); while (!que.empty()) { P now = que.front(); que.pop(); int sc = now.first; int v = now.second; if (mincost[v] <= sc) continue; mincost[v] = sc; for (int i = 0; i < counter; i++) { for (int j = 0; j < n; j++) { // if (mincost[j] > sc + costTable[i][v][j] ) { que.push(P(sc + costTable[i][v][j], j)); //} } } } return mincost[ed]; } int solve() { initWorshal(); worshal(); // このデバッグをした後、0-indexedと1-indexedを間違えていただけのバグを見つけたなんて言えない。 /*for (int i = 0; i < counter; i++) { for (int j = 1; j <= n; j++) { for (int k = 1; k <= n; k++) { if (costTable[i][j][k] >= 1000000000) printf("%4d", -1); else printf("%4d", costTable[i][j][k]); } printf("\n"); } printf("\n"); }*/ int res = Dijkstra(s, g); if (res >= 1000000000) return -1; return res; } } solver; signed main() { while (solver.input()) { int res = solver.solve(); cout << res << endl; } return 0; }
// 考察 //?単純な場合を求める // ・(今いる頂点i, // 前使った鉄道の種類j, 種類jの鉄道を連続で使った距離k)が同じなら、合計運賃(コスト)は小さいほうがよい // ・でもこれを状態とすると、状態数はO(n * c * 合計距離MAX ), // 合計距離MAXは最悪1万は軽く超えるので、TLE&MLE不可避。 // ・経路中で用いられる鉄道の種類はたくさん&複雑 // ・一つの鉄道を使ってある地点からある地点へ行く最適な経路自体は、頂点だけを状態とした最短経路問題を解けば求まる。 // ↑の場合、今までの合計距離 = // 前に使った鉄道と同じ種類の鉄道を連続で用いた距離なので、状態が減る。 // ただし、このときのグラフは非連結になるかもしれないので、注意。どうせワーシャルフロイドするので問題ないけど。 // ちなみに、直接最小運賃を求めるのは難しいので一工夫する。 // 運賃は距離について単調増加だから、最短距離をワーシャルフロイドなどで求めてから、それを運賃に変換する。 //?実はこれが状態数増加の元凶!、元の問題を解く // さて、元のグラフについて考えてみる。元のグラフ中の経路でも、所詮は、”一つの鉄道をある頂点からある頂点まで使う”を繰り返している。 // 前に使った種類の鉄道を続けて使う場合を考えず、今いるノードで”必ず鉄道の種類を切り替える”すなわち”ここで小計運賃を精//算する”としても、よいのでは? // →ある地点からある地点まである鉄道だけを使って行くときの最小運賃が分かっていればできそう。(なんとなく) // そうすれば、状態としては、やはり”頂点”しか持たなくてよくなる。鉄道を切り替えるので、合計距離や前の鉄道の種類が // これからの合計運賃の増分に影響しないから。 // このようにすれば、?は全点対を各種鉄道について行うのでO(counter * n^3 + m) //?は、各頂点での遷移数がO(counter * n)あるので、 // priority_queueダイクストラならO(counter * n^2log(counter * // n^2))、queueダイクストラならO(counter * n^2) // で求まる。(?をpriority_queueで実装しても)多分間に合うし、メモリは大丈夫だろう。ワーシャルフロイドは定数軽いし… #include <cstdio> #include <functional> #include <iostream> #include <queue> #define int long long using namespace std; // 入力に関するもの。入力値の編集はこの中で・入力値はここから取得 class Input { public: int n, m, counter, s, g; int from[10000], to[10000], dist[10000], type[10000]; // 全部0-indexedに変換する int segNum[20]; // segNum[i] = 鉄道会社i(>=0)の距離→運賃グラフの折れ線の数 int seg[20][50]; // seg[][i] = 折れ線i(>=0)の終点(区切り) int toler[20][50]; // toler[][i] = 折れ線i(>=0)の公差(iについて単調減少) int feeTable[20][22001]; // feeTable[i][j] = // 鉄道会社iの鉄道を連続で距離jだけ使った時の料金 int superDist[20]; // superDist[i] = seg[i][segNum[i]-2] int superFeeConst[20], superFeeToler[20]; // 鉄道会社iの鉄道を連続で距離j(>superDist[i])だけ使った時の料金 // = superFeeConst[i] // + superFeeToler[i] * (j - // superDist[i]) bool input() { scanf("%d%d%d%d%d", &n, &m, &counter, &s, &g); s--; g--; if (n == 0) { return false; } for (int i = 0; i < m; i++) { scanf("%d%d%d%d", from + i, to + i, dist + i, type + i); from[i]--; to[i]--; type[i]--; } for (int i = 0; i < counter; i++) { scanf("%d", segNum + i); } for (int i = 0; i < counter; i++) { for (int j = 0; j < segNum[i] - 1; j++) { scanf("%d", seg[i] + j); } for (int j = 0; j < segNum[i]; j++) { scanf("%d", toler[i] + j); } } for (int i = 0; i < counter; i++) { feeTable[i][0] = 0; for (int k = 1; k <= seg[i][0]; k++) { feeTable[i][k] = feeTable[i][k - 1] + toler[i][0]; } for (int j = 1; j < segNum[i] - 1; j++) { for (int k = seg[i][j - 1] + 1; k <= seg[i][j]; k++) { feeTable[i][k] = feeTable[i][k - 1] + toler[i][j]; } } superDist[i] = seg[i][segNum[i] - 2]; superFeeConst[i] = feeTable[i][superDist[i]]; superFeeToler[i] = toler[i][segNum[i] - 1]; } return true; } }; // 解くもの(入力そのまま使いたいから入力系を継承する) class Solver : public Input { public: int costTable [20][101] [101]; // costTable[i][j][k] = // 種類iの鉄道だけで頂点jから頂点kまで行くのにかかる合計運賃の最小値 void initWorshal() { for (int i = 0; i < counter; i++) { for (int j = 0; j < n; j++) { for (int k = 0; k < n; k++) { costTable[i][j][k] = 1000000000; if (j == k) { costTable[i][j][k] = 0; } } } } for (int i = 0; i < m; i++) { costTable[type[i]][from[i]][to[i]] = min(dist[i], costTable[type[i]][from[i]][to[i]]); costTable[type[i]][to[i]][from[i]] = min(dist[i], costTable[type[i]][to[i]][from[i]]); } } void worshal() { for (int t = 0; t < counter; t++) { // 最短距離 for (int k = 0; k < n; ++k) // 中間ノード番号 for (int i = 0; i < n; ++i) // 始点ノード番号 for (int j = 0; j < n; ++j) // 終点ノード番号 costTable[t][i][j] = min(costTable[t][i][j], costTable[t][i][k] + costTable[t][k][j]); // 最小運賃への変換 for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int diff = costTable[t][i][j] - superDist[t]; if (diff < 0) { costTable[t][i][j] = feeTable[t][costTable[t][i][j]]; } else { costTable[t][i][j] = superFeeConst[t] + diff * superFeeToler[t]; } } } } } // priority_queueだと間に合わないらしい。 typedef pair<int, int> P; queue<P> que; int Dijkstra(int st, int ed) { int mincost[101]; for (int i = 0; i < n; i++) { mincost[i] = 1145141919; } que.push(P(0, st)); while (!que.empty()) { P now = que.front(); que.pop(); int sc = now.first; int v = now.second; if (mincost[v] <= sc) continue; mincost[v] = sc; for (int i = 0; i < counter; i++) { for (int j = 0; j < n; j++) { // queue実装の場合は割と重要な枝刈り if (mincost[j] > sc + costTable[i][v][j]) { que.push(P(sc + costTable[i][v][j], j)); } } } } return mincost[ed]; } int solve() { initWorshal(); worshal(); // このデバッグをした後、0-indexedと1-indexedを間違えていただけのバグを見つけたなんて言えない。 /*for (int i = 0; i < counter; i++) { for (int j = 1; j <= n; j++) { for (int k = 1; k <= n; k++) { if (costTable[i][j][k] >= 1000000000) printf("%4d", -1); else printf("%4d", costTable[i][j][k]); } printf("\n"); } printf("\n"); }*/ int res = Dijkstra(s, g); if (res >= 1000000000) return -1; return res; } } solver; signed main() { while (solver.input()) { int res = solver.solve(); cout << res << endl; } return 0; }
replace
165
168
165
169
MLE
p00765
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_DEPRECATE #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> Pii; typedef pair<ll, ll> Pll; #define FOR(i, n) for (int i = 0; i < (n); i++) #define sz(c) ((int)(c).size()) #define ten(x) ((int)1e##x) #define tenll(x) ((ll)1e##x) // #pragma comment(linker,"/STACK:36777216") template <class T> void chmax(T &l, const T r) { l = max(l, r); } template <class T> void chmin(T &l, const T r) { l = min(l, r); } template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } template <class T> T extgcd(T a, T b, T &x, T &y) { for (T u = y = 1, v = x = 0; a;) { T q = b / a; swap(x -= q * u, u); swap(y -= q * v, v); swap(b -= q * a, a); } return b; } template <class T> T mod_inv(T a, T m) { T x, y; extgcd(a, m, x, y); return (m + x % m) % m; } ll mod_pow(ll a, ll n, ll mod) { ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; } #ifdef _WIN32 #define mygc(c) (c) = getchar() #define mypc(c) putchar(c) #else #define mygc(c) (c) = getchar_unlocked() #define mypc(c) putchar_unlocked(c) #endif void reader(int &x) { int k, m = 0; x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; } if ('0' <= k && k <= '9') { x = k - '0'; break; } } for (;;) { mygc(k); if (k < '0' || k > '9') break; x = x * 10 + k - '0'; } if (m) x = -x; } void reader(ll &x) { int k, m = 0; x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; } if ('0' <= k && k <= '9') { x = k - '0'; break; } } for (;;) { mygc(k); if (k < '0' || k > '9') break; x = x * 10 + k - '0'; } if (m) x = -x; } int reader(char c[]) { int i, s = 0; for (;;) { mygc(i); if (i != ' ' && i != '\n' && i != '\r' && i != '\t' && i != EOF) break; } c[s++] = i; for (;;) { mygc(i); if (i == ' ' || i == '\n' || i == '\r' || i == '\t' || i == EOF) break; c[s++] = i; } c[s] = '\0'; return s; } template <class T, class S> void reader(T &x, S &y) { reader(x); reader(y); } template <class T, class S, class U> void reader(T &x, S &y, U &z) { reader(x); reader(y); reader(z); } template <class T, class S, class U, class V> void reader(T &x, S &y, U &z, V &w) { reader(x); reader(y); reader(z); reader(w); } void writer(int x, char c) { int s = 0, m = 0; char f[10]; if (x < 0) m = 1, x = -x; while (x) f[s++] = x % 10, x /= 10; if (!s) f[s++] = 0; if (m) mypc('-'); while (s--) mypc(f[s] + '0'); mypc(c); } void writer(ll x, char c) { int s = 0, m = 0; char f[20]; if (x < 0) m = 1, x = -x; while (x) f[s++] = x % 10, x /= 10; if (!s) f[s++] = 0; if (m) mypc('-'); while (s--) mypc(f[s] + '0'); mypc(c); } void writer(const char c[]) { int i; for (i = 0; c[i] != '\0'; i++) mypc(c[i]); } void writer(const char x[], char c) { int i; for (i = 0; x[i] != '\0'; i++) mypc(x[i]); mypc(c); } template <class T> void writerLn(T x) { writer(x, '\n'); } template <class T, class S> void writerLn(T x, S y) { writer(x, ' '); writer(y, '\n'); } template <class T, class S, class U> void writerLn(T x, S y, U z) { writer(x, ' '); writer(y, ' '); writer(z, '\n'); } template <class T> void writerArr(T x[], int n) { if (!n) { mypc('\n'); return; } FOR(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); } template <class T> void writerArr(vector<T> &v) { if (sz(v)) writerArr(&v[0], sz(v)); else writer("\n"); } const int NCK = 500; double nck[NCK + 1][NCK + 1]; void calc_nck() { FOR(i, NCK) { nck[i][0] = nck[i][i] = 1; for (int j = 1; j <= i; j++) { nck[i + 1][j] = (nck[i][j - 1] + nck[i][j]); } } } int n, m, l; int pattern[3][7]; int ast; double ans; void check(const vector<vector<int>> &v) { int x[60] = {}; FOR(i, sz(v)) FOR(j, sz(v[i])) { x[i * 7 + j] = v[i][j]; } FOR(a, 50) FOR(b, 50) FOR(c, 50) { int y[60] = {}; FOR(i, 7) { y[a + i] += pattern[0][i]; y[b + i] += pattern[1][i]; y[c + i] += pattern[2][i]; } bool ok = true; FOR(i, 50) { if (x[i] < y[i]) { ok = false; break; } } if (ok) { double add = 1; int z = sz(v) - 1; for (auto &v1 : v) { z += sz(v1) - 1; for (auto i : v1) { add *= nck[n][i]; } } if (m - z <= 0) return; add *= nck[m - z][sz(v)]; ans += add; // if (add > 0) { // for (auto& v1 : v) { // printf("{"); // for (auto i : v1) { // printf("%d ", i); // } // printf("} "); // } // printf("%f\n", add); // } return; } } } void dfs(vector<vector<int>> &v, int rem) { if (rem == 0) { check(v); return; } if (sz(v.back()) != 0) { v.emplace_back(); dfs(v, rem); v.pop_back(); } FOR(i, rem) { if (i + 1 > n) break; v.back().push_back(i + 1); dfs(v, rem - i - 1); v.back().pop_back(); } } void solve() { vector<vector<int>> v(1); dfs(v, l); ans /= nck[n * m][l]; } int main() { calc_nck(); while (cin >> n >> m >> l, n) { ans = 0; ast = 0; memset(pattern, 0, sizeof(pattern)); FOR(i, l) { string s; cin >> s; if (s[0] != '*') pattern[s[0] - 'a'][sz(s) - 1]++; else ast++; } solve(); printf("%.10lf\n", ans); } }
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_DEPRECATE #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> Pii; typedef pair<ll, ll> Pll; #define FOR(i, n) for (int i = 0; i < (n); i++) #define sz(c) ((int)(c).size()) #define ten(x) ((int)1e##x) #define tenll(x) ((ll)1e##x) // #pragma comment(linker,"/STACK:36777216") template <class T> void chmax(T &l, const T r) { l = max(l, r); } template <class T> void chmin(T &l, const T r) { l = min(l, r); } template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } template <class T> T extgcd(T a, T b, T &x, T &y) { for (T u = y = 1, v = x = 0; a;) { T q = b / a; swap(x -= q * u, u); swap(y -= q * v, v); swap(b -= q * a, a); } return b; } template <class T> T mod_inv(T a, T m) { T x, y; extgcd(a, m, x, y); return (m + x % m) % m; } ll mod_pow(ll a, ll n, ll mod) { ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; } #ifdef _WIN32 #define mygc(c) (c) = getchar() #define mypc(c) putchar(c) #else #define mygc(c) (c) = getchar_unlocked() #define mypc(c) putchar_unlocked(c) #endif void reader(int &x) { int k, m = 0; x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; } if ('0' <= k && k <= '9') { x = k - '0'; break; } } for (;;) { mygc(k); if (k < '0' || k > '9') break; x = x * 10 + k - '0'; } if (m) x = -x; } void reader(ll &x) { int k, m = 0; x = 0; for (;;) { mygc(k); if (k == '-') { m = 1; break; } if ('0' <= k && k <= '9') { x = k - '0'; break; } } for (;;) { mygc(k); if (k < '0' || k > '9') break; x = x * 10 + k - '0'; } if (m) x = -x; } int reader(char c[]) { int i, s = 0; for (;;) { mygc(i); if (i != ' ' && i != '\n' && i != '\r' && i != '\t' && i != EOF) break; } c[s++] = i; for (;;) { mygc(i); if (i == ' ' || i == '\n' || i == '\r' || i == '\t' || i == EOF) break; c[s++] = i; } c[s] = '\0'; return s; } template <class T, class S> void reader(T &x, S &y) { reader(x); reader(y); } template <class T, class S, class U> void reader(T &x, S &y, U &z) { reader(x); reader(y); reader(z); } template <class T, class S, class U, class V> void reader(T &x, S &y, U &z, V &w) { reader(x); reader(y); reader(z); reader(w); } void writer(int x, char c) { int s = 0, m = 0; char f[10]; if (x < 0) m = 1, x = -x; while (x) f[s++] = x % 10, x /= 10; if (!s) f[s++] = 0; if (m) mypc('-'); while (s--) mypc(f[s] + '0'); mypc(c); } void writer(ll x, char c) { int s = 0, m = 0; char f[20]; if (x < 0) m = 1, x = -x; while (x) f[s++] = x % 10, x /= 10; if (!s) f[s++] = 0; if (m) mypc('-'); while (s--) mypc(f[s] + '0'); mypc(c); } void writer(const char c[]) { int i; for (i = 0; c[i] != '\0'; i++) mypc(c[i]); } void writer(const char x[], char c) { int i; for (i = 0; x[i] != '\0'; i++) mypc(x[i]); mypc(c); } template <class T> void writerLn(T x) { writer(x, '\n'); } template <class T, class S> void writerLn(T x, S y) { writer(x, ' '); writer(y, '\n'); } template <class T, class S, class U> void writerLn(T x, S y, U z) { writer(x, ' '); writer(y, ' '); writer(z, '\n'); } template <class T> void writerArr(T x[], int n) { if (!n) { mypc('\n'); return; } FOR(i, n - 1) writer(x[i], ' '); writer(x[n - 1], '\n'); } template <class T> void writerArr(vector<T> &v) { if (sz(v)) writerArr(&v[0], sz(v)); else writer("\n"); } const int NCK = 500; double nck[NCK + 1][NCK + 1]; void calc_nck() { FOR(i, NCK) { nck[i][0] = nck[i][i] = 1; for (int j = 1; j <= i; j++) { nck[i + 1][j] = (nck[i][j - 1] + nck[i][j]); } } } int n, m, l; int pattern[3][7]; int ast; double ans; void check(const vector<vector<int>> &v) { int x[60] = {}; int mx = 0; FOR(i, sz(v)) { FOR(j, sz(v[i])) { x[mx++] = v[i][j]; } mx++; } FOR(a, mx) FOR(b, mx) FOR(c, mx) { int y[60] = {}; FOR(i, 7) { y[a + i] += pattern[0][i]; y[b + i] += pattern[1][i]; y[c + i] += pattern[2][i]; } bool ok = true; FOR(i, 50) { if (x[i] < y[i]) { ok = false; break; } } if (ok) { double add = 1; int z = sz(v) - 1; for (auto &v1 : v) { z += sz(v1) - 1; for (auto i : v1) { add *= nck[n][i]; } } if (m - z <= 0) return; add *= nck[m - z][sz(v)]; ans += add; // if (add > 0) { // for (auto& v1 : v) { // printf("{"); // for (auto i : v1) { // printf("%d ", i); // } // printf("} "); // } // printf("%f\n", add); // } return; } } } void dfs(vector<vector<int>> &v, int rem) { if (rem == 0) { check(v); return; } if (sz(v.back()) != 0) { v.emplace_back(); dfs(v, rem); v.pop_back(); } FOR(i, rem) { if (i + 1 > n) break; v.back().push_back(i + 1); dfs(v, rem - i - 1); v.back().pop_back(); } } void solve() { vector<vector<int>> v(1); dfs(v, l); ans /= nck[n * m][l]; } int main() { calc_nck(); while (cin >> n >> m >> l, n) { ans = 0; ast = 0; memset(pattern, 0, sizeof(pattern)); FOR(i, l) { string s; cin >> s; if (s[0] != '*') pattern[s[0] - 'a'][sz(s) - 1]++; else ast++; } solve(); printf("%.10lf\n", ans); } }
replace
247
249
247
253
TLE
p00766
C++
Memory Limit Exceeded
#include <algorithm> #include <complex> #include <cstring> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; int dx[] = {-1, 0, 1, 0, -1, 0, 1, 0}; int dy[] = {0, -1, 0, -1, 0, 1, 0, 1}; int nx[] = {0, 1, 0, 1}; int ny[] = {0, 0, 1, 1}; typedef complex<double> point; struct line : public vector<point> { line() {} line(const point &a, const point &b) { push_back(a); push_back(b); } }; namespace std { bool operator<(const point &a, const point &b) { return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag(); } } // namespace std const double eps = 1e-10; double dot(const point &a, const point &b) { return (a * conj(b)).real(); } double cross(const point &a, const point &b) { return (conj(a) * b).imag(); } point unit(const point &v) { return v / abs(v); } point vec(const line &l) { return l[1] - l[0]; } int ccw(const point &a, const point &b, const point &c) { point u = b - a, v = c - a; if (cross(u, v) > 0) return +1; if (cross(u, v) < 0) return -1; if (dot(u, v) < 0) return +2; if (norm(u) < norm(v)) return -2; return 0; } int ccw(const line &s, const point &p) { return ccw(s[0], s[1], p); } bool contain(const line &s, const line &t) { return abs(s[0] - t[0]) < eps || abs(s[0] - t[1]) < eps || abs(s[1] - t[0]) < eps || abs(s[1] - t[1]) < eps; } bool intersectSS(const line &s, const line &t) { return ccw(s, t[0]) * ccw(s, t[1]) <= 0 && ccw(t, s[0]) * ccw(t, s[1]) <= 0; } typedef vector<vector<int>> Graph; int flow[5500][5500]; bool dfs(int p, int T, Graph &graph, vector<int> &level, vector<bool> &finished) { if (p == T) return true; if (finished[p]) return false; finished[p] = true; for (int i = 0; i < graph[p].size(); i++) { int next = graph[p][i]; if (level[p] >= level[next]) continue; if (flow[p][next]) continue; if (dfs(next, T, graph, level, finished)) { finished[p] = false; flow[p][next] += 1; flow[next][p] -= 1; return true; } } return false; } int dinic(int S, int T, Graph &graph) { bool end = false; int total = 0; while (!end) { end = true; vector<int> level(graph.size(), -1); level[S] = 0; queue<int> q; q.push(S); while (!q.empty()) { int n = q.front(); q.pop(); for (int i = 0; i < graph[n].size(); i++) { int next = graph[n][i]; if (level[next] != -1) continue; if (flow[n][next]) continue; level[next] = level[n] + 1; q.push(next); } } if (level[T] == -1) break; vector<bool> finished(graph.size()); while (dfs(S, T, graph, level, finished)) { total++; end = false; } } return total; } void add_edge(int s, int d, Graph &g) { g[s].push_back(d); g[d].push_back(s); flow[s][d] = 0; flow[d][s] = 1; } int main() { int H, W; while (cin >> H >> W, (H || W)) { vector<string> choco(H); for (int i = 0; i < H; ++i) { cin >> choco[i]; } int N = 0; vector<vector<int>> vert(W + 1), hori(H + 1); for (int i = 0; i < H; i++) for (int j = 0; j < W; j++) { if (choco[i][j] != '.') continue; for (int k = 0; k < 4; k++) { bool ok = true; for (int l = 0; l < 2; l++) { int nx = j + dx[2 * k + l]; int ny = i + dy[2 * k + l]; if (nx < 0 || ny < 0 || nx >= W || ny >= H) { ok = false; break; } if (choco[ny][nx] != '#') { ok = false; break; } } if (ok) { hori[i + ny[k]].push_back(j + nx[k]); vert[j + nx[k]].push_back(i + ny[k]); N++; } } } for (int i = 0; i < H + 1; i++) { sort(hori[i].begin(), hori[i].end()); } for (int i = 0; i < W + 1; i++) sort(vert[i].begin(), vert[i].end()); vector<line> l, r; for (int i = 0; i < H + 1; i++) { int S = hori[i].size(); for (int j = 0; j < S - 1; j++) { bool c[2] = {0}; for (int k = hori[i][j]; k < hori[i][j + 1]; k++) { if (choco[i - 1][k] != '#') c[0] = true; if (choco[i][k] != '#') c[1] = true; } if (!c[0] && !c[1]) { l.push_back(line(point(hori[i][j], i), point(hori[i][j + 1], i))); } } } for (int i = 0; i < W + 1; i++) { int S = vert[i].size(); for (int j = 0; j < S - 1; j++) { bool c[2] = {0}; for (int k = vert[i][j]; k < vert[i][j + 1]; k++) { if (choco[k][i - 1] != '#') c[0] = true; if (choco[k][i] != '#') c[1] = true; } if (!c[0] && !c[1]) { r.push_back(line(point(i, vert[i][j]), point(i, vert[i][j + 1]))); } } } memset(flow, 0, sizeof(flow)); int M = l.size() + r.size(); Graph graph(M + 2); for (int i = 0; i < l.size(); i++) add_edge(M, i, graph); for (int i = 0; i < r.size(); i++) add_edge(i + l.size(), M + 1, graph); for (int i = 0; i < l.size(); i++) for (int j = 0; j < r.size(); j++) { if (intersectSS(l[i], r[j])) { int u = i, v = j + l.size(); add_edge(u, v, graph); } } cout << N - (M - dinic(M, M + 1, graph)) + 1 << endl; } return 0; }
#include <algorithm> #include <complex> #include <cstring> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; int dx[] = {-1, 0, 1, 0, -1, 0, 1, 0}; int dy[] = {0, -1, 0, -1, 0, 1, 0, 1}; int nx[] = {0, 1, 0, 1}; int ny[] = {0, 0, 1, 1}; typedef complex<double> point; struct line : public vector<point> { line() {} line(const point &a, const point &b) { push_back(a); push_back(b); } }; namespace std { bool operator<(const point &a, const point &b) { return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag(); } } // namespace std const double eps = 1e-10; double dot(const point &a, const point &b) { return (a * conj(b)).real(); } double cross(const point &a, const point &b) { return (conj(a) * b).imag(); } point unit(const point &v) { return v / abs(v); } point vec(const line &l) { return l[1] - l[0]; } int ccw(const point &a, const point &b, const point &c) { point u = b - a, v = c - a; if (cross(u, v) > 0) return +1; if (cross(u, v) < 0) return -1; if (dot(u, v) < 0) return +2; if (norm(u) < norm(v)) return -2; return 0; } int ccw(const line &s, const point &p) { return ccw(s[0], s[1], p); } bool contain(const line &s, const line &t) { return abs(s[0] - t[0]) < eps || abs(s[0] - t[1]) < eps || abs(s[1] - t[0]) < eps || abs(s[1] - t[1]) < eps; } bool intersectSS(const line &s, const line &t) { return ccw(s, t[0]) * ccw(s, t[1]) <= 0 && ccw(t, s[0]) * ccw(t, s[1]) <= 0; } typedef vector<vector<int>> Graph; char flow[5500][5500]; bool dfs(int p, int T, Graph &graph, vector<int> &level, vector<bool> &finished) { if (p == T) return true; if (finished[p]) return false; finished[p] = true; for (int i = 0; i < graph[p].size(); i++) { int next = graph[p][i]; if (level[p] >= level[next]) continue; if (flow[p][next]) continue; if (dfs(next, T, graph, level, finished)) { finished[p] = false; flow[p][next] += 1; flow[next][p] -= 1; return true; } } return false; } int dinic(int S, int T, Graph &graph) { bool end = false; int total = 0; while (!end) { end = true; vector<int> level(graph.size(), -1); level[S] = 0; queue<int> q; q.push(S); while (!q.empty()) { int n = q.front(); q.pop(); for (int i = 0; i < graph[n].size(); i++) { int next = graph[n][i]; if (level[next] != -1) continue; if (flow[n][next]) continue; level[next] = level[n] + 1; q.push(next); } } if (level[T] == -1) break; vector<bool> finished(graph.size()); while (dfs(S, T, graph, level, finished)) { total++; end = false; } } return total; } void add_edge(int s, int d, Graph &g) { g[s].push_back(d); g[d].push_back(s); flow[s][d] = 0; flow[d][s] = 1; } int main() { int H, W; while (cin >> H >> W, (H || W)) { vector<string> choco(H); for (int i = 0; i < H; ++i) { cin >> choco[i]; } int N = 0; vector<vector<int>> vert(W + 1), hori(H + 1); for (int i = 0; i < H; i++) for (int j = 0; j < W; j++) { if (choco[i][j] != '.') continue; for (int k = 0; k < 4; k++) { bool ok = true; for (int l = 0; l < 2; l++) { int nx = j + dx[2 * k + l]; int ny = i + dy[2 * k + l]; if (nx < 0 || ny < 0 || nx >= W || ny >= H) { ok = false; break; } if (choco[ny][nx] != '#') { ok = false; break; } } if (ok) { hori[i + ny[k]].push_back(j + nx[k]); vert[j + nx[k]].push_back(i + ny[k]); N++; } } } for (int i = 0; i < H + 1; i++) { sort(hori[i].begin(), hori[i].end()); } for (int i = 0; i < W + 1; i++) sort(vert[i].begin(), vert[i].end()); vector<line> l, r; for (int i = 0; i < H + 1; i++) { int S = hori[i].size(); for (int j = 0; j < S - 1; j++) { bool c[2] = {0}; for (int k = hori[i][j]; k < hori[i][j + 1]; k++) { if (choco[i - 1][k] != '#') c[0] = true; if (choco[i][k] != '#') c[1] = true; } if (!c[0] && !c[1]) { l.push_back(line(point(hori[i][j], i), point(hori[i][j + 1], i))); } } } for (int i = 0; i < W + 1; i++) { int S = vert[i].size(); for (int j = 0; j < S - 1; j++) { bool c[2] = {0}; for (int k = vert[i][j]; k < vert[i][j + 1]; k++) { if (choco[k][i - 1] != '#') c[0] = true; if (choco[k][i] != '#') c[1] = true; } if (!c[0] && !c[1]) { r.push_back(line(point(i, vert[i][j]), point(i, vert[i][j + 1]))); } } } memset(flow, 0, sizeof(flow)); int M = l.size() + r.size(); Graph graph(M + 2); for (int i = 0; i < l.size(); i++) add_edge(M, i, graph); for (int i = 0; i < r.size(); i++) add_edge(i + l.size(), M + 1, graph); for (int i = 0; i < l.size(); i++) for (int j = 0; j < r.size(); j++) { if (intersectSS(l[i], r[j])) { int u = i, v = j + l.size(); add_edge(u, v, graph); } } cout << N - (M - dinic(M, M + 1, graph)) + 1 << endl; } return 0; }
replace
62
63
62
63
MLE
p00767
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define reep(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) reep((i), 0, (n)) typedef pair<int, int> pii; typedef pair<int, pii> P; int main() { int h, w; while (cin >> h >> w, h || w) { P in = make_pair(w * w + h * h, pii(h, w)); P ans = make_pair(1e9, pii(100000, 100000)); reep(i, 1, 10000) { reep(j, i + 1, 10000) { P tmp = make_pair(i * i + j * j, pii(i, j)); if (tmp > in) { ans = min(ans, tmp); } } } cout << ans.second.first << " " << ans.second.second << endl; } }
#include <bits/stdc++.h> using namespace std; #define reep(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) reep((i), 0, (n)) typedef pair<int, int> pii; typedef pair<int, pii> P; int main() { int h, w; while (cin >> h >> w, h || w) { P in = make_pair(w * w + h * h, pii(h, w)); P ans = make_pair(1e9, pii(100000, 100000)); reep(i, 1, 1000) { reep(j, i + 1, 1000) { P tmp = make_pair(i * i + j * j, pii(i, j)); if (tmp > in) { ans = min(ans, tmp); } } } cout << ans.second.first << " " << ans.second.second << endl; } }
replace
13
15
13
15
TLE
p00767
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define INF 1e9 int len(int i, int j) { int res = i * i + j * j; return res; } signed main() { ios::sync_with_stdio(false); cin.tie(0); while (1) { int h, w; cin >> h >> w; int L = len(h, w); pair<int, int> ans = {10000, 10000}; for (int i = 1; i < 1000; i++) { for (int j = i + 1; j < 1000; j++) { if (i == h && j == w) continue; int LL = len(i, j); if (LL == L && i < h) continue; if (LL >= L && LL < len(ans.first, ans.second)) { ans = {i, j}; } } } cout << ans.first << " " << ans.second << endl; } }
#include <bits/stdc++.h> using namespace std; #define INF 1e9 int len(int i, int j) { int res = i * i + j * j; return res; } signed main() { ios::sync_with_stdio(false); cin.tie(0); while (1) { int h, w; cin >> h >> w; if (h == 0) break; int L = len(h, w); pair<int, int> ans = {10000, 10000}; for (int i = 1; i < 1000; i++) { for (int j = i + 1; j < 1000; j++) { if (i == h && j == w) continue; int LL = len(i, j); if (LL == L && i < h) continue; if (LL >= L && LL < len(ans.first, ans.second)) { ans = {i, j}; } } } cout << ans.first << " " << ans.second << endl; } }
insert
18
18
18
21
TLE
p00768
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct Info { int id, cost, ac; }; bool operator<(const Info &a, const Info &b) { if (a.ac != b.ac) return a.ac > b.ac; if (a.cost != b.cost) return a.cost < b.cost; return a.id > b.id; } int main() { int M, T, P, R; while (cin >> M >> T >> P >> R) { if (M == 0) break; vector<vector<int>> num_WA(T, vector<int>(P, 0)); vector<int> cost(T, 0); vector<int> num_AC(T, 0); for (int i = 0; i < R; i++) { int m, t, p, j; cin >> m >> t >> p >> j; t--; if (j == 0) { cost[t] += m + num_WA[t][p] * 20; num_AC[t]++; } else { num_WA[t][p]++; } } vector<Info> temp; for (int i = 0; i < T; i++) { Info hoge; hoge.cost = cost[i]; hoge.id = i + 1; hoge.ac = num_AC[i]; temp.push_back(hoge); } sort(temp.begin(), temp.end()); int bef_ac = 0, bef_cost = 0; for (int i = 0; i < temp.size(); i++) { if (i != 0) { if (bef_ac == temp[i].ac && bef_cost == temp[i].cost) { cout << "="; } else cout << ","; } cout << temp[i].id; bef_ac = temp[i].ac; bef_cost = temp[i].cost; } cout << endl; } return 0; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct Info { int id, cost, ac; }; bool operator<(const Info &a, const Info &b) { if (a.ac != b.ac) return a.ac > b.ac; if (a.cost != b.cost) return a.cost < b.cost; return a.id > b.id; } int main() { int M, T, P, R; while (cin >> M >> T >> P >> R) { if (M == 0) break; vector<vector<int>> num_WA(T, vector<int>(P, 0)); vector<int> cost(T, 0); vector<int> num_AC(T, 0); for (int i = 0; i < R; i++) { int m, t, p, j; cin >> m >> t >> p >> j; t--; p--; if (j == 0) { cost[t] += m + num_WA[t][p] * 20; num_AC[t]++; } else { num_WA[t][p]++; } } vector<Info> temp; for (int i = 0; i < T; i++) { Info hoge; hoge.cost = cost[i]; hoge.id = i + 1; hoge.ac = num_AC[i]; temp.push_back(hoge); } sort(temp.begin(), temp.end()); int bef_ac = 0, bef_cost = 0; for (int i = 0; i < temp.size(); i++) { if (i != 0) { if (bef_ac == temp[i].ac && bef_cost == temp[i].cost) { cout << "="; } else cout << ","; } cout << temp[i].id; bef_ac = temp[i].ac; bef_cost = temp[i].cost; } cout << endl; } return 0; }
insert
29
29
29
30
0
p00768
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; class team { public: int num, ans, time; team(int n) { num = n; ans = time = 0; } bool operator<(const team &t2) const { if (ans != t2.ans) return ans > t2.ans; else if (time != t2.time) return time < t2.time; else return num > t2.num; } }; int main() { int M, T, P, R, m[2001], t[2001], p[2001], r[2001], before; while (cin >> M >> T >> P >> R, (M || T || P || R)) { vector<team> v; vector<team>::iterator pv; // 入力 for (int i = 0; i < R; i++) { cin >> m[i] >> t[i] >> p[i] >> r[i]; } // 各チームの時間 for (int i = 1; i <= T; i++) { team te = team(i); for (int j = 0; j < R; j++) { // 正解時間の計算 if (t[j] == i && r[j] == 0) { te.time += m[j]; te.ans++; // 以前のペナルティを計算 for (int k = 0; k < j; k++) { if (t[k] == i && p[k] == p[j]) { te.time += 20; } } } } v.push_back(te); } // ソート sort(v.begin(), v.end()); pv = v.begin(); before = -1; while (pv != v.end()) { if (before == pv->time) cout << "=" << pv->num; else { if (pv == v.begin()) cout << pv->num; else cout << "," << pv->num; before = pv->time; } pv++; } cout << endl; v.~vector(); } return 0; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; class team { public: int num, ans, time; team(int n) { num = n; ans = time = 0; } bool operator<(const team &t2) const { if (ans != t2.ans) return ans > t2.ans; else if (time != t2.time) return time < t2.time; else return num > t2.num; } }; int main() { int M, T, P, R, m[2001], t[2001], p[2001], r[2001], before; while (cin >> M >> T >> P >> R, (M || T || P || R)) { vector<team> v; vector<team>::iterator pv; // 入力 for (int i = 0; i < R; i++) { cin >> m[i] >> t[i] >> p[i] >> r[i]; } // 各チームの時間 for (int i = 1; i <= T; i++) { team te = team(i); for (int j = 0; j < R; j++) { // 正解時間の計算 if (t[j] == i && r[j] == 0) { te.time += m[j]; te.ans++; // 以前のペナルティを計算 for (int k = 0; k < j; k++) { if (t[k] == i && p[k] == p[j]) { te.time += 20; } } } } v.push_back(te); } // ソート sort(v.begin(), v.end()); pv = v.begin(); before = -1; while (pv != v.end()) { if (before == pv->time) cout << "=" << pv->num; else { if (pv == v.begin()) cout << pv->num; else cout << "," << pv->num; before = pv->time; } pv++; } cout << endl; } return 0; }
delete
68
69
68
68
-6
free(): double free detected in tcache 2
p00768
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; void swapp(int *, int *); int main() { while (1) { int M, T, P, R; cin >> M >> T >> P >> R; if (M == 0 && T == 0 && P == 0 && R == 0) break; int te[51]; int tr[51]; int tp[51] = {}; int tt[51] = {}; vector<vector<int>> ts(T + 1, vector<int>(P, 0)); for (int i = 0; i < R; i++) { int m, t, p, j; cin >> m >> t >> p >> j; if (j == 0) { tt[t] += ts[t][p] + m; tp[t]++; } else { ts[t][p] += 20; } } for (int i = 1; i <= T; i++) { // // cout << i<<" "<<tp[i]<< " "<< tt[i]<<endl; // tr[i] = i; te[i] = 0; } // sort for (int i = 1; i <= T; i++) { for (int j = 1; j < T; j++) { if (tp[j] < tp[j + 1]) { // cout << tr[j]<<" "<<tr[j+1]<<endl; swapp(tr + j, tr + j + 1); swapp(te + j, te + j + 1); swapp(tt + j, tt + j + 1); swapp(tp + j, tp + j + 1); // cout << tr[j]<<" "<<tr[j+1]<<endl; } else if (tp[j] == tp[j + 1]) { if (tt[j] > tt[j + 1]) { swapp(tr + j, tr + j + 1); swapp(te + j, te + j + 1); swapp(tt + j, tt + j + 1); swapp(tp + j, tp + j + 1); } else if (tt[j] == tt[j + 1]) { if (tr[j] < tr[j + 1]) { swapp(tr + j, tr + j + 1); swapp(te + j, te + j + 1); swapp(tt + j, tt + j + 1); swapp(tp + j, tp + j + 1); } te[j] = 1; } } } } // for(int i=1;i<=T;i++) cout << i<<" "<<tp[i]<< " "<< tt[i]<<endl; for (int i = 1; i <= T; i++) { cout << tr[i]; if (i < T) { if (te[i] == 1) { cout << '='; } else cout << ','; } } cout << endl; } return 0; } void swapp(int *m, int *a) { int b; b = *m; *m = *a; *a = b; return; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; void swapp(int *, int *); int main() { while (1) { int M, T, P, R; cin >> M >> T >> P >> R; if (M == 0 && T == 0 && P == 0 && R == 0) break; int te[51]; int tr[51]; int tp[51] = {}; int tt[51] = {}; vector<vector<int>> ts(T + 1, vector<int>(P + 1, 0)); for (int i = 0; i < R; i++) { int m, t, p, j; cin >> m >> t >> p >> j; if (j == 0) { tt[t] += ts[t][p] + m; tp[t]++; } else { ts[t][p] += 20; } } for (int i = 1; i <= T; i++) { // // cout << i<<" "<<tp[i]<< " "<< tt[i]<<endl; // tr[i] = i; te[i] = 0; } // sort for (int i = 1; i <= T; i++) { for (int j = 1; j < T; j++) { if (tp[j] < tp[j + 1]) { // cout << tr[j]<<" "<<tr[j+1]<<endl; swapp(tr + j, tr + j + 1); swapp(te + j, te + j + 1); swapp(tt + j, tt + j + 1); swapp(tp + j, tp + j + 1); // cout << tr[j]<<" "<<tr[j+1]<<endl; } else if (tp[j] == tp[j + 1]) { if (tt[j] > tt[j + 1]) { swapp(tr + j, tr + j + 1); swapp(te + j, te + j + 1); swapp(tt + j, tt + j + 1); swapp(tp + j, tp + j + 1); } else if (tt[j] == tt[j + 1]) { if (tr[j] < tr[j + 1]) { swapp(tr + j, tr + j + 1); swapp(te + j, te + j + 1); swapp(tt + j, tt + j + 1); swapp(tp + j, tp + j + 1); } te[j] = 1; } } } } // for(int i=1;i<=T;i++) cout << i<<" "<<tp[i]<< " "<< tt[i]<<endl; for (int i = 1; i <= T; i++) { cout << tr[i]; if (i < T) { if (te[i] == 1) { cout << '='; } else cout << ','; } } cout << endl; } return 0; } void swapp(int *m, int *a) { int b; b = *m; *m = *a; *a = b; return; }
replace
15
16
15
16
0
p00768
C++
Runtime Error
/* * * */ #include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) // #define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort(ALL(c)) #define RSORT(c) sort(RALL(c)) #define SQ(n) (n) * (n) typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<char> vc; typedef vector<pii> vpi; typedef vector<pll> vpl; typedef vector<ll> vll; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vc> vvc; typedef vector<vll> vvll; struct Team { int correct; int penalty; int vpenalty[10]; int id; bool operator<(const Team &p) const { if (correct == p.correct) if (penalty == p.penalty) return id < p.id; else return penalty > p.penalty; else return correct < p.correct; } bool operator==(const Team &p) const { if (correct == p.correct) return penalty == p.penalty; else return correct == p.correct; } }; int main() { int M, T, P, R; while (cin >> M >> T >> P >> R) { vector<Team> team(T); REP(i, T) { team[i].id = i + 1; } REP(i, R) { int m, t, p, j; cin >> m >> t >> p >> j; t--; p--; if (j) { team[t].vpenalty[p] += 20; } else { team[t].correct++; team[t].penalty += m + team[t].vpenalty[p]; } } RSORT(team); cout << team[0].id; FOR(i, 1, T) { if (team[i - 1] == team[i]) cout << '='; else cout << ','; cout << team[i].id; } cout << endl; } }
/* * * */ #include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) // #define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define RREP(i, n) for (int i = (int)(n - 1); i >= 0; --i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort(ALL(c)) #define RSORT(c) sort(RALL(c)) #define SQ(n) (n) * (n) typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<char> vc; typedef vector<pii> vpi; typedef vector<pll> vpl; typedef vector<ll> vll; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vc> vvc; typedef vector<vll> vvll; struct Team { int correct; int penalty; int vpenalty[10]; int id; bool operator<(const Team &p) const { if (correct == p.correct) if (penalty == p.penalty) return id < p.id; else return penalty > p.penalty; else return correct < p.correct; } bool operator==(const Team &p) const { if (correct == p.correct) return penalty == p.penalty; else return correct == p.correct; } }; int main() { int M, T, P, R; while (cin >> M >> T >> P >> R, M | T | P | R) { vector<Team> team(T); REP(i, T) { team[i].id = i + 1; } REP(i, R) { int m, t, p, j; cin >> m >> t >> p >> j; t--; p--; if (j) { team[t].vpenalty[p] += 20; } else { team[t].correct++; team[t].penalty += m + team[t].vpenalty[p]; } } RSORT(team); cout << team[0].id; FOR(i, 1, T) { if (team[i - 1] == team[i]) cout << '='; else cout << ','; cout << team[i].id; } cout << endl; } }
replace
62
63
62
63
-11
p00768
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(x) (x).begin(), (x).end() using namespace std; int main() { int M, T, P, R; while (true) { cin >> M >> T >> P >> R; if (M == 0) return 0; vector<int> m(R), t(R), p(R), j(R); REP(i, R) { cin >> m[i] >> t[i] >> p[i] >> j[i]; t[i]--; } vector<vector<int>> pena(T, vector<int>(P)); vector<vector<int>> score(T, vector<int>(2)); // seikai,jikan REP(i, R) { if (j[i] == 0) { score[t[i]][0]++; score[t[i]][1] += pena[t[i]][p[i]] + m[i]; } pena[t[i]][p[i]] += 20; } vector<tuple<int, int, int>> tupleScore(T); REP(i, T) { tupleScore[i] = make_tuple(-score[i][0], score[i][1], -1 - i); } sort(ALL(tupleScore)); int top; tie(ignore, ignore, top) = tupleScore[0]; cout << -top; REP(i, T - 1) { int ans1, tim1, ans2, tim2; tie(ans1, tim1, ignore) = tupleScore[i]; tie(ans2, tim2, top) = tupleScore[i + 1]; if (ans1 == ans2 && tim1 == tim2) { cout << "=" << -top; } else { cout << "," << -top; } } cout << endl; } return 0; }
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(x) (x).begin(), (x).end() using namespace std; int main() { int M, T, P, R; while (true) { cin >> M >> T >> P >> R; if (M == 0) return 0; vector<int> m(R), t(R), p(R), j(R); REP(i, R) { cin >> m[i] >> t[i] >> p[i] >> j[i]; t[i]--; p[i]--; } vector<vector<int>> pena(T, vector<int>(P)); vector<vector<int>> score(T, vector<int>(2)); // seikai,jikan REP(i, R) { if (j[i] == 0) { score[t[i]][0]++; score[t[i]][1] += pena[t[i]][p[i]] + m[i]; } pena[t[i]][p[i]] += 20; } vector<tuple<int, int, int>> tupleScore(T); REP(i, T) { tupleScore[i] = make_tuple(-score[i][0], score[i][1], -1 - i); } sort(ALL(tupleScore)); int top; tie(ignore, ignore, top) = tupleScore[0]; cout << -top; REP(i, T - 1) { int ans1, tim1, ans2, tim2; tie(ans1, tim1, ignore) = tupleScore[i]; tie(ans2, tim2, top) = tupleScore[i + 1]; if (ans1 == ans2 && tim1 == tim2) { cout << "=" << -top; } else { cout << "," << -top; } } cout << endl; } return 0; }
insert
17
17
17
18
0
p00768
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int M, T, P, R; while (scanf("%d %d %d %d", &M, &T, &P, &R) && M) { vector<pair<pair<int, int>, int>> record(T); int wa[16][64] = {0}; for (int i = 0; i < T; i++) record[i].second = -(i + 1); for (int i = 0; i < R; i++) { int m, t, p, j; scanf("%d %d %d %d", &m, &t, &p, &j); if (j) wa[t - 1][p] += 20; else { record[t - 1].first.first--; record[t - 1].first.second += m + wa[t - 1][p]; } } sort(record.begin(), record.end()); for (int i = 0; i < T; i++) { printf("%d", -record[i].second); if (i + 1 < T && record[i].first == record[i + 1].first) printf("="); else if (i + 1 < T) printf(","); else printf("\n"); } } return (0); }
#include <bits/stdc++.h> using namespace std; int main() { int M, T, P, R; while (scanf("%d %d %d %d", &M, &T, &P, &R) && M) { vector<pair<pair<int, int>, int>> record(T); int wa[64][16] = {0}; for (int i = 0; i < T; i++) record[i].second = -(i + 1); for (int i = 0; i < R; i++) { int m, t, p, j; scanf("%d %d %d %d", &m, &t, &p, &j); if (j) wa[t - 1][p] += 20; else { record[t - 1].first.first--; record[t - 1].first.second += m + wa[t - 1][p]; } } sort(record.begin(), record.end()); for (int i = 0; i < T; i++) { printf("%d", -record[i].second); if (i + 1 < T && record[i].first == record[i + 1].first) printf("="); else if (i + 1 < T) printf(","); else printf("\n"); } } return (0); }
replace
9
10
9
10
0
p00768
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; #define reps(i, f, n) for (int i = f; i < int(n); i++) #define rep(i, n) reps(i, 0, n) typedef pair<int, int> pii; typedef pair<pii, int> piii; piii mk(int a, int b, int c) { return piii(pii(a, b), c); } int main() { A:; int teemwrong[55][11] = {0}; int teemcost[11] = {0}; int teemac[11] = {0}; int M, T, P, R; cin >> M >> T >> P >> R; if (M == 0 && T == 0 && R == 0 && P == 0) return 0; rep(i, R) { int m, t, p, j; cin >> m >> t >> p >> j; if (j == 0) { teemac[t]++; teemcost[t] += m + teemwrong[t][p] * 20; } else { teemwrong[t][p]++; } } vector<piii> rank; reps(i, 1, T + 1) { rank.push_back(mk(teemac[i], -teemcost[i], i)); } sort(rank.begin(), rank.end()); reverse(rank.begin(), rank.end()); rep(i, rank.size()) { if (i != 0) { if (rank[i].first == rank[i - 1].first) printf("="); else printf(","); } printf("%d", rank[i].second); } puts(""); goto A; }
#include <algorithm> #include <cstdio> #include <iostream> #include <set> #include <string> #include <vector> using namespace std; #define reps(i, f, n) for (int i = f; i < int(n); i++) #define rep(i, n) reps(i, 0, n) typedef pair<int, int> pii; typedef pair<pii, int> piii; piii mk(int a, int b, int c) { return piii(pii(a, b), c); } int main() { A:; int teemwrong[55][11] = {0}; int teemcost[55] = {0}; int teemac[55] = {0}; int M, T, P, R; cin >> M >> T >> P >> R; if (M == 0 && T == 0 && R == 0 && P == 0) return 0; rep(i, R) { int m, t, p, j; cin >> m >> t >> p >> j; if (j == 0) { teemac[t]++; teemcost[t] += m + teemwrong[t][p] * 20; } else { teemwrong[t][p]++; } } vector<piii> rank; reps(i, 1, T + 1) { rank.push_back(mk(teemac[i], -teemcost[i], i)); } sort(rank.begin(), rank.end()); reverse(rank.begin(), rank.end()); rep(i, rank.size()) { if (i != 0) { if (rank[i].first == rank[i - 1].first) printf("="); else printf(","); } printf("%d", rank[i].second); } puts(""); goto A; }
replace
21
23
21
23
0
p00768
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef pair<int, int> P; typedef pair<P, int> PP; int main() { while (true) { int m, t, p, r; scanf("%d%d%d%d", &m, &t, &p, &r); if (m == 0) break; int tim[50][10] = {}, wa[50][10] = {}; rep(i, 50) rep(j, 10) tim[i][j] = -1; rep(i, r) { int mm, tt, pp, jj; scanf("%d%d%d%d", &mm, &tt, &pp, &jj); tt--, pp--; if (jj == 0) tim[tt][pp] = mm + wa[tt][pp] * 20; else wa[tt][pp]++; } int pen[10] = {}, acp[10] = {}; rep(i, t) rep(j, p) { if (tim[i][j] == -1) continue; acp[i]++; pen[i] += tim[i][j]; } vector<PP> vc; rep(i, t) vc.push_back(PP(P(acp[i], -pen[i]), i + 1)); sort(vc.begin(), vc.end(), greater<PP>()); rep(i, t) { if (i == 0) { printf("%d", vc[i].second); continue; } if (vc[i].first == vc[i - 1].first) printf("=%d", vc[i].second); else printf(",%d", vc[i].second); // cout << vc[i].second << " acp " << //vc[i].first.first << " pen " << vc[i].first.second << endl; } printf("\n"); } return 0; }
#include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef pair<int, int> P; typedef pair<P, int> PP; int main() { while (true) { int m, t, p, r; scanf("%d%d%d%d", &m, &t, &p, &r); if (m == 0) break; int tim[50][10] = {}, wa[50][10] = {}; rep(i, 50) rep(j, 10) tim[i][j] = -1; rep(i, r) { int mm, tt, pp, jj; scanf("%d%d%d%d", &mm, &tt, &pp, &jj); tt--, pp--; if (jj == 0) tim[tt][pp] = mm + wa[tt][pp] * 20; else wa[tt][pp]++; } int pen[50] = {}, acp[50] = {}; rep(i, t) rep(j, p) { if (tim[i][j] == -1) continue; acp[i]++; pen[i] += tim[i][j]; } vector<PP> vc; rep(i, t) vc.push_back(PP(P(acp[i], -pen[i]), i + 1)); sort(vc.begin(), vc.end(), greater<PP>()); rep(i, t) { if (i == 0) { printf("%d", vc[i].second); continue; } if (vc[i].first == vc[i - 1].first) printf("=%d", vc[i].second); else printf(",%d", vc[i].second); // cout << vc[i].second << " acp " << //vc[i].first.first << " pen " << vc[i].first.second << endl; } printf("\n"); } return 0; }
replace
26
27
26
27
0