제출 #47999

#제출 시각아이디문제언어결과실행 시간메모리
47999E869120Palindromes (APIO14_palindrome)C++14
8 / 100
1102 ms131072 KiB
#include <iostream> #include <string> #include <vector> #include <map> #include <algorithm> using namespace std; bool pal(string S) { string T = S; reverse(T.begin(), T.end()); if (S == T) return true; return false; } string S; vector<string>A; map<string, int>M; int maxn = 0; int main() { cin >> S; for (int i = 0; i < S.size(); i++) { for (int j = i; j < S.size(); j++) { string G = S.substr(i, j - i + 1); if (pal(G) == false) continue; A.push_back(G); M[G] += G.size(); } } for (int i = 0; i < A.size(); i++) maxn = max(maxn, M[A[i]]); cout << maxn << endl; return 0; }

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

palindrome.cpp: In function 'int main()':
palindrome.cpp:18:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < S.size(); i++) {
                  ~~^~~~~~~~~~
palindrome.cpp:19:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int j = i; j < S.size(); j++) {
                   ~~^~~~~~~~~~
palindrome.cpp:24:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < A.size(); i++) maxn = max(maxn, M[A[i]]);
                  ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...