Submission #796820

# Submission time Handle Problem Language Result Execution time Memory
796820 2023-07-28T19:17:42 Z raphaelp Zapina (COCI20_zapina) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
int main(){    
  int 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<int> (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:12:2: error: extended character   is not valid in an identifier
   12 |   vector<vector<long long>> tab (N+1, vector<int> (N+1,0));  
      |  ^
zapina.cpp:12:62: error: extended character   is not valid in an identifier
   12 |   vector<vector<long long>> tab (N+1, vector<int> (N+1,0));  
      |                                                             ^
zapina.cpp:13:2: error: extended character   is not valid in an identifier
   13 |   tab[1][0]=1;
      |  ^
zapina.cpp:14:2: error: extended character   is not valid in an identifier
   14 |   for (long long i=1; i<N; i++)
      |  ^
zapina.cpp:15:5: error: extended character   is not valid in an identifier
   15 |   {    
      |     ^
zapina.cpp:15:8: error: extended character   is not valid in an identifier
   15 |   {    
      |       ^
zapina.cpp:16:2: error: extended character   is not valid in an identifier
   16 |     for (long long j=0; j<=N; j++)
      |  ^
zapina.cpp:16:5: error: extended character   is not valid in an identifier
   16 |     for (long long j=0; j<=N; j++)
      |    ^
zapina.cpp:17:2: error: extended character   is not valid in an identifier
   17 |     {        
      |  ^
zapina.cpp:17:8: error: extended character   is not valid in an identifier
   17 |     {        
      |       ^
zapina.cpp:17:11: error: extended character   is not valid in an identifier
   17 |     {        
      |         ^
zapina.cpp:17:14: error: extended character   is not valid in an identifier
   17 |     {        
      |           ^
zapina.cpp:17:17: error: extended character   is not valid in an identifier
   17 |     {        
      |             ^
zapina.cpp:18:2: error: extended character   is not valid in an identifier
   18 |       if (tab[i][j]==0) break;  
      |  ^
zapina.cpp:18:5: error: extended character   is not valid in an identifier
   18 |       if (tab[i][j]==0) break;  
      |    ^
zapina.cpp:18:8: error: extended character   is not valid in an identifier
   18 |       if (tab[i][j]==0) break;  
      |      ^
zapina.cpp:18:35: error: extended character   is not valid in an identifier
   18 |       if (tab[i][j]==0) break;  
      |                                ^
zapina.cpp:19:2: error: extended character   is not valid in an identifier
   19 |       long long mult=1;  
      |  ^
zapina.cpp:19:5: error: extended character   is not valid in an identifier
   19 |       long long mult=1;  
      |    ^
zapina.cpp:19:8: error: extended character   is not valid in an identifier
   19 |       long long mult=1;  
      |      ^
zapina.cpp:19:28: error: extended character   is not valid in an identifier
   19 |       long long mult=1;  
      |                         ^
zapina.cpp:20:2: error: extended character   is not valid in an identifier
   20 |       for (long long p=0; p<=min(i,N-j); p++)        
      |  ^
zapina.cpp:20:5: error: extended character   is not valid in an identifier
   20 |       for (long long p=0; p<=min(i,N-j); p++)        
      |    ^
zapina.cpp:20:8: error: extended character   is not valid in an identifier
   20 |       for (long long p=0; p<=min(i,N-j); p++)        
      |      ^
zapina.cpp:20:50: error: extended character   is not valid in an identifier
   20 |       for (long long p=0; p<=min(i,N-j); p++)        
      |                                               ^
zapina.cpp:20:53: error: extended character   is not valid in an identifier
   20 |       for (long long p=0; p<=min(i,N-j); p++)        
      |                                                 ^
zapina.cpp:20:56: error: extended character   is not valid in an identifier
   20 |       for (long long p=0; p<=min(i,N-j); p++)        
      |                                                   ^
zapina.cpp:20:59: error: extended character   is not valid in an identifier
   20 |       for (long long p=0; p<=min(i,N-j); p++)        
      |                                                     ^
zapina.cpp: In function 'int main()':
zapina.cpp:12:2: error: '\U000000a0vector' was not declared in this scope
   12 |   vector<vector<long long>> tab (N+1, vector<int> (N+1,0));  
      |  ^~~~~~~
zapina.cpp:12:27: error: expected primary-expression before '>' token
   12 |   vector<vector<long long>> tab (N+1, vector<int> (N+1,0));  
      |                          ^~
zapina.cpp:12:30: error: 'tab' was not declared in this scope; did you mean 'tan'?
   12 |   vector<vector<long long>> tab (N+1, vector<int> (N+1,0));  
      |                             ^~~
      |                             tan
zapina.cpp:12:62: error: '\U000000a0' was not declared in this scope
   12 |   vector<vector<long long>> tab (N+1, vector<int> (N+1,0));  
      |                                                             ^
zapina.cpp:14:9: error: expected primary-expression before 'long'
   14 |   for (long long i=1; i<N; i++)
      |        ^~~~
zapina.cpp:14:24: error: 'i' was not declared in this scope
   14 |   for (long long i=1; i<N; i++)
      |                       ^