output
stringlengths
52
181k
instruction
stringlengths
296
182k
#include <bits/stdc++.h> using namespace std; const int Maxn = 32; const int Maxz = 15; const int Maxp = 28; const int Maxe = 7; int id[Maxe][Maxe]; int n, m; char B[Maxn][Maxn]; int z, sr[Maxz], sc[Maxz]; int col[Maxn][Maxn]; int seq[Maxz]; int tp[Maxp]; int ways; bool was; char cur[Maxn][Maxn], res[Maxn][Maxn]; int g...
### Prompt Please provide a CPP coded solution to the problem described below: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2...
#include <bits/stdc++.h> int N, M, i, j, e, Ans, Cnt; char Map[35][35], res[35][35]; int f[35][35], h[10][10], P[15], g[10], son[15], next[205], ed[205]; bool check(int i) { int j, flag = 1; for (j = son[i]; j; j = next[j]) { if (h[P[i]][P[ed[j]]]) flag = 0; ++h[P[i]][P[ed[j]]]; } for (j = son[i]; j; j ...
### Prompt Please create a solution in CPP to the following problem: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1...
#include <bits/stdc++.h> using namespace std; const int N = 35; int dx[4] = {-1, 1, 0, 0}; int dy[4] = {0, 0, -1, 1}; int n, m, kp, Map[N][N], exist[105]; char ch[N][N]; pair<int, int> pos[25], adj[N][N]; bool vis[25], vis2[N][N]; long long ans; int ansMap[N][N]; void reset(int r, int c) { for (int i = r; i <= r + 1;...
### Prompt Create a solution in CPP for the following problem: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1-5 1-6...
#include <bits/stdc++.h> int n, m, s; int pos[15][2], map[33][33], num[7][7], out[33][33]; char str[33][33]; bool ok[33][33], use[15]; __inline bool check() { bool use[29]; memset(use, 0, sizeof(use)); memset(ok, 0, sizeof(ok)); for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) { if (ok[i][j] ...
### Prompt Your task is to create a cpp solution to the following problem: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3...
#include <bits/stdc++.h> using namespace std; inline void read(int &x) { short negative = 1; x = 0; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') negative = -1; c = getchar(); } while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); x *= negative; } lo...
### Prompt Construct a CPP code solution to the problem outlined: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1-5 ...
#include <bits/stdc++.h> using namespace std; char s[50][50], b[50][50]; int n, m, tot, x, ans; int v[50], a[50][50], h[50], t[50]; bool in[50][50]; void deal() { for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) if (s[i][j] != '.') { if (a[i][j] == 0) a[i][j] = a[i + 1][j] = a[i][...
### Prompt Develop a solution in Cpp to the problem described below: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1...
#include <bits/stdc++.h> using namespace std; int n, m; char s[1008][1008], last[1008][1008]; int a[58][58]; int flag[58], x[58], y[58]; int ans, tot; bool in[8][8]; struct Tprogram { void open() { freopen("1.in", "r", stdin); freopen("1.out", "w", stdout); } void close() {} void init() { scanf("%d%...
### Prompt Create a solution in Cpp for the following problem: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1-5 1-6...
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f, mod = 1000000007; const double pi = 3.1415926535897932, eps = 1e-6; void chmax(int &x, int y) { if (x < y) x = y; } void chmin(int &x, int y) { if (x > y) x = y; } int qpow(int x, int y) { int ret = 1; while (y) { if (y & 1) ret = (lo...
### Prompt Please provide a cpp coded solution to the problem described below: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2...
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f, mod = 1000000007; const double pi = 3.1415926535897932, eps = 1e-6; void chmax(int &x, int y) { if (x < y) x = y; } void chmin(int &x, int y) { if (x > y) x = y; } int qpow(int x, int y) { int ret = 1; while (y) { if (y & 1) ret = (lo...
### Prompt Your task is to create a Cpp solution to the following problem: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3...
#include <bits/stdc++.h> using namespace std; const int INF = 1000000000; const int diri[4] = {-1, 0, 1, 0}; const int dirj[4] = {0, 1, 0, -1}; int F, C, N; char mapa[50][50]; int square[50][50], squares; int color[50], quants[50]; int tmp[50][50]; int usat[50][50]; pair<int, int> A[50], B[50]; int total; int result[50...
### Prompt Develop a solution in Cpp to the problem described below: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1...
#include <bits/stdc++.h> using namespace std; const int MaxN = 40; int n, m; char s[MaxN][MaxN]; int tot, f[MaxN][MaxN]; vector<pair<int, int> > v[MaxN]; int c[MaxN], p[MaxN][MaxN]; int ans; void solve(int x, int k) { if (k == 15) { memset(p, 0, sizeof(p)); for (int i = 1; i <= 28; ++i) { if (p[c[f[v[i]...
### Prompt Create a solution in Cpp for the following problem: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1-5 1-6...
#include <bits/stdc++.h> using namespace std; int n, m, cx[100], cy[100], S, g[100][100], c[100]; char a[100][100]; void ff(int x, int y) { if (x == 14) { set<pair<int, int> > A; for (int i = 0; i < 28; i++) { pair<int, int> p = make_pair(c[cx[i]], c[cy[i]]); if (p.first > p.second) swap(p.first, ...
### Prompt Please formulate a cpp solution to the following problem: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1...
#include <bits/stdc++.h> using namespace std; #pragma comment(linker, "/STACK:32000000") int n, m; int pole[40][40]; int sq[40][40]; int k; int domino[30][2]; int p; int ans = 0; int usedCol[40]; int colBlock[40]; int goodCol[40]; int new_sq[40][40]; int new_k; void rec(int numBlock) { if (numBlock > k) { bool on...
### Prompt Please formulate a Cpp solution to the following problem: Little Gennady was presented with a set of domino for his birthday. The set consists of 28 different dominoes of size 2 × 1. Both halves of each domino contain one digit from 0 to 6. 0-0 0-1 0-2 0-3 0-4 0-5 0-6 1-1 1-2 1-3 1-4 1...
#include <bits/stdc++.h> using namespace std; void solve() { string s1, s2, s3; cin >> s1; long long f = 0, l1; for (long long x = 0; x < s1.length(); x++) { if (s1[x] == '.') { f = 1; continue; } if (f == 0) s2 += s1[x]; else s3 += s1[x]; } l1 = s2.length(); if (s2...
### Prompt Your task is to create a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> using namespace std; int main() { long long i, a; string s; cin >> s; i = s.find("."); s.erase(i); if (s[i - 1] == '9') cout << "GOTO Vasilisa." << endl; else if (s[i + 1] >= '5') { s[i - 1] += 1; cout << s << endl; } else cout << s << endl; }
### Prompt Construct a CPP code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long int c = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == '.') { c = i; break; } } if (s[c - 1] - '0' == 9) cout << "GOTO Vasilisa.\n"; else { if (s[c + 1] - '0' >= 5) { for (int i ...
### Prompt Develop a solution in cpp to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main(void) { string str, org; bool add, vasilsa; while (cin >> str) { add = 0, vasilsa = 0; org.clear(); for (int i = 0; i < (int)str.size(); i++) { if (str[i] == '.') { if (str[i + 1] >= '5') add = 1; if (str[i - 1] == '9') vasil...
### Prompt Create a solution in cpp for the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdo...
#include <bits/stdc++.h> using namespace std; string s1 = "", s2 = ""; int main() { bool ok = true; char c; while (cin >> c) { if (c == '.') { ok = false; continue; } if (ok) s1 += c; else s2 += c; } if (s1[int((s1).size()) - 1] != '9') { if (s2[0] < '5') cout...
### Prompt Develop a solution in Cpp to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; long long x, sum = 1; string s, s1; vector<int> v, v1; int main() { cin >> s; for (int i = 0; i < (int)s.length(); i++) { if (s[i] == '.' && s[i - 1] == '9') { cout << "GOTO Vasilisa."; return 0; } if (s[i] == '.' && s[i + 1] - 48 >= 5) { f...
### Prompt Create a solution in CPP for the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdo...
#include <bits/stdc++.h> using namespace std; int main() { string s; getline(cin, s); for (int i = 0; i <= s.length() - 1; i++) { if (s[i] == '.' && s[i - 1] == '9') { cout << "GOTO Vasilisa."; return 0; } if (s[i] == '.' && s[i + 1] < '5') { for (int j = 0; j <= i - 1; j++) cout << ...
### Prompt Please create a solution in cpp to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); string a, b; cin >> a; int c = a.size(); bool d = 1; for (int i = 0; i < c; i++) { if (a[i] == '0' && d) { if (a[i + 1] == '.') b = '0'; } else if (a[i] == '9' && a[i + 1] == '...
### Prompt In Cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int siz = s.size(), check = 0; vector<char> v1; vector<char> v2; for (int i = 0; i < siz; i++) { if (s[i] == '.') { check = 1; continue; } if (check == 0) { v1.push_back(s[i]); } else { v2....
### Prompt Your task is to create a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> using namespace std; int main() { char a[1010]; cin >> a; int l = strlen(a), dot; for (int i = 0; i < l; i++) { if (a[i] == '.') { dot = i; } } if (a[dot - 1] == '9') { cout << "GOTO Vasilisa." << endl; } else { if (a[dot + 1] >= '5') { a[dot - 1]++; ...
### Prompt In cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int t = -1; for (int i = 0; i < s.size(); i++) if (s[i] == '.') { t = i; break; } if (t == -1) { if (s[(s.size()) - 1] == '9') { cout << "GOTO Vasilisa." << endl; return 0; } cout << s <<...
### Prompt Create a solution in Cpp for the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdo...
#include <bits/stdc++.h> using namespace std; bool check(string s) { for (int i = 2; i < s.size(); i++) { if (s[i] != '9') return 0; } return 1; } int main() { string s, x = "0.", y; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '.') { y = s.substr(0, i); x = x + s.substr(i ...
### Prompt Please provide a cpp coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int i; string sac = ""; string sad = ""; string sam = ""; int a = 0; int b = 0; int count = 1; for (i = 0; i < s.size(); i++) { if (s[i] == '.') { sac = s[i - 1]; i++; break; } sam = sam + s[...
### Prompt Generate a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdom ...
#include <bits/stdc++.h> using namespace std; int main() { string x; cin >> x; int pos = x.find('.'); if (x[pos - 1] == '9') { cout << "GOTO Vasilisa."; } else { if (x[pos + 1] < '5') { for (int i = 0; i <= pos - 1; i++) { cout << x[i]; } } else if (x[pos + 1] >= '5') { s...
### Prompt Please provide a CPP coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> a; int b; b = a.find('.'); if (a[b - 1] == '9') { cout << "GOTO Vasilisa." << endl; } else if (a[b + 1] >= '5') { a[b - 1] = a[b - 1] + 1; cout << a.substr(0, b) << endl; } else { cout << a.substr(0, b) << endl; ...
### Prompt Create a solution in Cpp for the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdo...
#include <bits/stdc++.h> char s[1002]; int main() { scanf("%s", &s); int ds = strlen(s); int i; int current; for (i = 0; i < ds; i++) if (s[i] == '.') { current = i; break; } if (s[current - 1] == '9') printf("GOTO Vasilisa."); else if (s[current + 1] - '0' >= 5) { for (i = 0; ...
### Prompt Please provide a cpp coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); } bool is_vowel(char c) { c = tolower(c); return c == 'a' || c == 'e' || c == 'o' || c == 'i' || c == 'u' || c == 'y'; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); string str;...
### Prompt Please provide a CPP coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int n, t, k, x; string s; int main() { cin >> s; n = s.size(); for (int k = 0;; k++) { if (s[k] == '.') { t = k; break; } } if (s[t - 1] == 9 + '0') cout << "GOTO Vasilisa."; else if (s[t + 1] < 5 + '0') { for (int i = 0; i < t; i++) ...
### Prompt Please formulate a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); string s; cin >> s; int point = s.find('.'); if (s[point - 1] != '9') { if (s[point + 1] == '0' or s[point + 1] == '1' or s[point + 1] == '2' or s[point + 1] == '3' or s[point + 1] == '4') ...
### Prompt Create a solution in Cpp for the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdo...
#include <bits/stdc++.h> using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; string s; cin >> s; size_t found = s.find('.'); if (s[found - 1] == '9') return cout << "GOTO Vasilisa.", 0; else { string str = s.substr(0, found); if (s[found ...
### Prompt In cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> using namespace std; int main() { string num; cin >> num; size_t idx = num.find('.'); if (num[idx - 1] == '9') { cout << "GOTO Vasilisa."; return 0; } else if (num[idx - 1] != '9' && num[idx + 1] >= '5') { num[idx - 1] += 1; } num.erase(num.begin() + idx, num.end()); ...
### Prompt Your challenge is to write a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> char a[1020]; int main() { int n, i, x, pos = 0; scanf("%s", a); n = strlen(a); for (i = 0; i < n; i++) { if (a[i] == '.') { pos = i; break; } } if (pos == 0) { i = 0; while (i < n) { printf("%c", a[i]); i++; } return 0; } if (a[po...
### Prompt Please create a solution in CPP to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; void solve() { long long i, j, n, k, arr[105000]; long long l, r, a, b, c, x, y, m; vector<pair<long long, long long> > game; string ch, ph; cin >> ch; long long pos = -1; for (i = 0; i < ch.size(); i++) { if (ch[i] == '.') pos = i; } if (ch[pos - 1] =...
### Prompt Construct a CPP code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> char s[2000]; int main() { while (~scanf("%s", s)) { int n = strlen(s); bool nine = 0; for (int i = 0; i < n; i++) if (s[i] == '.') { if (s[i - 1] == '9') nine = 1; else if (s[i + 1] >= '5') s[i - 1]++; s[i] = '\0'; } if ...
### Prompt In cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> int main() { int i = 0; char ch[1002]; scanf("%s", ch); while (ch[i] != '.') { i++; } int a = ch[i - 1] - '0'; if (a % 10 == 9) { printf("GOTO Vasilisa.\n"); } else { if (ch[i + 1] >= 5 + '0') { int j; for (j = 0; j < i - 1; j++) { printf("%c", ch...
### Prompt Develop a solution in cpp to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> int main() { int l, wd, i; char number[1100]; scanf("%s", number); l = strlen(number); for (i = 0; i < l; i++) if (number[i] == '.') break; wd = i; if (number[i - 1] == '9') { printf("GOTO Vasilisa."); return 0; } if (number[i + 1] >= '5') number[i - 1]++; for (i...
### Prompt Please formulate a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { vector<int> A, B, C, D, E, V, V2, ANS; vector<string> gh; vector<char> ch; vector<char>::iterator ic; vector<int>::iterator it; vector<string>::iterator str; int a, b, maxv = -60, c, d, e, g, h, l, n, y = 0, u = 0, minv = 100000, i; char t[10001...
### Prompt Please provide a cpp coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '.') { int b = s[i + 1] - '0'; if (s[i - 1] == '9') { cout << "GOTO Vasilisa."; } else if (b < 5) { for (int j = 0; j < s.size(); j++) { i...
### Prompt Your challenge is to write a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; size_t r = n.find("."); string a = n.substr(r - 1, 1); string b = n.substr(r + 1, 1); int c = atoi(a.c_str()); int d = atoi(b.c_str()); if (c == 9) { cout << "GOTO Vasilisa." << endl; } else { if (d >= 5) { c ...
### Prompt Please create a solution in CPP to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int mod = 1e9 + 7; const int maxn = 1e3 + 7; const double pi = acos(-1.0); const int v2 = (mod + 1) / 2; const double eps = 5e-6; char s[maxn]; int main() { scanf("%s", s); int len = strlen(s); int flag = len; for (int i = 0; i < le...
### Prompt Generate a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdom ...
#include <bits/stdc++.h> using namespace std; int main() { char str[1001]; int i; while (scanf("%s", str) != EOF) { bool cn = true; for (i = 0; i < strlen(str); i++) if (str[i] == '.') { cn = false; break; } if (!cn && str[i - 1] == '9') cout << "GOTO Vasilisa.\n"; ...
### Prompt Please provide a CPP coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; const int maxx = 1005; char ch[maxx]; int main() { int i = 0; int flag = 0; while (~scanf("%c", &ch[i]) && ch[i] != '\n') { i = 1; while (~scanf("%c", &ch[i]) && ch[i] != '\n') { if (ch[i] == '.') flag = i; i++; } if (ch[flag - 1] == '9') {...
### Prompt Your task is to create a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> char str[1010]; int main() { int i; while (scanf("%s", str) != EOF) { int n = strlen(str); for (i = 0; i < n; i++) if (str[i] == '.') break; if (str[i - 1] == '9') { printf("GOTO Vasilisa.\n"); continue; } for (int j = 0; j < i - 1; j++) printf("%c", st...
### Prompt Please provide a Cpp coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> int main() { char aux[1001]; scanf("%s", aux); int i; for (i = 0; aux[i + 1] != '.'; i++) ; if (aux[i] == '9') { printf("GOTO Vasilisa."); return 0; } if (aux[i + 2] - '0' >= 5) aux[i]++; aux[i + 1] = '\0'; printf("%s", aux); return 0; }
### Prompt Develop a solution in cpp to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { char s[10001], a; for (int i = 1; i <= 10000; i++) { cin >> s[i]; if (s[i] == '.') { if (s[i - 1] == '9') { cout << "GOTO Vasilisa.\n"; return 0; } else { cin >> a; if (a >= '5') s[i - 1]++; for (i...
### Prompt In Cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> int main() { int a = 0, b; char c[1001], d[1001]; gets(c); while (c[a] != '.') { d[a] = c[a]; a++; } d[a] = '\0'; if (c[a - 1] == '9') printf("GOTO Vasilisa.\n"); else if (c[a + 1] < '5') puts(d); else { d[a - 1] += 1; puts(d); } return 0; }
### Prompt Develop a solution in cpp to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { string s, a, b; cin >> s; int pos = 0; for (int i = 0; i < s.size(); ++i) if (s[i] == '.') pos = i; a = s.substr(pos + 1, s.size() - pos - 1); b.resize(a.size(), '0'); b[0] = '5'; if (s[pos - 1] == '9') { cout << "GOTO Vasilisa."; re...
### Prompt Please formulate a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; char st[1010], Int[1010], D; int i, I; int main() { while (~scanf("%s", st)) { I = 0; for (i = 0; st[i] != '\0' && st[i] != '.'; i++) Int[i] = st[i]; I = i; Int[I] = '\0'; D = st[i + 1]; if (Int[I - 1] == '9') printf("GOTO Vasilisa.\n"); ...
### Prompt Your challenge is to write a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; int i = 0; while (i + 1 < (int)str.size() && str[i + 1] != '.') i++; int j = i + 2; if (str[i] == '9') { cout << "GOTO Vasilisa." << endl; return 0; } if (str[j] - '0' >= 5) { for (int k = 0; k < i; k++) cout ...
### Prompt Your task is to create a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> using namespace std; char s[1007]; int main() { while (~scanf("%s", s)) { int h = strlen(s); int logo = 0, f = 0; for (int i = 0; i < h; i++) { if (s[i] == '.') { logo = i; if (s[i - 1] == '9') { printf("GOTO Vasilisa."); f = 1; } ...
### Prompt Generate a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdom ...
#include <bits/stdc++.h> using namespace std; int p, n; char arr[1002], brr[1002]; int main() { scanf("%s", arr); n = strlen(arr); for (int i = 0; i < n; i++) { if (arr[i] == '.') { p = i; } } if (arr[p - 1] == '9') { printf("GOTO Vasilisa.\n"); } else { if (arr[p + 1] - '0' >= 5) { ...
### Prompt Please create a solution in cpp to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int pos = s.find("."); if (s[pos - 1] == '9') { cout << "GOTO Vasilisa."; return 0; } else { if (s[pos + 1] >= '5') s[pos - 1] = s[pos - 1] + 1; } cout << s.substr(0, pos); return 0; }
### Prompt In cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; if (s[s.find('.') - 1] == '9') { cout << "GOTO Vasilisa." << endl; return 0; } if (s[s.find('.') + 1] >= '5' && s.find('.') != -1) { for (int i = 0; i < s.find('.') - 1; i++) cout << s[i]; cout << char(int(s[s.find(...
### Prompt Your challenge is to write a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; string s; int main() { cin >> s; int k = 0; while (s[k] != '.') k++; if (s[k - 1] - '0' == 9) { cout << "GOTO Vasilisa.\n"; return 0; } if (s[k + 1] - '0' < 5) { for (int i = 0; i < k; i++) cout << s[i] - '0'; cout << "\n"; return 0; } in...
### Prompt Generate a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdom ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long long n = 0, i, k = s.length(), flag = 0; for (i = 0; i < k; i++) { if (s[i] == '.') { if (s[i - 1] == '9') { cout << "GOTO Vasilisa." << endl; flag = 1; break; } else { if (s[i + 1...
### Prompt In cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; int temp = 0; for (int i = 1; i < str.length(); i++) { if (str[i] == '.') { temp = i; if (str[i - 1] == '9') { cout << "GOTO Vasilisa." << endl; return 0; } else if ((str[i + 1] == '9') || (s...
### Prompt In cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> using namespace std; const int N = 110; bool ls(string s1, string s2) { for (int i = 0; i < s1.size(); i++) if (s1[i] < s2[i]) return 1; else if (s1[i] > s2[i]) return 0; return 0; } int main() { string s, t, tmp; cin >> s; int pos = s.find('.'); for (int i = pos...
### Prompt Please formulate a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { string s; while (cin >> s) { int i = 0; string out; while (s[i] != '.') { out += s[i]; ++i; } if (out[out.size() - 1] == '9') cout << "GOTO Vasilisa." << endl; else { if (s[i + 1] >= '5') out[out.size() - 1]++...
### Prompt Construct a cpp code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> using namespace std; char s[2010]; int main() { cin >> s; int i = 0; while (s[i] != '.') i++; if (s[i - 1] != '9') { if (s[i + 1] >= '5') { s[i - 1] += 1; } } else if (s[i - 1] == '9') { printf("GOTO Vasilisa.\n"); return 0; } i = 0; while (s[i + 1] != '.' ...
### Prompt Your challenge is to write a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { start: string key; cin >> key; short pointi = key.find('.'); if (key[pointi - 1] == '9') { cout << "GOTO Vasilisa." << endl; return 0; } if (key[pointi + 1] >= '5') { key[pointi - 1]++; } for (int i = 0; i < pointi; i++) { cout <...
### Prompt Construct a CPP code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> char str1[12000]; int n; int main() { scanf("%s", &str1); n = strlen(str1); bool pr = false; int i, j; for (i = 0; i < n; i++) { if (str1[i] == '.') { if (str1[i - 1] == '9') pr = true; break; } } if (i == n) { if (str1[i - 1] == '9') pr = true; } if (p...
### Prompt Your task is to create a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> using namespace std; long long conversion(string p) { long long o; o = atol(p.c_str()); return o; } string toString(int h) { stringstream ss; ss << h; return ss.str(); } long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); } int lcm(int a, int b) { return (...
### Prompt Construct a CPP code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == '.' && s[i - 1] == '9') cout << "GOTO Vasilisa." << endl; } for (int i = 0; i < s.length(); i++) if (s[i] == '.' && s[i - 1] != '9') { if (s[i + 1] < '5') for...
### Prompt In Cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long int index = 0; while (s[index] != '.') { index++; } long int index1 = index - 1, index2 = index + 1; if (s[index1] == '9') { cout << "GOTO Vasilisa.\n"; } else { if (s[index2] >= '5') { for (long int i ...
### Prompt Construct a cpp code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> int main() { char s[100000]; int i, j, k, l, p[100000], q[100000], e, n, f; scanf("%s", s); for (i = 0; i < strlen(s);) { j = 0; while (s[i] != '.') { p[j] = s[i] - 48; i++; j++; } i++; k = 0; while (s[i] != '\0') { q[k] = s[i] - 48; ...
### Prompt Please provide a CPP coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string s; int pos; while (cin >> s) { pos = s.find('.'); string integer_part = s.substr(0, pos); if (s[pos - 1] == '9') cout << "GOTO Vasilisa.\n"; else { if (s[pos + 1] < '5') cout << integer_part << "\n"; else {...
### Prompt Your task is to create a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; int p = n.find("."); if (n[p - 1] == '9') { cout << "GOTO Vasilisa."; return 0; } if (n[p + 1] >= '5') n[p - 1]++; cout << n.substr(0, p); return 0; }
### Prompt Your challenge is to write a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; int pos_dot = str.find('.'); if (str[pos_dot - 1] == '9') cout << "GOTO Vasilisa." << endl; else if (str[pos_dot + 1] < '5') cout << str.substr(0, pos_dot) << endl; else { char temp = str[pos_dot - 1] + 1; cou...
### Prompt Your task is to create a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> using namespace std; string s, ss; int idx; int main() { cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == '.') { idx = i; break; } } if (s[idx - 1] != '9') { if (s[idx + 1] < '5') { ss = s.substr(0, idx); } else { ss = s.substr(0, idx)...
### Prompt Generate a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdom ...
#include <bits/stdc++.h> using namespace std; int main() { string s; int i, j; cin >> s; for (i = 0; i < s.size(); i++) if (s[i] == '.') break; if (s[i - 1] == '9') { cout << "GOTO Vasilisa."; return 0; } if (s[i + 1] >= '5') s[i - 1]++; for (j = 0; j < i; j++) cout << s[j]; return 0; }
### Prompt Your task is to create a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> int main() { char a[1001]; int i = 0, j; scanf("%s", &a); while (a[i] != '.') i++; if (a[i - 1] == '9') printf("GOTO Vasilisa."); else if (a[i + 1] < '5') for (j = 0; j < i; j++) printf("%c", a[j]); else { for (j = 0; j < i - 1; j++) printf("%c", a[j]); printf("%d"...
### Prompt Please create a solution in CPP to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { string ent; cin >> ent; int i; for (i = 0; i < ent.size(); i++) { if (ent[i] == '.') break; } if (ent[i - 1] == '9') { cout << "GOTO Vasilisa."; } else if (ent[i + 1] >= '5') { ent[i - 1]++; cout << ent.substr(0, i) << endl; } el...
### Prompt In Cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> const int MAXN = 1005; char str[MAXN]; int main() { scanf("%s", str); char *sub = strstr(str, "."); if (*(sub - 1) == '9') printf("GOTO Vasilisa.\n"); else { if (*(sub + 1) >= '5') (*(sub - 1))++; *sub = 0; printf("%s\n", str); } return 0; }
### Prompt Your challenge is to write a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string t, s; int x, y; cin >> t; y = t.find('.'); s.assign(t, 0, y); x = s.length(); if (s[x - 1] == '9') { cout << "GOTO Vasilisa."; } else { if (t[y + 1] - '0' <= 4) { cout << s; } else { x = s.length(); s[x - 1] ...
### Prompt Create a solution in cpp for the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdo...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int a; for (int i = 0; i < s.size(); ++i) { if (s[i] == '.') { if (s[i - 1] + 1 > '9') { cout << "GOTO Vasilisa." << endl; return 0; } if (s[i + 1] < '5') { a = i - 1; break; ...
### Prompt Create a solution in CPP for the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdo...
#include <bits/stdc++.h> using namespace std; int main() { string a; int dot; cin >> a; dot = a.find('.'); if (a[dot - 1] == '9') { cout << "GOTO Vasilisa." << endl; } else if (a[dot + 1] >= '5') { a[dot - 1]++; a.erase(a.begin() + dot, a.end()); cout << a << endl; } else { a.erase(a.b...
### Prompt Please formulate a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> int main() { int k, d; char ak[1000], ad[1000], c = 'q'; for (int i = 0; i < 1000; i++) { scanf("%c", &ak[i]); if (ak[i] == '.') { k = i; break; } } gets(ad); d = strlen(ad); if (ak[k - 1] == '9') { printf("GOTO Vasilisa."); return 0; } for (int...
### Prompt Please formulate a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; int main() { string num; cin >> num; string::iterator it = num.begin(); while (*it != '.') ++it; if (*(--it) != '9') { if (*(++(++it)) < '5') { it = num.begin(); while (*it != '.') { printf("%c", *it); ++it; } } else if (*...
### Prompt Your challenge is to write a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> char str[1005]; int a[1005]; int main() { int i, f, o = 0; gets(str + 1); for (i = 1; str[i] != '.'; i++) ; if (str[i - 1] == '9') puts("GOTO Vasilisa."); else { f = (str[i + 1] >= '5'); while (--i) a[++o] = str[i] - '0'; a[1] += f; for (i = o; i; i--) printf("...
### Prompt Please create a solution in Cpp to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; string s, tm, tm2, tm3; bool comp(string s, string t) { for (int i = 0; i < s.length(); i++) if (s[i] > t[i]) return true; else if (s[i] < t[i]) return false; return true; } int main() { cin >> s; bool q = false; for (int i = 0; i < s.length();...
### Prompt Your challenge is to write a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> int main() { char s[1005]; scanf("%s", s); int i, idx; for (i = 0; i < strlen(s); i++) { if (s[i] == '.' && s[i - 1] != '9') { idx = i; if (s[i + 1] >= '5') { s[i - 1]++; break; } else break; } else if (s[i] == '.' && s[i - 1] == '9') { ...
### Prompt Generate a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdom ...
#include <bits/stdc++.h> char Str[1001], Ans[1001]; int main() { int i, j, k; scanf("%s", Str); for (i = 0; Str[i] != '\0'; ++i) { if (Str[i] != '0') { break; } } for (j = i, k = 0; Str[j] != '.'; ++j) { Ans[k++] = Str[j]; } if (k == 0) { Ans[k++] = '0'; } if (Ans[k - 1] == '9') ...
### Prompt Your challenge is to write a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; void pvi(vector<int> pvec, string name = "") { if (name != "") cout << "Output of " << name << " : "; for (int i = 0; i < pvec.size(); i++) cout << pvec[i] << " "; cout << '\n'; } int gcd(int n, int m) { return m == 0 ? n : gcd(m, n % m); } long long mpow(long long ba...
### Prompt Your task is to create a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upo...
#include <bits/stdc++.h> using namespace std; void solve() { string s; cin >> s; int p = s.find('.'); if (s[p - 1] == '9') { cout << "GOTO Vasilisa." << '\n'; } else if (s[p + 1] < '5') { cout << s.substr(0, p) << '\n'; } else { string z = s.substr(0, p); z[p - 1]++; cout << z << '\n'; ...
### Prompt In cpp, your task is to solve the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingd...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); string s; cin >> s; int pos = s.find('.'); string int_part = s.substr(0, pos); string f_part = s.substr(pos + 1, s.length() - pos); int int_last = int_part[int_part.length() - 1] - '0'; int f_last =...
### Prompt Your challenge is to write a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { string x; getline(cin, x); for (int i = 0; i < x.length(); i++) { if (x[i] == '.') { if (x[i - 1] == '9') cout << "GOTO Vasilisa."; else { if (x[i + 1] < '5') { for (int j = 0; j < i; j++) cout << x[j]; } ...
### Prompt Develop a solution in Cpp to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; string s; int pos; int main() { cin >> s; for (int i = 0; i < (int)(s).size(); ++i) if (s[i] == '.') { pos = i; break; } if (s[pos - 1] == '9') return !printf("GOTO Vasilisa."); if (s[pos + 1] >= '5') s[pos - 1]++; cout...
### Prompt Construct a Cpp code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; int n, m; int ret = 0; int a, b; bool v = false; bool up = false; int ind; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '.') { ind = i; if (s[i - 1] == '9') { v = true; } if (s[i +...
### Prompt Construct a cpp code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> int main() { char a[1000]; while (scanf("%s", &a) != EOF) { int l = strlen(a), i; char b[1000]; memset(b, 0, sizeof(b)); for (i = 0; i < l; i++) { if (a[i] == '.') break; else b[i] = a[i]; } b[i] = '\0'; if (b[i - 1] == '9') prin...
### Prompt Your challenge is to write a cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> char s[1005]; int main() { gets(s); int i; for (i = 0; s[i] != '.'; i++) ; if (s[i - 1] == '9') { puts("GOTO Vasilisa."); return 0; } if (s[i + 1] >= '5') s[i - 1]++; for (i = 0; s[i] == '0'; i++) ; if (s[i] == '.') { puts("0"); return 0; } for (; s[i...
### Prompt Create a solution in Cpp for the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdo...
#include <bits/stdc++.h> using namespace std; char str[1000 + 100]; int main() { while (scanf("%s", str) == 1) { int point; int len = strlen(str); for (point = 0; str[point] != '\0'; ++point) { if (str[point] == '.') break; } if (str[point - 1] == '9') { puts("GOTO Vasilisa."); } e...
### Prompt Please provide a cpp coded solution to the problem described below: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...
#include <bits/stdc++.h> using namespace std; int main() { int cnt = 0; char str[2000]; char *integer; char *decimal; cin.getline(str, 2000); char *pch = strtok(str, "."); while (pch != NULL) { if (cnt == 0) integer = pch; if (cnt == 1) decimal = pch; pch = strtok(NULL, "."); cnt += 1; }...
### Prompt Construct a Cpp code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> using namespace std; int main() { string n; cin >> n; int LastInt, FirstDec; for (int i = 0; i < n.size(); i++) { if (n[i] == '.') { LastInt = i - 1; FirstDec = i + 1; break; } } if (n[LastInt] == ('0' + 9)) { cout << "GOTO Vasilisa."; } else { if...
### Prompt Please formulate a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> using namespace std; const int MAXN = 1000; const int MAX = 1000; const int inf = 999999999; const int p1 = 104393321, p2 = 104393329; int main() { ios::sync_with_stdio(0); string s; cin >> s; for (int i = (0); i < int(s.size()); ++i) if (s[i] == '.') s[i] = ' '; istringstream sin...
### Prompt Construct a CPP code solution to the problem outlined: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kin...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; bool flag = false; for (int i = 0; i < s.size(); i++) { int k; if (s[i] == '.' && s[i - 1] == '9') { cout << "GOTO Vasilisa." << endl; } else if (s[i] == '.' && s[i - 1] != '9' && s[i + 1] < '5') { k = i; ...
### Prompt Generate a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the kingdom ...
#include <bits/stdc++.h> using namespace std; int main() { char a[100000 + 10]; long long int i = 0; string s; cin >> s; while (s[i] != '.') { a[i] = s[i]; i++; } if (s[i - 1] == '9') { cout << "GOTO Vasilisa." << endl; } else if (s[i + 1] == '4' || s[i + 1] == '3' || s[i + 1] == '2' || ...
### Prompt Please formulate a Cpp solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted upon the ...
#include <bits/stdc++.h> int main() { char str[1010]; while (~scanf("%s", str)) { int dot, i; for (i = 0; str[i] != '.'; ++i) ; dot = i; if (str[dot - 1] == '9') puts("GOTO Vasilisa."); else { if (str[dot + 1] > '4') str[dot - 1]++; for (i = 0; i < dot; ++i) putchar(str[i...
### Prompt Your challenge is to write a CPP solution to the following problem: In a far away kingdom lived the King, the Prince, the Shoemaker, the Dressmaker and many other citizens. They lived happily until great trouble came into the Kingdom. The ACMers settled there. Most damage those strange creatures inflicted...