Submission #940855

#TimeUsernameProblemLanguageResultExecution timeMemory
940855rainboy팩토리얼 세제곱들의 합 (YDX14_fact)C11
0 / 1
1 ms348 KiB
#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)

fact.c: In function 'main':
fact.c:15:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |  scanf("%d%d", &n, &k);
      |  ^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...