Submission #980637

#TimeUsernameProblemLanguageResultExecution timeMemory
980637zh_hHexagonal Territory (APIO21_hexagon)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define lint long long int #define pb push_back using namespace std; const int INF = 1e9; const int MOD = 1E9+7; int draw_territory(int N, int A, int B, int[] D, int[] L){ // vector<vector<int>> v1(1e9, vector<int>(1e9)), v2, v3, v4; // v1.resize(INF, ); // v2.resize(N+1); // v3.resize(N+1); // v4.resize(N+1); int length = L[0]+1; int sum = 0, times = 0; for(int i = 0; i <= length; i ++){ sum += ((i*(i+1))%MOD); sum %= MOD; times += i+1; } sum *= B; sum %= MOD; sum += ((times*A)&MOD); return sum; }

Compilation message (stderr)

hexagon.cpp:9:47: error: expected ',' or '...' before 'D'
    9 | int draw_territory(int N, int A, int B, int[] D, int[] L){
      |                                               ^
hexagon.cpp: In function 'int draw_territory(int, int, int, int*)':
hexagon.cpp:18:18: error: 'L' was not declared in this scope
   18 |     int length = L[0]+1;
      |                  ^