제출 #106023

#제출 시각아이디문제언어결과실행 시간메모리
106023OpenTheWindowGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include<iostream> #include<string> #include<set> #include<utility> #include<vector> #include<map> #include<algorithm> #include<queue> #include<stack> #include"gap.h" using namespace std; long long findGap(){ vector<int> a; long long s = 0, t = 1000000000000000000; while (true) { long long mn, mx; if(s > t) break; MinMax(s, t, &mn, &mx); if(mn == -1) break; if(mn < mx){ a.push_back(mn); a.push_back(mx); s = mn + 1; t = mx - 1; } if(mn == mx){ a.push_back(mn); break; } } sort(a.begin(), a.end()); int ans = 0; for(int i=0; i<a.size()-1; i++){ ans = max(ans, a[i+1] - a[i]); } cout << ans << endl; return 0; }

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

gap.cpp: In function 'long long int findGap()':
gap.cpp:47:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<a.size()-1; i++){
               ~^~~~~~~~~~~
/tmp/ccNwAbsi.o: In function `main':
grader.cpp:(.text.startup+0x18e): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status