답안 #14111

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14111 2015-05-02T06:04:54 Z ggoh 이상한 수열 (OJUZ10_bizarre) C++
62 / 100
13 ms 9112 KB
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<cstring>
int a,b,i,s,p,x[55555],c[2000002],M=1000000;
main()
{
	scanf("%d",&a);
	for(i=1;i<=a;i++)
	{
		scanf("%d",&x[i]);
		c[M+x[i]]++;
		if(c[M+x[i]]==1)s++;
	}
	scanf("%d",&b);
	if(b<=a)
	{
		printf("%d",x[b]);
		return 0;
	}
	else
	{
		for(i=a+1;i<=b&&i<=2e6+b;i++)
		{
			if(c[s+M]==0)
			{
				c[s+M]=1;
				s++;
			}
			else
			{
				p=1;
				s++;
				break;
			}
		}
		printf("%d",s-1);
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 9112 KB Output is correct
2 Correct 0 ms 9112 KB Output is correct
3 Correct 0 ms 9112 KB Output is correct
4 Correct 0 ms 9112 KB Output is correct
5 Correct 0 ms 9112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 9112 KB Output is correct
2 Correct 0 ms 9112 KB Output is correct
3 Correct 0 ms 9112 KB Output is correct
4 Correct 0 ms 9112 KB Output is correct
5 Correct 0 ms 9112 KB Output is correct
6 Correct 0 ms 9112 KB Output is correct
7 Correct 0 ms 9112 KB Output is correct
8 Correct 0 ms 9112 KB Output is correct
9 Correct 0 ms 9112 KB Output is correct
10 Correct 0 ms 9112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 9112 KB Output is correct
2 Correct 0 ms 9112 KB Output is correct
3 Correct 0 ms 9112 KB Output is correct
4 Correct 0 ms 9112 KB Output is correct
5 Correct 0 ms 9112 KB Output is correct
6 Correct 0 ms 9112 KB Output is correct
7 Correct 0 ms 9112 KB Output is correct
8 Correct 0 ms 9112 KB Output is correct
9 Correct 0 ms 9112 KB Output is correct
10 Correct 0 ms 9112 KB Output is correct
11 Correct 6 ms 9112 KB Output is correct
12 Correct 0 ms 9112 KB Output is correct
13 Correct 7 ms 9112 KB Output is correct
14 Correct 0 ms 9112 KB Output is correct
15 Correct 0 ms 9112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 9112 KB Output is correct
2 Incorrect 3 ms 9112 KB Output isn't correct
3 Correct 0 ms 9112 KB Output is correct
4 Incorrect 0 ms 9112 KB Output isn't correct
5 Incorrect 13 ms 9112 KB Output isn't correct
6 Incorrect 0 ms 9112 KB Output isn't correct
7 Correct 0 ms 9112 KB Output is correct
8 Incorrect 9 ms 9112 KB Output isn't correct
9 Correct 0 ms 9112 KB Output is correct
10 Correct 0 ms 9112 KB Output is correct
11 Incorrect 11 ms 9112 KB Output isn't correct
12 Incorrect 9 ms 9112 KB Output isn't correct
13 Incorrect 11 ms 9112 KB Output isn't correct
14 Correct 8 ms 9112 KB Output is correct
15 Incorrect 0 ms 9112 KB Output isn't correct