Submission #18857

#TimeUsernameProblemLanguageResultExecution timeMemory
18857Namnamseo생일수 I (GA4_birthday1)C++14
100 / 100
101 ms1084 KiB
#include <cstdio> int tmp[10]; int main() { for(int i=0;i<8;++i){ tmp[i]=i; while(tmp[i]%3 && tmp[i]%5) tmp[i]+=8; } int t; scanf("%d",&t); for(;t--;){ int n; scanf("%d",&n); int a=tmp[n&7]; if(n<a){ puts("-1"); continue; } if(a==12 && n>=20) a=20; n-=a; if(a%5 == 0) for(;a;a-=5) putchar('5'); else for(;a;a-=3) putchar('3'); for(;n;n-=8) putchar('8'); putchar(10); } 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...