제출 #560947

#제출 시각아이디문제언어결과실행 시간메모리
560947HuyGap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define int long long #define pii pair<int,int> #define fi first #define se second #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") using namespace std; using ll = long long; using ull = unsigned long long; using ldb = long double; const int N = (int)5e5; const int maxN = (int)5e5 + 5; const int mod = 1e9 + 7; //const int mod = 998244353; const ll infty = 1e18; const ll logn = 18; const int base = 311; const int Block_size = 500; const int ep = 'a'; int cu[] = {0,0,1,-1}; int cv[] = {-1,1,0,0}; int du[] = {-1,-1,+1,1}; int dv[] = {-1,+1,-1,1}; int cled[] = {6,2,5,5,4,5,6,3,7,6}; void InputFile() { freopen(".inp","r",stdin); freopen(".out","w",stdout); //freopen("test.out","r",stdin); } void FastInput() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int findGap(int T,int N) { int res = 0; int mini,maxi; MinMax(0,infty,&mini,&maxi); int prev = mini; int now = mini + 1; int h = (maxi - mini + (n - 2)) / (n - 1); int prev = mini; int now = mini + 1; while(prev != maxi) { int x,y; MinMax(now,now + h - 1,&x,&y); res = max(res,x - prev); pre = max(pre,y); now += h; } return res; } void Read() { } void Solve() { } void Debug() { //Main_sub(); //Naive(); } int main() { FastInput(); //InputFile(); //int sub_type; //cin >> sub_type; //Sieve(); int test; //cin >> test; test = 1; while(test--) //for(int prc = 1; prc <= test; prc++) { Read(); Solve(); //Debug(); } }

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

gap.cpp:7: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    7 | #pragma GCC optimization ("O3")
      | 
gap.cpp:8: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    8 | #pragma GCC optimization ("unroll-loops")
      | 
gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:50:5: error: 'MinMax' was not declared in this scope
   50 |     MinMax(0,infty,&mini,&maxi);
      |     ^~~~~~
gap.cpp:53:29: error: 'n' was not declared in this scope
   53 |     int h = (maxi - mini + (n - 2)) / (n - 1);
      |                             ^
gap.cpp:54:9: error: redeclaration of 'long long int prev'
   54 |     int prev = mini;
      |         ^~~~
gap.cpp:51:9: note: 'long long int prev' previously declared here
   51 |     int prev = mini;
      |         ^~~~
gap.cpp:55:9: error: redeclaration of 'long long int now'
   55 |     int now = mini + 1;
      |         ^~~
gap.cpp:52:9: note: 'long long int now' previously declared here
   52 |     int now = mini + 1;
      |         ^~~
gap.cpp:61:9: error: 'pre' was not declared in this scope; did you mean 'prev'?
   61 |         pre = max(pre,y);
      |         ^~~
      |         prev
At global scope:
cc1plus: error: '::main' must return 'int'
gap.cpp: In function 'void InputFile()':
gap.cpp:35:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |     freopen(".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~
gap.cpp:36:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |     freopen(".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~