# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1071876 | Rigobertus | Combo (IOI18_combo) | C++17 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
//#define int long long
#include "combo.h"
using namespace std;
string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;}
Compilation message (stderr)
combo.cpp:11:32: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:35: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:73: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:76: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:93: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:96: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:112: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:115: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:147: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:150: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:153: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:156: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:173: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:179: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:182: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i = 0; i < 4; i++) { vis.insert(i); } int j; for (int i = 0; i < 4; i++) { if (i == 3 || press(c[i])) { s = c[i]; j = i; vis.erase(i); break; } } while (s.size() < n) { int last = *vis.rbegin(); int k; for (int i = 0; i < 4; i++) { k = i; if (!vis.count(i)) { if (i != j) { vis.insert(i); } continue; } if (i == last) { s += c[i]; break; } string p = s + c[i] + c[i]; int x = press(p); if (x == p.size()) { s = p; break; } else if (x == p.size() - 1) { s += c[i]; vis.erase(i); break; } } for (int i = k+1; i<4; i++) if (i!=j) vis.insert(i); } return s;} | ^ combo.cpp:11:191: error: extended character is not valid in an identifier 11 | string guess_sequence(int n) { string c[4] = {"A", "B", "X", "Y"}; string s = ""; set<int> vis; for (int i