Submission #21156

#TimeUsernameProblemLanguageResultExecution timeMemory
21156jayceking팩토리얼 세제곱들의 합 (YDX14_fact)C++14
0 / 1
0 ms1116 KiB
#include<cstdio> int main() { int n, k; scanf("%d %d", &n, &k); int d = 0; int arr[4][5] = { {1,1,1,1,1}, {1,1,2,6,4},{ 1,1,4,6,6},{1,1,6,6,6} }; if (n > 4) n = 4; for (int i = 0;i <= n;++i) { d += arr[k][i]; } while (!(d % 10)) { d /= 10; } printf("%d", d % 10); }

Compilation message (stderr)

fact.cpp: In function 'int main()':
fact.cpp:5:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &k);
                        ^

#Verdict Execution timeMemoryGrader output
Fetching results...