█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 2098

Problema 0x43 - Encontrar el borde más largo de una string

  • Autor: ppastram
  • Fecha: 2020-11-23 18:24:16 UTC (Hace más de 3 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.005 s 1 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.005 s 1 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.006 s 1 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.006 s 1 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.005 s 1 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.005 s 1 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.008 s 1 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 2 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 2 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.009 s 1 KBi
#11
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 2 KBi
#12
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 1 KBi
#13
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.009 s 1 KBi
#14
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 1 KBi
#15
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 1 KBi
#16
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.009 s 1 KBi
#17
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.008 s 1 KBi
#18
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 1 KBi
#19
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.008 s 1 KBi
#20
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 1 KBi
#21
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 1 KBi
#22
Error en tiempo de ejecución (NZEC)
Exited with error status 1
0.007 s 1 KBi
Puntos totales: 0 / 100

Código

#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <stack>
#include <algorithm>
#define forn(a, n) for(int a = 0; a<(int) (n); ++a)
#define rforn(a, n) for(int a = (n)-1; a>=0; --a)
using namespace std;
const int N = 6e5+20;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    string s;
    cin>>s;

    if(s.size() == 0) { cout<<0<<endl; return 1; }
    if(s.size() == 1) { cout<<1<<endl; return 1; }

    int i = 0;
    int lleva = 0;
    for(int j = 1; j < s.size(); j++)
    {
        if(s[i] == s[j])
        {
            for(int k = i; k < s.size()-1; i++, k++)
            {
                if(s[i] != s[j]) {break; lleva = 0;}
                lleva++;
                j++;
            }
        }
    }
    cout<<lleva<<endl;
    return 1;
}