Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.004 s | 6 KBi |
#2 |
Incorrecto
|
0.004 s | 1 KBi |
#3 |
Incorrecto
|
0.005 s | 1 KBi |
#4 |
Incorrecto
|
0.004 s | 2 KBi |
#5 |
Incorrecto
|
0.004 s | 1 KBi |
#6 |
Incorrecto
|
0.006 s | 1 KBi |
#7 |
Incorrecto
|
0.005 s | 2 KBi |
#8 |
Incorrecto
|
0.003 s | 2 KBi |
#9 |
Incorrecto
|
0.004 s | 2 KBi |
#10 |
Incorrecto
|
0.005 s | 1 KBi |
#11 |
Incorrecto
|
0.004 s | 1 KBi |
#12 |
Incorrecto
|
0.004 s | 1 KBi |
#13 |
Incorrecto
|
0.005 s | 1 KBi |
#14 |
Incorrecto
|
0.005 s | 2 KBi |
#15 |
Incorrecto
|
0.005 s | 1 KBi |
#16 |
Incorrecto
|
0.005 s | 1 KBi |
#17 |
Incorrecto
|
0.004 s | 2 KBi |
#18 |
Incorrecto
|
0.004 s | 2 KBi |
#19 |
Incorrecto
|
0.004 s | 2 KBi |
#20 |
Incorrecto
|
0.004 s | 2 KBi |
#21 |
Incorrecto
|
0.004 s | 2 KBi |
#22 |
Incorrecto
|
0.004 s | 2 KBi |
#23 |
Incorrecto
|
0.004 s | 1 KBi |
#24 |
Incorrecto
|
0.005 s | 1 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()) { tabla[str[subStrIndex]]; if (tabla.size() > maxDif) { break; } subStrLen++; subStrIndex++; } if (subStrLen > maxLen) { maxLen = subStrLen; } tabla.clear(); i++; } cout << maxLen << endl; return 0; }