Submission #1102

# Submission time Handle Problem Language Result Execution time Memory
1102 2013-06-25T07:19:36 Z comicos 줄 세우기 (KOI13_jul) C++
Compilation error
0 ms 0 KB
#include <stdio.h>
#define M 1010000

int a [M],d [M];

int main (void)

{
//	freopen ("input29.txt","r",stdin);
//	freopen ("output.txt","w",stdout);

	int n,cnt = 1,max = 0;

	scanf ("%d",&n);

	for (int i = 1; i <= n; i++)
	{
		scanf ("%d",&a[i]);
		d [a[i]] = i;
	}

	for (i = 1; i <= n; i++)
	{
		if (d [i] < d[i + 1])
			cnt++;
		else
			cnt = 1;
		

		if (cnt > max)
			max = cnt;
	}

	printf ("%d",n - max);

	return 0;
}

Compilation message

jul.cpp: In function 'int main()':
jul.cpp:22: error: name lookup of 'i' changed for new ISO 'for' scoping
jul.cpp:16: error:   using obsolete binding at 'i'