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

Envío 3950

Problema 0x9d - ¿Está ordenado?

  • Autor: williamzborja
  • Fecha: 2021-04-24 22:30:22 UTC (Hace alrededor de 3 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.004 s 17 KBi
#2
Incorrecto
0.003 s 2 KBi
#3
Incorrecto
0.005 s 24 KBi
#4
Incorrecto
0.004 s 24 KBi
#5
Incorrecto
0.005 s 2 KBi
#6
Correcto
0.004 s 8 KBi
#7
Correcto
0.005 s 2 KBi
#8
Correcto
0.003 s 2 KBi
#9
Incorrecto
0.005 s 1 KBi
#10
Incorrecto
0.006 s 2 KBi
#11
Correcto
0.003 s 2 KBi
#12
Correcto
0.006 s 2 KBi
Puntos totales: 50 / 100

Código

#include <iostream>

using namespace std;

int main(void)
{
	int previous, current, n;
	size_t i;
	bool sorted = true;

	cin >> n;
	cin >> previous ;

	for (i = 0; i < n; ++i)
	{
		cin >> current;
		if (previous > current)
			break;
	}
	if (sorted)
		cout << "Ordenado" << endl;
	else
		cout << "Desordenado" << endl;
	return 0;
}