Submission #1153

# Submission time Handle Problem Language Result Execution time Memory
1153 2013-06-28T06:50:15 Z kriii 줄 세우기 (KOI13_jul) C++
22 / 22
175 ms 4792 KB
#include <stdio.h>

int N,I[1000100],U;

int main()
{
	int i,x,l;

	scanf ("%d",&N);
	for (i=1;i<=N;i++){
		scanf ("%d",&x);
		I[x] = i;
	}
	
	U = l = 1;
	for (i=2;i<=N;i++){
		if (I[i-1] < I[i]) l++;
		else l = 1;
		if (U < l) U = l;
	}

	printf ("%d",N-U);

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 4792 KB Output is correct
2 Correct 0 ms 4792 KB Output is correct
3 Correct 0 ms 4792 KB Output is correct
4 Correct 0 ms 4792 KB Output is correct
5 Correct 0 ms 4792 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 4792 KB Output is correct
2 Correct 0 ms 4792 KB Output is correct
3 Correct 0 ms 4792 KB Output is correct
4 Correct 0 ms 4792 KB Output is correct
5 Correct 0 ms 4792 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 4792 KB Output is correct
2 Correct 1 ms 4792 KB Output is correct
3 Correct 2 ms 4792 KB Output is correct
4 Correct 1 ms 4792 KB Output is correct
5 Correct 2 ms 4792 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4792 KB Output is correct
2 Correct 5 ms 4792 KB Output is correct
3 Correct 13 ms 4792 KB Output is correct
4 Correct 24 ms 4792 KB Output is correct
5 Correct 57 ms 4792 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 90 ms 4792 KB Output is correct
2 Correct 116 ms 4792 KB Output is correct
3 Correct 150 ms 4792 KB Output is correct
4 Correct 175 ms 4792 KB Output is correct
5 Correct 174 ms 4792 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 165 ms 4792 KB Output is correct
2 Correct 171 ms 4792 KB Output is correct
3 Correct 172 ms 4792 KB Output is correct
4 Correct 174 ms 4792 KB Output is correct
5 Correct 173 ms 4792 KB Output is correct