| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1332065 | kawhiet | 세 명의 친구들 (BOI14_friends) | C++20 | 1096 ms | 6296 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
string u;
cin >> n >> u;
// if (n % 2 == 0) {
// cout << "NOT POSSIBLE\n";
// return 0;
// }
string s;
for (int i = 0; i < n; i++) {
string a, b;
for (int j = 0; j < n; j++) {
if (i == j) continue;
if (a.size() < n / 2) {
a += u[j];
} else {
b += u[j];
}
}
if (a == b) {
if (!s.empty()) {
cout << "NOT UNIQUE\n";
return 0;
}
s = a;
}
}
if (s.empty()) {
cout << "NOT POSSIBLE\n";
} else {
cout << s << '\n';
}
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
