제출 #560713

#제출 시각아이디문제언어결과실행 시간메모리
560713Tien_NoobGap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
//Make CSP great again //Vengeance #include <bits/stdc++.h> #define TASK "TESTCODE" #define Log2(x) 31 - __builtin_clz(x) using namespace std; long long findGap(int t, int n) { long long res = 0; long long mn, mx; MinMax(0, 1e18, mn, mx); long long maxPre = -1; for (long long l = mn; l <= mx; l += (mx - mn + 1)/n) { MinMax(l, l + (mx - mn + 1)/n - 1, mn, mx); if (mn == -1) { continue; } if (maxPre != -1) { res = max(res, mn - maxPre); } maxPre = mx; } return res; } void read() { } void solve() { } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); if (fopen(TASK".INP", "r")) { freopen(TASK".INP", "r", stdin); //freopen(TASK".OUT", "w", stdout); } int t = 1; bool typetest = false; if (typetest) { cin >> t; } for (int __ = 1; __ <= t; ++ __) { //cout << "Case " << __ << ": "; read(); solve(); } }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:11:5: error: 'MinMax' was not declared in this scope
   11 |     MinMax(0, 1e18, mn, mx);
      |     ^~~~~~
gap.cpp: In function 'int main()':
gap.cpp:42:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   42 |         freopen(TASK".INP", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~