Submission details
Task:Dice Combinations
Sender:aalto26ch_014
Submission time:2026-09-13 23:21:05 +0300
Language:C++ (C++20)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:6:5: error: 'uint64_t' was not declared in this scope
    6 |     uint64_t n;
      |     ^~~~~~~~
input/code.cpp:3:1: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
    2 | #include <vector>
  +++ |+#include <cstdint>
    3 | using namespace std;
input/code.cpp:7:12: error: 'n' was not declared in this scope
    7 |     cin >> n;
      |            ^
input/code.cpp:8:20: error: template argument 2 is invalid
    8 |     vector<uint64_t> count(n + 1);
      |                    ^
input/code.cpp:9:10: error: invalid types 'int[int]' for array subscript
    9 |     count[0] = 1;
      |          ^
input/code.cpp:10:18: error: expected ';' before 'i'
   10 |     for (uint64_t i = 1; i <= n; i++){
      |                  ^~
      |                  ;
input/code.cpp:10:26: error: 'i' was not declared in this scope
   10 |     for (uint64_t i = 1; i <= n; i++){
      |...

Code

#include <iostream>
#include <vector>
using namespace std;

int main(){
    uint64_t n;
    cin >> n;
    vector<uint64_t> count(n + 1);
    count[0] = 1;
    for (uint64_t i = 1; i <= n; i++){
        for(uint64_t j = 1; j < 6; j++){
            if (i-j >= 0){
                count[i] += count[i - j];
                count[i] % (1000000000 + 7);
            }
        }
    }
    if (n != 0)
    {
        cout << count[n];        
    }
    else
    {
        cout << 0;
    }
}