Submission #15920

#TimeUsernameProblemLanguageResultExecution timeMemory
15920ggoh팩토리얼 세제곱들의 합 (YDX14_fact)C++98
1 / 1
0 ms1084 KiB
#include<cstdio> int a,b,x[]={1,2,4,1},y[]={1,2,6,2},z[]={1,2,1,6}; main() { scanf("%d%d",&a,&b); if(b==0) { a++; while(a%10==0)a/=10; printf("%d",a%10); } else if(b==1) { if(a>=4)printf("4"); else printf("%d",x[a]); } else if(b==2) { if(a>=4)printf("8"); else printf("%d",y[a]); } else { if(a>=4)printf("5"); else printf("%d",z[a]); } }
#Verdict Execution timeMemoryGrader output
Fetching results...