Submission #2495

#TimeUsernameProblemLanguageResultExecution timeMemory
2495jihoon생일수 I (GA4_birthday1)C++98
100 / 100
89 ms884 KiB
#include<stdio.h> int a; int tw[3]={0,2,1}; int us[3]={0}; int tt[2]={0}; int t; int m; int main(){ int i,j; scanf("%d",&t); for(i=0;i<t;i++){ scanf("%d",&a); if(a==1||a==2||a==4||a==7) printf("-1\n"); else{ if(a==12) printf("3333\n"); else{ m=a%8; switch(m){ case 0: for(j=0;j<a/8;j++) printf("8"); break; case 1: printf("333"); for(j=0;j<(a-9)/8;j++) printf("8"); break; case 2: printf("55"); for(j=0;j<(a-10)/8;j++) printf("8"); break; case 3: printf("3"); for(j=0;j<(a-3)/8;j++) printf("8"); break; case 4: printf("5555"); for(j=0;j<(a-20)/8;j++) printf("8"); break; case 5: printf("5"); for(j=0;j<(a-5)/8;j++) printf("8"); break; case 6: printf("33"); for(j=0;j<(a-6)/8;j++) printf("8"); break; case 7: printf("555"); for(j=0;j<(a-15)/8;j++) printf("8"); break; } printf("\n"); } } } 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...