제출 #1094

#제출 시각아이디문제언어결과실행 시간메모리
1094comicos줄 세우기 (KOI13_jul)C++98
컴파일 에러
0 ms0 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

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'