Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.003 s | 4 KBi |
#2 |
Correcto
|
0.005 s | 9 KBi |
#3 |
Correcto
|
0.003 s | 56 KBi |
#4 |
Error de compilación
Compilation time limit exceeded. |
||
#5 |
Error de compilación
Compilation time limit exceeded. |
||
#6 |
Error de compilación
Compilation time limit exceeded. |
||
#7 |
Correcto
|
0.241 s | 5 KBi |
#8 |
Correcto
|
0.279 s | 1 KBi |
#9 |
Correcto
|
0.285 s | 61 KBi |
#10 |
Correcto
|
0.276 s | 49 KBi |
#11 |
Correcto
|
0.274 s | 35 KBi |
#12 |
Correcto
|
0.216 s | 62 KBi |
#13 |
Correcto
|
0.186 s | 5 KBi |
#14 |
Correcto
|
0.297 s | 2 KBi |
#15 |
Correcto
|
0.32 s | 2 KBi |
#16 |
Correcto
|
0.254 s | 4 KBi |
#17 |
Correcto
|
0.206 s | 2 KBi |
#18 |
Correcto
|
0.205 s | 8 KBi |
#19 |
Error de compilación
Compilation time limit exceeded. |
||
#20 |
Correcto
|
0.142 s | 5 KBi |
#21 |
Error de compilación
Compilation time limit exceeded. |
||
#22 |
Error de compilación
Compilation time limit exceeded. |
#include <bits/stdc++.h> using namespace std; int main() { int i, len, max = -1; string str, left = "", right = ""; cin >> str; len = str.length(); for (i = 0; i < len - 1; i++) { left += str[i]; right.insert(0, 1, str[len - i - 1]); // cout << "left: " << left << endl; // cout << "right: " << right << endl; if (left == right) { // cout << "iguales: " << left << " - " << right << endl; if (i > max) { max = i; } } // cout << "-----------\n"; } cout << max + 1; }