Submission #4460

# Submission time Handle Problem Language Result Execution time Memory
4460 2013-10-07T05:37:31 Z yourID 입력숫자 (KOI13_mystery) C++
0 / 100
0 ms 1088 KB
#include <stdio.h>

int main(void)
{
	int NUM[50];
	int res[50] = {0,};
	int n;

	scanf("%d", &n);
	int i;
	for(i = 0; i < n; i++)
		scanf("%d", &NUM[i]);

	int count = 0, from = 0, value;
	
	while(count < n)
	{
		while(res[from] != 0)
		{
			from = (from+1)%n;
		}
		res[from] = NUM[count];
		count++;
		from = (res[from]+from) % n;
	}

	printf("%d\n", n-1);
	for(i = 0; i < n; i++)
		printf("%d ", res[i]);
		
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -