Submission #15936

#TimeUsernameProblemLanguageResultExecution timeMemory
15936jihoon팩토리얼 세제곱들의 합 (YDX14_fact)C++98
1 / 1
0 ms1084 KiB
#include<cstdio> int main(){ int n,k; scanf("%d %d",&n,&k); if(k==0){ int dap=n+1; while(dap%10==0){ dap/=10; } printf("%d",dap%10); }else if(k==1){ if(n==1) printf("2"); else if(n==2) printf("4"); else if(n==3) printf("1"); else printf("4"); }else if(k==2){ if(n==1) printf("2"); else if(n==2) printf("6"); else if(n==3) printf("2"); else printf("8"); }else{ if(n==1) printf("2"); else if(n==2) printf("1"); else if(n==3) printf("6"); else printf("5"); } }
#Verdict Execution timeMemoryGrader output
Fetching results...