Submission #980552

# Submission time Handle Problem Language Result Execution time Memory
980552 2024-05-12T08:39:39 Z vjudge1 Hexagonal Territory (APIO21_hexagon) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define nl "\n"

const int maxn = 2e5+5;

int draw_territory(int N, int A, int B, vector<int> D, vector<int> L){
    int mod = 1e9+7;
    long long a;
    if(N==3){
        long long length = L[0];
        a = ((length * (length+1)/2);
    }
    else{
        int totalsq = 4000*4000;
        int dx[6] = {0, 1, 1, 0, -1, -1};
        int dy[6] = {2, 1 ,-1, -2, -1, 1};
    }
    int ans = a%mod;
    return ans;
}

Compilation message

hexagon.cpp: In function 'int draw_territory(int, int, int, std::vector<int>, std::vector<int>)':
hexagon.cpp:13:37: error: expected ')' before ';' token
   13 |         a = ((length * (length+1)/2);
      |             ~                       ^
      |                                     )
hexagon.cpp:16:13: warning: unused variable 'totalsq' [-Wunused-variable]
   16 |         int totalsq = 4000*4000;
      |             ^~~~~~~
hexagon.cpp:17:13: warning: unused variable 'dx' [-Wunused-variable]
   17 |         int dx[6] = {0, 1, 1, 0, -1, -1};
      |             ^~
hexagon.cpp:18:13: warning: unused variable 'dy' [-Wunused-variable]
   18 |         int dy[6] = {2, 1 ,-1, -2, -1, 1};
      |             ^~