제출 #916677

#제출 시각아이디문제언어결과실행 시간메모리
916677green_gold_dog육각형 영역 (APIO21_hexagon)C++17
컴파일 에러
0 ms0 KiB
//#pragma GCC optimize("Ofast") //#pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,sse4,abm,popcnt,mmx") #include <bits/stdc++.h> #include"hexagon.h" using namespace std; typedef int ll; typedef double db; typedef long double ldb; typedef complex<double> cd; constexpr ll INF64 = 9'000'000'000'000'000'000, INF32 = 2'000'000'000, MOD = 1'000'000'007; constexpr db PI = acos(-1); constexpr bool IS_FILE = false, IS_TEST_CASES = false; random_device rd; mt19937 rnd32(rd()); mt19937_64 rnd64(rd()); template<typename T> bool assign_max(T& a, T b) { if (b > a) { a = b; return true; } return false; } template<typename T> bool assign_min(T& a, T b) { if (b < a) { a = b; return true; } return false; } template<typename T> T square(T a) { return a * a; } template<> struct std::hash<pair<ll, ll>> { ll operator() (pair<ll, ll> p) const { return ((__int128)p.first * MOD + p.second) % INF64; } }; ll draw_territory(ll n, ll a, ll b, vector<ll>& d, vector<ll>& l) { ll x = l[0]; ll sum = (long long)l[0] * (l[0] + 1) / 2 % MOD; return sum * a % MOD; }

컴파일 시 표준 에러 (stderr) 메시지

hexagon.cpp:13:22: warning: overflow in conversion from 'long int' to 'll' {aka 'int'} changes value from '9000000000000000000' to '-494665728' [-Woverflow]
   13 | constexpr ll INF64 = 9'000'000'000'000'000'000, INF32 = 2'000'000'000, MOD = 1'000'000'007;
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~
hexagon.cpp: In function 'll draw_territory(ll, ll, ll, std::vector<int>&, std::vector<int>&)':
hexagon.cpp:52:12: warning: unused variable 'x' [-Wunused-variable]
   52 |         ll x = l[0];
      |            ^
/usr/bin/ld: /tmp/ccaqMI5g.o: in function `main':
grader.cpp:(.text.startup+0x228): undefined reference to `draw_territory(int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status