답안 #979872

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
979872 2024-05-11T14:24:40 Z vjudge1 육각형 영역 (APIO21_hexagon) C++17
컴파일 오류
0 ms 0 KB
#include "hexagon.h"

#include <cassert>
#include <cstdio>

#include <vector>

//#include "hexagon.h"
#include <bits/stdc++.h>
#include <vector>
#define debu(x) (cerr << #x  << " = "<< x << "\n")
using namespace std;


int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L)
{
  #define int long long
  int leng = L[0] + 1;
  int ans = leng * (leng + 1) * (2 * leng + 1)/6;
  ans -= leng*(leng + 1)/2;
  ans *= B;
  //debu(ans);
  ans += A * (leng * (leng + 1))/2;
  //debu(ans);
  #undef int 
  return ans;
}


int main() {
  int N, A, B;
  assert(3 == scanf("%d %d %d", &N, &A, &B));
  std::vector<int> D(N), L(N);
  for (int i = 0; i < N; ++i) {
    assert(2 == scanf("%d %d", &D[i], &L[i]));
  }

  int result = draw_territory(N, A, B, D, L);
  printf("%d\n", result);
  return 0;
}

Compilation message

/usr/bin/ld: /tmp/ccno9p0Y.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccNV3DLY.o:hexagon.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status