답안 #2937

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
2937 2013-08-13T10:33:53 Z imsifile 생일수 I (GA4_birthday1) C++
14 / 100
68 ms 1088 KB
#include<stdio.h>
#define rp(a,b) for(i=b;i--;)putchar(a)

int m[8]={0,9,10,3,12,5,6,15};

void t(){
	int x,i,j;
	scanf("%d",&x),j=m[x%8];
	if(x<j)puts("-1");
	else{
		if(j%5)rp('3',j/3);
		else rp('5',j/5);
		rp('8',(x-j)/8);puts("");
	}
}

int main(){
	int n;
	for(scanf("%d",&n);n--;)t();
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 68 ms 1088 KB Output isn't correct
2 Halted 0 ms 0 KB -