제출 #346359

#제출 시각아이디문제언어결과실행 시간메모리
346359saleh세 명의 친구들 (BOI14_friends)C++17
0 / 100
1093 ms12048 KiB
#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; }

컴파일 시 표준 에러 (stderr) 메시지

friends.cpp: In function 'int main()':
friends.cpp:30:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |  for (int i = 0; i < s.size(); i++) {
      |                  ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...