답안 #569426

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
569426 2022-05-27T11:41:51 Z Turkhuu 육각형 영역 (APIO21_hexagon) C++17
컴파일 오류
0 ms 0 KB
#include "hexagon.h"
#include <bits/stdc++.h>
const int mod = 1000000007;
int draw_territory(int n, int a, int b, vector<int> d, vector<int> l){
  if(n == 3){
    long long ans = 0;
    for(int i = 1; i <= l[0]; i++){
      ans += i * (i + 1) % mod;
    }
    ans *= b;
    ans += n * a;
    return ans;
  }
  return 0;
}

Compilation message

hexagon.cpp:4:41: error: 'vector' has not been declared
    4 | int draw_territory(int n, int a, int b, vector<int> d, vector<int> l){
      |                                         ^~~~~~
hexagon.cpp:4:47: error: expected ',' or '...' before '<' token
    4 | int draw_territory(int n, int a, int b, vector<int> d, vector<int> l){
      |                                               ^
hexagon.cpp: In function 'int draw_territory(int, int, int, int)':
hexagon.cpp:7:25: error: 'l' was not declared in this scope
    7 |     for(int i = 1; i <= l[0]; i++){
      |                         ^