# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1111797 | ThegeekKnight16 | 세 명의 친구들 (BOI14_friends) | C++17 | 1061 ms | 9660 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tam;
cin >> tam;
if (tam % 2 == 0) {cout << "NOT POSSIBLE" << '\n'; return 0;}
int N = (tam-1)/2;
string S; cin >> S;
int resp = -1;
for (int r = 0; r < tam; r++)
{
string S2 = "";
for (int i = 0; i < tam; i++) if (i != r) S2 += S[i];
bool ok = 1;
for (int i = 0; i < N; i++) if (S2[i] != S2[i+N]) {ok = 0; break;}
if (ok && resp == -1) resp = r;
else if (ok) {cout << "NOT UNIQUE" << '\n'; return 0;}
}
if (resp == -1) {cout << "NOT POSSIBLE" << '\n'; return 0;}
int cnt = 0;
for (int i = 0; cnt < N; i++) if (i != resp) {cout << S[i]; cnt++;} cout << '\n';
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |