Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.006 s | 12 KBi |
#2 |
Incorrecto
|
0.004 s | 2 KBi |
#3 |
Incorrecto
|
0.004 s | 3 KBi |
#4 |
Incorrecto
|
0.004 s | 5 KBi |
#5 |
Incorrecto
|
0.005 s | 2 KBi |
#6 |
Incorrecto
|
0.004 s | 2 KBi |
#7 |
Incorrecto
|
0.006 s | 6 KBi |
#8 |
Incorrecto
|
0.004 s | 2 KBi |
#9 |
Incorrecto
|
0.005 s | 2 KBi |
#10 |
Incorrecto
|
0.004 s | 15 KBi |
#11 |
Incorrecto
|
0.005 s | 2 KBi |
#12 |
Incorrecto
|
0.005 s | 19 KBi |
#13 |
Incorrecto
|
0.004 s | 2 KBi |
#14 |
Incorrecto
|
0.005 s | 2 KBi |
#15 |
Incorrecto
|
0.004 s | 1 KBi |
#16 |
Incorrecto
|
0.005 s | 2 KBi |
#17 |
Incorrecto
|
0.006 s | 1 KBi |
#18 |
Incorrecto
|
0.004 s | 5 KBi |
#19 |
Incorrecto
|
0.004 s | 2 KBi |
#20 |
Incorrecto
|
0.006 s | 6 KBi |
#21 |
Incorrecto
|
0.005 s | 1 KBi |
#22 |
Incorrecto
|
0.003 s | 1 KBi |
#23 |
Incorrecto
|
0.005 s | 2 KBi |
#24 |
Incorrecto
|
0.005 s | 4 KBi |
#include <bits/stdc++.h> using namespace std; int main() { string str; int maxDif, subStrLen, maxLen = 0, i = 0, subStrIndex; map<char, int> tabla; while (i < str.length()) { subStrLen = 0; subStrIndex = i; while (subStrIndex < str.length()) { cout << str[subStrIndex]; tabla[str[subStrIndex]]; if (tabla.size() > maxDif) { break; } subStrLen++; subStrIndex++; } if (subStrLen > maxLen) { maxLen = subStrLen; } tabla.clear(); i++; } cout << maxLen << endl; return 0; }