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

Envío 5922

Problema 0xca - Contar cuantas veces aparece X en un subarreglo

  • Autor: bryancalisto
  • Fecha: 2022-03-29 00:17:42 UTC (Hace casi 2 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.01 s 3 KBi
#2
Correcto
0.025 s 5 KBi
#3
Correcto
0.064 s 3 KBi
#4
Tiempo límite excedido
1.564 s 4 KBi
#5
Tiempo límite excedido
1.545 s 6 KBi
#6
Tiempo límite excedido
1.58 s 11 KBi
#7
Tiempo límite excedido
1.572 s 11 KBi
#8
Tiempo límite excedido
1.594 s 11 KBi
Puntos totales: 38 / 100

Código

N = input()
arr = input().split(' ')
times = int(input())
mem = {}

for i in range(times):
    case = input().split(' ')
    l = int(case[0])
    r = int(case[1])
    q = case[2]
    count = 0

    for j in range(l, r + 1):
        if arr[j] == q:
            count += 1

    print(count)