Submission #1094

# Submission time Handle Problem Language Result Execution time Memory
1094 2013-06-25T06:08:44 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'