Submission #14595

# Submission time Handle Problem Language Result Execution time Memory
14595 2015-05-21T03:38:39 Z ics0503 이상한 수열 (OJUZ10_bizarre) C++
0 / 100
1000 ms 8896 KB
#include <stdio.h>
#define MAX 1000001
int arr[MAX];
int check[MAX];

int main()
{
	int n;
	scanf("%d", &n);

	int i, j;
	for (i = 1; i <= n; i++)
		scanf("%d", &arr[i]);

	for (i = 1; i <= n; i++)
	{
		check[i] = 1;
		for (j = 1; j <= n; j++)
		{
			if (i == j)
				continue;
			if (arr[i] == arr[j] &&check[j] == 0)
			{
				check[j] = 1;
				arr[j] = 0;
			}
		}
	}
	int a = 0;
	for (i = 1; i <= n; i++)
	{
		if (arr[i] != 0)
			a += 1;
	}
	int m;
	scanf("%d", &m);

	arr[n + 1] = a;
	int sum = a;
	for (i = n + 1; i <= m; i++)
	{
		sum += 1;
		for (j = 1; j <= n; j++)
		{
			if (arr[i] == arr[j])
			{
				sum -= 1;
				break;
			}
		}
		arr[i + 1] = sum;
	}
	printf("%d", arr[m]);
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8896 KB Output is correct
2 Incorrect 0 ms 8896 KB Output isn't correct
3 Correct 0 ms 8896 KB Output is correct
4 Correct 0 ms 8896 KB Output is correct
5 Correct 0 ms 8896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8896 KB Output is correct
2 Correct 0 ms 8896 KB Output is correct
3 Incorrect 0 ms 8896 KB Output isn't correct
4 Correct 0 ms 8896 KB Output is correct
5 Incorrect 0 ms 8896 KB Output isn't correct
6 Correct 0 ms 8896 KB Output is correct
7 Correct 0 ms 8896 KB Output is correct
8 Correct 0 ms 8896 KB Output is correct
9 Incorrect 0 ms 8896 KB Output isn't correct
10 Correct 0 ms 8896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 8892 KB Program timed out
2 Correct 299 ms 8896 KB Output is correct
3 Execution timed out 1000 ms 8892 KB Program timed out
4 Execution timed out 1000 ms 8892 KB Program timed out
5 Correct 143 ms 8896 KB Output is correct
6 Correct 316 ms 8896 KB Output is correct
7 Execution timed out 1000 ms 8892 KB Program timed out
8 Execution timed out 1000 ms 8892 KB Program timed out
9 Execution timed out 1000 ms 8892 KB Program timed out
10 Incorrect 348 ms 8896 KB Output isn't correct
11 Execution timed out 1000 ms 8892 KB Program timed out
12 Execution timed out 1000 ms 8892 KB Program timed out
13 Execution timed out 1000 ms 8892 KB Program timed out
14 Execution timed out 1000 ms 8892 KB Program timed out
15 Execution timed out 1000 ms 8892 KB Program timed out
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 8892 KB Program timed out
2 Execution timed out 1000 ms 8892 KB Program timed out
3 Execution timed out 1000 ms 8892 KB Program timed out
4 Execution timed out 1000 ms 8892 KB Program timed out
5 Execution timed out 1000 ms 8892 KB Program timed out
6 Execution timed out 1000 ms 8892 KB Program timed out
7 Execution timed out 1000 ms 8892 KB Program timed out
8 Execution timed out 1000 ms 8892 KB Program timed out
9 Runtime error 0 ms 8892 KB SIGSEGV Segmentation fault
10 Execution timed out 1000 ms 8892 KB Program timed out
11 Execution timed out 1000 ms 8892 KB Program timed out
12 Execution timed out 1000 ms 8892 KB Program timed out
13 Execution timed out 1000 ms 8892 KB Program timed out
14 Execution timed out 1000 ms 8892 KB Program timed out
15 Execution timed out 1000 ms 8892 KB Program timed out