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

Envío 531

Problema 0xcf - Mirando al horizonte

  • Autor: FatChicken277
  • Fecha: 2020-09-07 00:21:42 UTC (Hace más de 3 años)
Caso # Resultado Tiempo Memoria
#1
Tiempo límite excedido
0.393 s 4 KBi
#2
Tiempo límite excedido
0.33 s 10 KBi
#3
Tiempo límite excedido
0.364 s 53 KBi
#4
Tiempo límite excedido
0.296 s 8 KBi
#5
Tiempo límite excedido
0.359 s 4 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 153
run: line 1:     3 File size limit exceeded(core dumped) ./a.out
0.34 s 11 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 153
run: line 1:     3 File size limit exceeded(core dumped) ./a.out
0.32 s 10 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 153
run: line 1:     3 File size limit exceeded(core dumped) ./a.out
0.382 s 14 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 153
run: line 1:     3 File size limit exceeded(core dumped) ./a.out
0.376 s 15 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 153
run: line 1:     3 File size limit exceeded(core dumped) ./a.out
0.39 s 10 KBi
Puntos totales: 0 / 100

Código

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main() {
    int q, size, max;
    cin >> q;
    
    for (int i = 1; i <= q; i++)
    {
        cin >> size;
        cout << "Case #" << i << ": ";
        
        vector<int> a(size);
        string result;
        
        for(int j = 0; j < size; j++)
            cin >> a[j];
        
        for (int j = size - 1; j >= 0; j--)
        {
            if (j == size - 1)
                 max = a[j];
            if (a[j] < max)
                result += to_string(max) + " ";
            else
            {
                result += "-1 ";
                max = a[j];
            }
        }
        for(i = result.length() - 1; i >= 0; i--)
            cout<<result[i];
        cout << endl;
    }

    return (0);
}