Submission #4450

#TimeUsernameProblemLanguageResultExecution timeMemory
4450model_code입력숫자 (KOI13_mystery)C++98
100 / 100
0 ms1088 KiB
#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);
	for(i = 0; i < n; i++)
		printf("%d ", res[i]);
		
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...