Submission #536501

#TimeUsernameProblemLanguageResultExecution timeMemory
536501smessarisHexagonal Territory (APIO21_hexagon)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "hexagon.h" #define pb push_back #define ios ios::sync_with_stdio(0);cin.tie(0); using namespace std; using ll = long long; const int mod = 1e9 + 7; const int MAX = 2e5 + 5; int draw_territory(int N, int A, int B,vector<int> D, vector<int> L){ ll ans = ((((L[0] + 1) * 1LL * (L[0] + 2)) / 2) % MOD); ans *= A; ans %= MOD; for(int i=0,i<(L[0] + 1);i++){ ans += (((i * (i + 1)) % INF) * B) % MOD; ans %= MOD; } sort(all(L)); assert(L[0] == L.back()); return ans; }

Compilation message (stderr)

hexagon.cpp: In function 'int draw_territory(int, int, int, std::vector<int>, std::vector<int>)':
hexagon.cpp:13:55: error: 'MOD' was not declared in this scope
   13 |     ll ans = ((((L[0] + 1) * 1LL * (L[0] + 2)) / 2) % MOD);
      |                                                       ^~~
hexagon.cpp:16:18: error: expected ';' before '<' token
   16 |     for(int i=0,i<(L[0] + 1);i++){
      |                  ^
      |                  ;
hexagon.cpp:16:18: error: expected primary-expression before '<' token
hexagon.cpp:17:34: error: 'INF' was not declared in this scope
   17 |         ans += (((i * (i + 1)) % INF) * B) % MOD;
      |                                  ^~~
hexagon.cpp:20:10: error: 'all' was not declared in this scope; did you mean 'll'?
   20 |     sort(all(L));
      |          ^~~
      |          ll