제출 #536177

#제출 시각아이디문제언어결과실행 시간메모리
536177DJ035Gap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
#include "gap.h" #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #include <bits/stdc++.h> #define MEM 111111 #define sanic ios_base::sync_with_stdio(0) #define x first #define y second #define pf push_front #define pb push_back #define all(v) v.begin(), v.end() #define sz size() using namespace std; typedef long long ll; typedef pair<ll, ll> pi; const ll INF = 1e17+7; const ll MOD = 998244353; ll gcd(ll a, ll b){ if(a%b) return gcd(b, a%b); return b; } ll t,n,m; ll a[MEM]; ll findGap(int T, int N) { if(T==1){ ll l=0, r=1e18, ll=0, rr=N-1; for(int i=0; i<(N+1)/2; i++){ MinMax(l, r, l, r); a[ll] = l; a[rr] = r; l++, r--; ll++, rr--; } ll ans=0; for(int i=0; i<N-1; i++) ans = max(ans, a[i+1]-a[i]); return ans; } }

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

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:31:26: error: invalid conversion from 'll' {aka 'long long int'} to 'long long int*' [-fpermissive]
   31 |             MinMax(l, r, l, r);
      |                          ^
      |                          |
      |                          ll {aka long long int}
In file included from gap.cpp:1:
gap.h:1:35: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
gap.cpp:31:29: error: invalid conversion from 'll' {aka 'long long int'} to 'long long int*' [-fpermissive]
   31 |             MinMax(l, r, l, r);
      |                             ^
      |                             |
      |                             ll {aka long long int}
In file included from gap.cpp:1:
gap.h:1:47: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~
gap.cpp:37:11: error: expected ';' before 'ans'
   37 |         ll ans=0;
      |           ^~~~
      |           ;
gap.cpp:37:9: warning: statement has no effect [-Wunused-value]
   37 |         ll ans=0;
      |         ^~
gap.cpp:39:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |             ans = max(ans, a[i+1]-a[i]);
      |             ^~~
      |             abs
gap.cpp:40:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |         return ans;
      |                ^~~
      |                abs