| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 346359 | saleh | Three Friends (BOI14_friends) | C++17 | 1093 ms | 12048 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 <bits/stdc++.h>
using namespace std;
int main() {
string s, t, ans;
ans.clear();
cin >> s >> s;
if ((s.size() & 1) == 0) return cout << "NOT POSSIBLE\n", 0;
for (int i = 0; i < s.size(); i++) {
t = s.substr(0, i) + s.substr(i + 1, s.size() - i - 1);
if (t.substr(0, t.size() >> 1) == t.substr(t.size() >> 1, t.size() >> 1)) {
if (ans.empty()) ans = t.substr(0, t.size() >> 1);
else return cout << "NOT UNIQUE\n", 0;
}
}
if (!ans.empty()) cout << ans;
else cout << "NOT POSSIBLE\n";
return 0;
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
