답안 #536501

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
536501 2022-03-13T12:49:33 Z smessaris 육각형 영역 (APIO21_hexagon) C++14
컴파일 오류
0 ms 0 KB
#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

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