Submission #480863

# Submission time Handle Problem Language Result Execution time Memory
480863 2021-10-18T13:32:28 Z callmepandey Palindromes (APIO14_palindrome) C++17
0 / 100
1000 ms 131076 KB
#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;
}  

Compilation message

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 time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Incorrect 0 ms 204 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 199 ms 1356 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1103 ms 99908 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 282 ms 131076 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 253 ms 131076 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -