Submission #2352

#TimeUsernameProblemLanguageResultExecution timeMemory
2352qkrqudrb07생일수 I (GA4_birthday1)C++98
0 / 100
1000 ms4792 KiB
#include<stdio.h> int d[1000000]; int main() { int n,j,q,w,e,a,aa,ew=9999999,cnt,i; scanf("%d",&n); for(j=1; j<=n; j++){ scanf("%d",&a); ew=99999999; for(q=0; q<=a/3; q++){ for(w=0; w<=a/5; w++){ for(e=0; e<=a/8; e++){ // printf("%d %d %d\n",q,w,e); if(3*q+5*w+8*e==a){ if(ew>q+w+e){ ew=q+w+e; cnt=0; for(aa=1; aa<=q; aa++){ cnt++; d[cnt]=3; } for(aa=1; aa<=w; aa++){ cnt++; d[cnt]=5; } for(aa=1; aa<=e; aa++){ cnt++; d[cnt]=8; } } //q=a/3; w=a/5; e=a/8; } } } } for(i=1; i<=cnt; i++) printf("%d",d[i]); } 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...