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

Envío 7210

Problema 0xcf - Mirando al horizonte

  • Autor: Prueba
  • Fecha: 2023-11-26 04:01:02 UTC (Hace 6 meses)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.012 s 3 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.013 s 3 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.012 s 3 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.011 s 3 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.011 s 3 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.027 s 8 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.02 s 6 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.042 s 20 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.015 s 7 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Unhandled Exception:
System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Input string was not in a correct format.
  at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) [0x0001a] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at System.Int32.Parse (System.String s) [0x00016] in <7a391fb795984bfe88ca30b111f22d2e>:0 
  at Program.Solve () [0x00020] in <6001111d751e4b89a80a829caf6d95c2>:0 
  at Program.Main (System.String[] args) [0x0002c] in <6001111d751e4b89a80a829caf6d95c2>:0 
0.022 s 15 KBi
Puntos totales: 0 / 100

Código

using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        int cases = int.Parse(Console.ReadLine());
        for (int c = 1; c <= cases; ++c)
        {
            Console.Write("Case #" + c + ":");
            Solve();
        }
    }

    static void Solve()
    {
        int n = int.Parse(Console.ReadLine());
        int[] a = new int[n];
        for (int i = 0; i < n; ++i)
        {
            a[i] = int.Parse(Console.ReadLine());
        }
        LinkedList<int> q = new LinkedList<int>();
        int[] answer = new int[n];
        for (int i = n - 1; i >= 0; --i)
        {
            while (q.Count > 0 && a[i] >= q.First.Value)
            {
                q.RemoveFirst();
            }
            answer[i] = q.Count == 0 ? -1 : q.First.Value;
            q.AddFirst(a[i]);
        }
        for (int i = 0; i < n; ++i)
        {
            Console.Write(" " + answer[i]);
        }
        Console.WriteLine();
    }
}