Submission #13961

# Submission time Handle Problem Language Result Execution time Memory
13961 2015-04-24T16:12:43 Z kriii 이상한 수열 (OJUZ10_bizarre) C++14
100 / 100
15 ms 12800 KB
#include <stdio.h>

int N,B[2000000],S;
bool chk[4000000];

int main()
{
	scanf ("%d",&N);
	for (int i=0;i<N;i++){
		scanf ("%d",&B[i]);
		if (!chk[B[i]+1000000]){
			chk[B[i]+1000000] = 1;
			S++;
		}
	}
	for (int i=N;i<2000000;i++){
		int u = S;
		B[i] = u;
		if (!chk[u+1000000]){
			chk[u+1000000] = 1;
			S++;
		}
	}

	int M,A;
	scanf ("%d",&M); M--;
	if (M < 2000000) A = B[M];
	else A = B[1999999] + (M - 1999999) * (B[1999999] - B[1999998]);

	printf ("%d\n",A);

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 12800 KB Output is correct
2 Correct 5 ms 12800 KB Output is correct
3 Correct 5 ms 12800 KB Output is correct
4 Correct 5 ms 12800 KB Output is correct
5 Correct 5 ms 12800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 12800 KB Output is correct
2 Correct 4 ms 12800 KB Output is correct
3 Correct 0 ms 12800 KB Output is correct
4 Correct 4 ms 12800 KB Output is correct
5 Correct 0 ms 12800 KB Output is correct
6 Correct 4 ms 12800 KB Output is correct
7 Correct 5 ms 12800 KB Output is correct
8 Correct 0 ms 12800 KB Output is correct
9 Correct 5 ms 12800 KB Output is correct
10 Correct 5 ms 12800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 12800 KB Output is correct
2 Correct 11 ms 12800 KB Output is correct
3 Correct 4 ms 12800 KB Output is correct
4 Correct 3 ms 12800 KB Output is correct
5 Correct 5 ms 12800 KB Output is correct
6 Correct 15 ms 12800 KB Output is correct
7 Correct 7 ms 12800 KB Output is correct
8 Correct 8 ms 12800 KB Output is correct
9 Correct 10 ms 12800 KB Output is correct
10 Correct 6 ms 12800 KB Output is correct
11 Correct 4 ms 12800 KB Output is correct
12 Correct 10 ms 12800 KB Output is correct
13 Correct 9 ms 12800 KB Output is correct
14 Correct 0 ms 12800 KB Output is correct
15 Correct 3 ms 12800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 12800 KB Output is correct
2 Correct 13 ms 12800 KB Output is correct
3 Correct 12 ms 12800 KB Output is correct
4 Correct 0 ms 12800 KB Output is correct
5 Correct 11 ms 12800 KB Output is correct
6 Correct 4 ms 12800 KB Output is correct
7 Correct 7 ms 12800 KB Output is correct
8 Correct 7 ms 12800 KB Output is correct
9 Correct 8 ms 12800 KB Output is correct
10 Correct 5 ms 12800 KB Output is correct
11 Correct 0 ms 12800 KB Output is correct
12 Correct 7 ms 12800 KB Output is correct
13 Correct 9 ms 12800 KB Output is correct
14 Correct 11 ms 12800 KB Output is correct
15 Correct 9 ms 12800 KB Output is correct