제출 #97727

#제출 시각아이디문제언어결과실행 시간메모리
97727dalgerokGap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "gap.h> using namespace std; long long a[400005]; long long findGap(int T, int N){ long long mn, mx, l = 0, r = 1e18, ans = 0; int sz = 0; if(T == 1){ int tl = 1, tr = N; while(tl <= tr){ MinMax(l, r, &mn, &mx); a[tl++] = mn; a[tr--] = mx; l = mn + 1; r = mx - 1; } sz = N; } else{ MinMax(l, r, &mn, &mx); long long shift = (mx + mn + N - 1) / N, xx, yy; a[++sz] = mn; l = mn + 1; r = l + shift; while(l < mx){ MinMax(l, min(r, mx - 1), &xx, &yy); if(xx != -1){ a[++sz] = xx; a[++sz] = yy; } l = r + 1; r = l + shift; } a[++sz] = mx; } for(int i = 2; i <= sz; i++){ ans = max(ans, a[i] - a[i - 1]); } return ans; }

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

gap.cpp:2:10: warning: missing terminating " character
 #include "gap.h>
          ^
gap.cpp:2:10: error: #include expects "FILENAME" or <FILENAME>
 #include "gap.h>
          ^~~~~~~
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:14:13: error: 'MinMax' was not declared in this scope
             MinMax(l, r, &mn, &mx);
             ^~~~~~
gap.cpp:14:13: note: suggested alternative: 'rindex'
             MinMax(l, r, &mn, &mx);
             ^~~~~~
             rindex
gap.cpp:23:9: error: 'MinMax' was not declared in this scope
         MinMax(l, r, &mn, &mx);
         ^~~~~~
gap.cpp:23:9: note: suggested alternative: 'rindex'
         MinMax(l, r, &mn, &mx);
         ^~~~~~
         rindex