제출 #480863

#제출 시각아이디문제언어결과실행 시간메모리
480863callmepandey회문 (APIO14_palindrome)C++17
0 / 100
1103 ms131076 KiB
#include "bits/stdc++.h" #define ll long long using namespace std; int main() { string s; cin >> s; map < string , int> counts; int ans = 0; for(int i= 0;i<s.size();i++){ string made; for(int j = i;j<s.size();j++){ made += s[j]; counts[made]++; ans = max(ans , (int)counts[made] *(int) made.size()); } } cout << ans << endl; cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << "\n"; return 0; }

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

palindrome.cpp: In function 'int main()':
palindrome.cpp:10:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |   for(int i= 0;i<s.size();i++){
      |                ~^~~~~~~~~
palindrome.cpp:12:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for(int j = i;j<s.size();j++){
      |                   ~^~~~~~~~~
#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...