Submission #569435

# Submission time Handle Problem Language Result Execution time Memory
569435 2022-05-27T11:47:29 Z Turkhuu Hexagonal Territory (APIO21_hexagon) C++17
Compilation error
0 ms 0 KB
#include "hexagon.h"
#include <bits/stdc++.h>
int draw_territory(int n, int a, int b, std::vector<int> d, std::yvector<int> l){
  if(n == 3){
    long long ans = 0;
    for(int i = 1; i <= l[0]; i++){
      ans += i * (i + 1);
    }
    ans *= b;
    ans += (l[0] + 1) * (l[0] + 2) * a;
    return ans;
  }
  return 0;
}

Compilation message

hexagon.cpp:3:61: error: 'std::yvector' has not been declared
    3 | int draw_territory(int n, int a, int b, std::vector<int> d, std::yvector<int> l){
      |                                                             ^~~
hexagon.cpp:3:73: error: expected ',' or '...' before '<' token
    3 | int draw_territory(int n, int a, int b, std::vector<int> d, std::yvector<int> l){
      |                                                                         ^
hexagon.cpp: In function 'int draw_territory(int, int, int, std::vector<int>, int)':
hexagon.cpp:6:25: error: 'l' was not declared in this scope
    6 |     for(int i = 1; i <= l[0]; i++){
      |                         ^
hexagon.cpp:10:13: error: 'l' was not declared in this scope
   10 |     ans += (l[0] + 1) * (l[0] + 2) * a;
      |             ^