# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1917 |
2013-07-19T11:10:07 Z |
gs13105 |
생일수 I (GA4_birthday1) |
C++ |
|
105 ms |
884 KB |
#include <stdio.h>
int main()
{
int T,N,n3,n5,n8,i,j;
scanf("%d",&T);
for(i=0;i<T;i++)
{
n3=0;
n5=0;
n8=0;
scanf("%d",&N);
if(N==1||N==2||N==4||N==7)
{
printf("-1\n");
continue;
}
while(N>=8)
{
if(N==9||N==10||N==12||N==15||N==20)
break;
n8++;
N-=8;
}
while(N>=5)
{
if(N==6||N==9||N==12)
break;
n5++;
N-=5;
}
while(N>=3)
{
n3++;
N-=3;
}
for(j=0;j<n3;j++)
printf("3");
for(j=0;j<n5;j++)
printf("5");
for(j=0;j<n8;j++)
printf("8");
printf("\n");
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
884 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
884 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
884 KB |
Output is correct |
2 |
Correct |
0 ms |
884 KB |
Output is correct |
3 |
Correct |
0 ms |
884 KB |
Output is correct |
4 |
Correct |
0 ms |
884 KB |
Output is correct |
5 |
Correct |
0 ms |
884 KB |
Output is correct |
6 |
Correct |
0 ms |
884 KB |
Output is correct |
7 |
Correct |
0 ms |
884 KB |
Output is correct |
8 |
Correct |
0 ms |
884 KB |
Output is correct |
9 |
Correct |
0 ms |
884 KB |
Output is correct |
10 |
Correct |
0 ms |
884 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
884 KB |
Output is correct |
2 |
Correct |
84 ms |
884 KB |
Output is correct |
3 |
Correct |
96 ms |
884 KB |
Output is correct |
4 |
Correct |
75 ms |
884 KB |
Output is correct |
5 |
Correct |
90 ms |
884 KB |
Output is correct |
6 |
Correct |
89 ms |
884 KB |
Output is correct |
7 |
Correct |
84 ms |
884 KB |
Output is correct |
8 |
Correct |
94 ms |
884 KB |
Output is correct |
9 |
Correct |
89 ms |
884 KB |
Output is correct |
10 |
Correct |
103 ms |
884 KB |
Output is correct |
11 |
Correct |
81 ms |
884 KB |
Output is correct |
12 |
Correct |
78 ms |
884 KB |
Output is correct |
13 |
Correct |
101 ms |
884 KB |
Output is correct |
14 |
Correct |
97 ms |
884 KB |
Output is correct |
15 |
Correct |
97 ms |
884 KB |
Output is correct |
16 |
Correct |
85 ms |
884 KB |
Output is correct |
17 |
Correct |
88 ms |
884 KB |
Output is correct |
18 |
Correct |
77 ms |
884 KB |
Output is correct |
19 |
Correct |
105 ms |
884 KB |
Output is correct |
20 |
Correct |
74 ms |
884 KB |
Output is correct |
21 |
Correct |
97 ms |
884 KB |
Output is correct |
22 |
Correct |
83 ms |
884 KB |
Output is correct |
23 |
Correct |
76 ms |
884 KB |
Output is correct |
24 |
Correct |
76 ms |
884 KB |
Output is correct |
25 |
Correct |
96 ms |
884 KB |
Output is correct |