# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
940855 | rainboy | 팩토리얼 세제곱들의 합 (YDX14_fact) | C11 | 1 ms | 348 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 <stdio.h>
int min(int a, int b) { return a < b ? a : b; }
int ans[4][5] = {
{ 1, 2, 3, 4, 5 },
{ 1, 2, 4, 0, 4 },
{ 1, 2, 6, 2, 8 },
{ 1, 2, 0, 6, 0 }
};
int main() {
int n, k;
scanf("%d%d", &n, &k);
printf("%d\n", k == 0 ? (n + 1) % 10 : ans[k][min(n, 4)]);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |