Submission #796842

# Submission time Handle Problem Language Result Execution time Memory
796842 2023-07-28T19:55:02 Z raphaelp Zapina (COCI20_zapina) C++17
Compilation error
0 ms 0 KB
using namespace std;
int main()
{
    long long N;
    cin>>N;
    long long tot=1;
    for(int i=0; i<N; i++)
    {
        tot*=N;
        tot= tot%1000000007;
    }
    vector<vector<long long>> tab (N+1, vector<long long> (N+1,0));
    tab[1][0]=1;
    for (long long i=1; i<N; i++)
    {
        for (long long j=0; j<=N; j++)
        {
            if (tab[i][j]==0) break;
            long long mult=1;
            for (long long p=0; p<=min(i,N-j); p++)
            {
                tab[i+1][j+p]+=tab[i][j]*mult;
                tab[i+1][j+p]=tab[i+1][j+p]%1000000007;
                mult*=N-j-p;
                mult=mult%1000000007;
            }
        }
    }
    tot-=tab[N][N];
    tot=tot%1000000007;
    cout<<tot;
}

Compilation message

zapina.cpp:5:2: error: extended character   is not valid in an identifier
    5 |     long long N;
      |  ^
zapina.cpp:13:2: error: extended character   is not valid in an identifier
   13 |     vector<vector<long long>> tab (N+1, vector<long long> (N+1,0));
      |  ^
zapina.cpp:13:5: error: extended character   is not valid in an identifier
   13 |     vector<vector<long long>> tab (N+1, vector<long long> (N+1,0));
      |    ^
zapina.cpp: In function 'int main()':
zapina.cpp:5:2: error: '\U000000a0' was not declared in this scope
    5 |     long long N;
      |  ^
zapina.cpp:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>N;
      |     ^~~
zapina.cpp:1:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
  +++ |+#include <iostream>
    1 | 
zapina.cpp:6:10: error: 'N' was not declared in this scope
    6 |     cin>>N;
      |          ^
zapina.cpp:13:4: error: expected ';' before '\U000000a0vector'
   13 |     vector<vector<long long>> tab (N+1, vector<long long> (N+1,0));
      |   ^~~~~~~~
      |   ;
zapina.cpp:14:5: error: 'tab' was not declared in this scope
   14 |     tab[1][0]=1;
      |     ^~~
zapina.cpp:21:36: error: 'min' was not declared in this scope; did you mean 'main'?
   21 |             for (long long p=0; p<=min(i,N-j); p++)
      |                                    ^~~
      |                                    main
zapina.cpp:32:5: error: 'cout' was not declared in this scope
   32 |     cout<<tot;
      |     ^~~~
zapina.cpp:32:5: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?