Submission #2938

# Submission time Handle Problem Language Result Execution time Memory
2938 2013-08-13T10:40:23 Z imsifile 생일수 I (GA4_birthday1) C++
100 / 100
76 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(x>=20&&x%8==4)j=20;
		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;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
7 Correct 0 ms 1088 KB Output is correct
8 Correct 0 ms 1088 KB Output is correct
9 Correct 0 ms 1088 KB Output is correct
10 Correct 0 ms 1088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 56 ms 1088 KB Output is correct
2 Correct 64 ms 1088 KB Output is correct
3 Correct 68 ms 1088 KB Output is correct
4 Correct 60 ms 1088 KB Output is correct
5 Correct 52 ms 1088 KB Output is correct
6 Correct 76 ms 1088 KB Output is correct
7 Correct 52 ms 1088 KB Output is correct
8 Correct 72 ms 1088 KB Output is correct
9 Correct 76 ms 1088 KB Output is correct
10 Correct 64 ms 1088 KB Output is correct
11 Correct 64 ms 1088 KB Output is correct
12 Correct 48 ms 1088 KB Output is correct
13 Correct 64 ms 1088 KB Output is correct
14 Correct 64 ms 1088 KB Output is correct
15 Correct 56 ms 1088 KB Output is correct
16 Correct 64 ms 1088 KB Output is correct
17 Correct 64 ms 1088 KB Output is correct
18 Correct 60 ms 1088 KB Output is correct
19 Correct 68 ms 1088 KB Output is correct
20 Correct 52 ms 1088 KB Output is correct
21 Correct 76 ms 1088 KB Output is correct
22 Correct 68 ms 1088 KB Output is correct
23 Correct 68 ms 1088 KB Output is correct
24 Correct 68 ms 1088 KB Output is correct
25 Correct 60 ms 1088 KB Output is correct