# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
750049 | 2023-05-29T05:42:48 Z | sumit_kk10 | 나머지들의 합 (NOI12_modsum) | C++14 | 113 ms | 396 KB |
#include <stdio.h> #include <math.h> int computeSum(int currentSum, int currentIndex, int n, int v[], int w[]) { if (currentIndex == n) { return (((int)(pow(currentSum,4)) + 2*(int)(pow(currentSum,2))) % 5 )+ 1; } int tempSum = 0; for (int i = v[currentIndex]; i <= w[currentIndex]; i++) { tempSum += computeSum((currentSum + i) % 5, currentIndex + 1, n, v, w); } return tempSum; } int main() { int n; scanf("%d", &n); int v[n], w[n]; for (int i = 0; i < n; i++) { scanf("%d %d", &v[i], &w[i]); } int sum = computeSum(0, 0, n, v, w); printf("%d\n", sum); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 288 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 284 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 2 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 288 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 300 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 4 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 5 ms | 300 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Correct | 9 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 396 KB | Output is correct |
2 | Correct | 1 ms | 288 KB | Output is correct |
3 | Correct | 37 ms | 352 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 113 ms | 348 KB | Output is correct |