# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
47240 | 2018-04-29T13:10:13 Z | marvenlee | Palindromes (APIO14_palindrome) | C++14 | 1000 ms | 63044 KB |
#include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<string> ans; int maxans=0; int subans=0; string s; cin >> s; for(int i=0;i<s.length();i++) { for(int j=s.length()-1;j>=i;j--) { subans=0; int start=i,last=j,state=0; while(start<=last) { if(s[start]!=s[last]) { state=1; break; } start++;last--; } string s2= s.substr(i,j-i+1); if(state==0){ for(int x=0;x<ans.size();x++) { if(s2==ans[x]){ state=1; break; } } } if(state == 0) { string s2= s.substr(i,j-i+1); ans.push_back(s2); subans =s2.length(); int finaloccur = s.rfind(s2); int countoccur=1; int found=-1; while(s.find(s2,found+1)!=finaloccur) { countoccur+=1; found =s.find(s2,found+1); } subans*=countoccur; if(subans>maxans)maxans=subans; } } } cout << maxans; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 428 KB | Output is correct |
4 | Correct | 2 ms | 476 KB | Output is correct |
5 | Correct | 2 ms | 476 KB | Output is correct |
6 | Correct | 2 ms | 476 KB | Output is correct |
7 | Correct | 2 ms | 476 KB | Output is correct |
8 | Correct | 2 ms | 536 KB | Output is correct |
9 | Correct | 2 ms | 536 KB | Output is correct |
10 | Correct | 2 ms | 604 KB | Output is correct |
11 | Correct | 2 ms | 604 KB | Output is correct |
12 | Correct | 2 ms | 604 KB | Output is correct |
13 | Correct | 2 ms | 604 KB | Output is correct |
14 | Correct | 2 ms | 604 KB | Output is correct |
15 | Correct | 2 ms | 604 KB | Output is correct |
16 | Correct | 2 ms | 604 KB | Output is correct |
17 | Correct | 2 ms | 604 KB | Output is correct |
18 | Correct | 2 ms | 604 KB | Output is correct |
19 | Correct | 3 ms | 604 KB | Output is correct |
20 | Correct | 3 ms | 628 KB | Output is correct |
21 | Correct | 2 ms | 636 KB | Output is correct |
22 | Correct | 2 ms | 636 KB | Output is correct |
23 | Correct | 3 ms | 636 KB | Output is correct |
24 | Correct | 2 ms | 636 KB | Output is correct |
25 | Correct | 3 ms | 636 KB | Output is correct |
26 | Correct | 2 ms | 636 KB | Output is correct |
27 | Correct | 3 ms | 636 KB | Output is correct |
28 | Correct | 2 ms | 636 KB | Output is correct |
29 | Correct | 2 ms | 636 KB | Output is correct |
30 | Correct | 3 ms | 636 KB | Output is correct |
31 | Correct | 2 ms | 636 KB | Output is correct |
32 | Correct | 2 ms | 636 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 219 ms | 1276 KB | Output is correct |
2 | Correct | 154 ms | 1276 KB | Output is correct |
3 | Correct | 351 ms | 1276 KB | Output is correct |
4 | Correct | 74 ms | 1276 KB | Output is correct |
5 | Correct | 381 ms | 1368 KB | Output is correct |
6 | Correct | 363 ms | 1368 KB | Output is correct |
7 | Correct | 68 ms | 1368 KB | Output is correct |
8 | Correct | 235 ms | 1368 KB | Output is correct |
9 | Correct | 81 ms | 1368 KB | Output is correct |
10 | Correct | 59 ms | 1368 KB | Output is correct |
11 | Correct | 57 ms | 1368 KB | Output is correct |
12 | Correct | 96 ms | 1368 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1084 ms | 15784 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1079 ms | 43804 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1090 ms | 63044 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |