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

Envío 2014

Problema 0x5c - Decir si hay una letra repetida

  • Autor: juantamayo26
  • Fecha: 2020-11-17 01:55:03 UTC (Hace más de 3 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.007 s 1 KBi
#2
Correcto
0.006 s 1 KBi
#3
Correcto
0.006 s 1 KBi
#4
Correcto
0.006 s 1 KBi
#5
Correcto
0.006 s 1 KBi
#6
Correcto
0.007 s 2 KBi
#7
Correcto
0.007 s 1 KBi
#8
Correcto
0.006 s 1 KBi
#9
Correcto
0.007 s 5 KBi
#10
Correcto
0.006 s 1 KBi
#11
Correcto
0.006 s 1 KBi
#12
Correcto
0.006 s 1 KBi
Puntos totales: 100 / 100

Código

#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define ll long long
#define pii pair<int, int>
const int maxi = 1e9;

int main(){
  ios::sync_with_stdio(0); cin.tie(0); 
  string s;
  cin>>s;
  map<char, int>c;
  for(int i=0;i<s.size(); i++){
    if(c[s[i]]){
      cout<<"yes"<<endl;
      return 0;
    }
    c[s[i]]++;
  }
  cout<<"no"<<endl;
  
  return 0;
}