제출 #403030

#제출 시각아이디문제언어결과실행 시간메모리
403030CursedCodeGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> #define pb push_back #define sz(v) ((int)(v).size()) #define all(v) (v).begin(), (v).end() using namespace std; typedef long long lld; long long findGap(int T, long long N){ long long p = 0, q = (lld)1e18 + 1; vector <long long> a; while(true){ long long m1, m2; MinMax(p + 1, q - 1, &m1, &m2); a.pb(m1); a.pb(m2); if (m1 == m2 || a.size() == N) break; p = m1, q = m2; } sort(a.begin(),a.end()); long long ans = 0; for (int i = 1;i < sz(a);i++) ans = max(ans, a[i] - a[i - 1]); return ans; }

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

gap.cpp: In function 'long long int findGap(int, long long int)':
gap.cpp:17:28: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   17 |   if (m1 == m2 || a.size() == N) break;
      |                   ~~~~~~~~~^~~~
/usr/bin/ld: /tmp/ccyggYCE.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status