Submission #14160

# Submission time Handle Problem Language Result Execution time Memory
14160 2015-05-02T19:22:32 Z pichulia 이상한 수열 (OJUZ10_bizarre) C++
0 / 100
325 ms 25300 KB
#include<stdio.h>
#define M 1000000
int n, m;
int a[3100099];
int s[3100000];
int main()
{
	int i, j, k, l;
	scanf("%d",&n);
	for(i=0;i<n;i++){scanf("%d",&a[i]);s[a[i]+M]++;}
	scanf("%d",&m);
	int cnt=0;
	for(i=0;i<2*M+2;i++)if(s[i])cnt++;
	for(i=n;i<=m&& i<2*M+20;i++)
	{
		a[i]=cnt;
		s[cnt+M]++;
		if(s[cnt+M]==1)cnt++;
		printf("%d\n",cnt);
	}
	if(m<2*M+2)
	{
		printf("%d\n",a[m]);
	}
	else
	{
		int p,q;
		p = a[i-2];
		q = a[i-1];
		if(p==q)printf("%d\n",p);
		else
		{
			q+=(m-i)*(q-p);
			printf("%d\n",q);
		}
	}

}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 25300 KB Output isn't correct
2 Incorrect 4 ms 25300 KB Output isn't correct
3 Incorrect 0 ms 25300 KB Output isn't correct
4 Incorrect 0 ms 25300 KB Output isn't correct
5 Incorrect 4 ms 25300 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 25300 KB Output isn't correct
2 Incorrect 0 ms 25300 KB Output isn't correct
3 Incorrect 3 ms 25300 KB Output isn't correct
4 Incorrect 3 ms 25300 KB Output isn't correct
5 Incorrect 0 ms 25300 KB Output isn't correct
6 Incorrect 4 ms 25300 KB Output isn't correct
7 Incorrect 0 ms 25300 KB Output isn't correct
8 Incorrect 3 ms 25300 KB Output isn't correct
9 Incorrect 0 ms 25300 KB Output isn't correct
10 Incorrect 5 ms 25300 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 25300 KB Output isn't correct
2 Incorrect 0 ms 25300 KB Output isn't correct
3 Incorrect 5 ms 25300 KB Output isn't correct
4 Incorrect 5 ms 25300 KB Output isn't correct
5 Incorrect 11 ms 25300 KB Output isn't correct
6 Incorrect 0 ms 25300 KB Output isn't correct
7 Incorrect 21 ms 25300 KB Output isn't correct
8 Incorrect 11 ms 25300 KB Output isn't correct
9 Incorrect 5 ms 25300 KB Output isn't correct
10 Incorrect 9 ms 25300 KB Output isn't correct
11 Incorrect 7 ms 25300 KB Output isn't correct
12 Incorrect 0 ms 25300 KB Output isn't correct
13 Incorrect 11 ms 25300 KB Output isn't correct
14 Incorrect 0 ms 25300 KB Output isn't correct
15 Incorrect 11 ms 25300 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 215 ms 25300 KB Output isn't correct
2 Incorrect 243 ms 25300 KB Output isn't correct
3 Incorrect 270 ms 25300 KB Output isn't correct
4 Incorrect 224 ms 25300 KB Output isn't correct
5 Incorrect 303 ms 25300 KB Output isn't correct
6 Incorrect 221 ms 25300 KB Output isn't correct
7 Incorrect 280 ms 25300 KB Output isn't correct
8 Incorrect 251 ms 25300 KB Output isn't correct
9 Incorrect 325 ms 25300 KB Output isn't correct
10 Incorrect 238 ms 25300 KB Output isn't correct
11 Incorrect 257 ms 25300 KB Output isn't correct
12 Incorrect 207 ms 25300 KB Output isn't correct
13 Incorrect 303 ms 25300 KB Output isn't correct
14 Incorrect 114 ms 25300 KB Output isn't correct
15 Incorrect 287 ms 25300 KB Output isn't correct