제출 #975395

#제출 시각아이디문제언어결과실행 시간메모리
975395vjudge1밀림 점프 (APIO21_jumps)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define nl "\n" const int maxn = 2e5+5; int draw_territory(int N, int A, int B, vector<int> D, vector<int> L){ int mod = 1e9+7; int ans; if(N==3){ int length = L[0]; // ans = ((((length*(2*length-1)*(length+1)/6)*B)%mod) + ((length*(length+1))/2 * (A-B))%mod) % mod; ans = (length*(length+1)/2) % mod; } else{ int totalsq = 4000*4000; int dx[6] = {0, 1, 1, 0, -1, -1}; int dy[6] = {2, 1 ,-1, -2, -1, 1}; } return ans; }

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

jumps.cpp: In function 'int draw_territory(int, int, int, std::vector<int>, std::vector<int>)':
jumps.cpp:17:13: warning: unused variable 'totalsq' [-Wunused-variable]
   17 |         int totalsq = 4000*4000;
      |             ^~~~~~~
jumps.cpp:18:13: warning: unused variable 'dx' [-Wunused-variable]
   18 |         int dx[6] = {0, 1, 1, 0, -1, -1};
      |             ^~
jumps.cpp:19:13: warning: unused variable 'dy' [-Wunused-variable]
   19 |         int dy[6] = {2, 1 ,-1, -2, -1, 1};
      |             ^~
jumps.cpp:21:12: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
   21 |     return ans;
      |            ^~~
/usr/bin/ld: /tmp/ccvVlmyF.o: in function `main':
stub.cpp:(.text.startup+0x177): undefined reference to `init(int, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: stub.cpp:(.text.startup+0x1d1): undefined reference to `minimum_jumps(int, int, int, int)'
collect2: error: ld returned 1 exit status