Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.017 s | 3 KBi |
#2 |
Incorrecto
|
0.005 s | 3 KBi |
#3 |
Correcto
|
0.06 s | 4 KBi |
#4 |
Tiempo límite excedido
|
1.041 s | 12 KBi |
#5 |
Tiempo límite excedido
|
1.009 s | 12 KBi |
#6 |
Tiempo límite excedido
|
1.061 s | 23 KBi |
#7 |
Tiempo límite excedido
|
1.057 s | 29 KBi |
#8 |
Tiempo límite excedido
|
1.154 s | 19 KBi |
package main import ( "bufio" "fmt" "os" "strconv" "strings" ) func main() { reader := bufio.NewReader(os.Stdin) n, _ := reader.ReadString('\n') n = strings.ReplaceAll(n, "\n", "") nArray, _ := reader.ReadString('\n') nArray = strings.ReplaceAll(nArray, "\n", "") numbers := strings.Split(nArray, " ") c, _ := reader.ReadString('\n') c = strings.ReplaceAll(c, "\n", "") cNumber, _ := strconv.ParseInt(c, 10, 64) for i := 0; i < int(cNumber); i++ { caseLine, _ := reader.ReadString('\n') caseLine = strings.ReplaceAll(caseLine, "\n", "") numbersCase := strings.Split(caseLine, " ") numberOne, _ := strconv.ParseInt(numbersCase[0], 10, 64) numberTwo, _ := strconv.ParseInt(numbersCase[1], 10, 64) numberSearch := numbersCase[2] sliceNumber := strings.Join(numbers[numberOne:numberTwo+1], " ") fmt.Println(strings.Count(sliceNumber, numberSearch)) } }