Submission details
Task:Dice Combinations
Sender:aalto26ch_006
Submission time:2026-09-12 16:59:35 +0300
Language:C
Status:COMPILE ERROR

Compiler report

input/code.c: In function 'main':
input/code.c:3:11: warning: implicit declaration of function 'pow' [-Wimplicit-function-declaration]
    3 | #define N pow(10,9)+7
      |           ^~~
input/code.c:16:29: note: in expansion of macro 'N'
   16 |                 count[x] %= N;
      |                             ^
input/code.c:2:1: note: include '<math.h>' or provide a declaration of 'pow'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | 
input/code.c:3:11: warning: incompatible implicit declaration of built-in function 'pow' [-Wbuiltin-declaration-mismatch]
    3 | #define N pow(10,9)+7
      |           ^~~
input/code.c:16:29: note: in expansion of macro 'N'
   16 |                 count[x] %= N;
      |                             ^
input/code.c:3:11: note: include '<math.h>' or provide a declaration of 'pow'
    3 | #define N pow(10,9)+7
      |           ^~~
input/code.c:16:29: note: in expansion of macro 'N'
   16 |                 count[x] %= N;
      |...

Code

#include <stdio.h>

#define N pow(10,9)+7

int main() {
    int n;
    scanf("%d", &n);

    int count[n+1];
    count[0] = 1;

    for (int x=1; x<n+1; x++) {
        for (int k=1; k<=6; k++) {
            if (x-k >= 0) {
                count[x] += count[x-k];
                count[x] %= N;
            }
        }
    }
    printf("%d",count[n]);
}