# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
16631 | eaststar | 팩토리얼 세제곱들의 합 (YDX14_fact) | C++14 | 0 ms | 1916 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
int a[5]={1,1,2,6,24},s;
int main(){
int i,n,k;
scanf("%d%d",&n,&k);
if(!k)s=n+1;
else for(i=0;i<=n&&i<5;++i)s+=pow(a[i],k);
while(s%10==0)s/=10;
printf("%d",s%10);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |