제출 #553170

#제출 시각아이디문제언어결과실행 시간메모리
553170fcmalkcinGap (APIO16_gap)C++17
컴파일 에러
0 ms0 KiB
#include "gap.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define ff first #define ss second //#define endl "\n" #define pb push_back #define F(i,a,b) for(ll i=a;i<=b;i++) const ll maxn=1e3+5e2+100; const ll base=2e9; const ll mod= 1e9+7 ; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); ll findGap(int t,int n) { if (t==1) { ll l=-1,h=1e18+1; vector<ll> vt; vector<ll> vt1; ll mn,mx; ll res=0; for (int i=1; i<=(n+1)/2; i++) { MinMax(l+1,h-1,*mn,*mx); vt.pb(mn); vt1.pb(mx); l=mn; h=mx; } reverse(vt1.begin(),vt1.end()); for (auto to:vt1) vt.pb(to); for (int i=1; i<vt.size(); i++) res=max(res,vt[i]-vt[i-1]); return res; } else { ll mn,mx; MinMax(0,1e18,*mn,*mx); ll len=mx-mn; ll pt=mx; ll h=(len+n-1)/(n); h--; ll l=mn; ll pre=base; ll res=0; while (1) { MinMax(l,l+h,*mn,*mx); l+=(h+1); if (mn!=-1) { res=max(res,mn-pre); pre=mx; if (mx==pt) return ; } else { } } return res; } } /*int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if (fopen("t.inp","r")) { freopen("test.inp","r",stdin); freopen("test.out","w",stdout); } ll n; cin>>n; initialize(n); for (int i=1;i<=n;i++) { } }*/

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:32:28: error: invalid type argument of unary '*' (have 'long long int')
   32 |             MinMax(l+1,h-1,*mn,*mx);
      |                            ^~~
gap.cpp:32:32: error: invalid type argument of unary '*' (have 'long long int')
   32 |             MinMax(l+1,h-1,*mn,*mx);
      |                                ^~~
gap.cpp:41:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |         for (int i=1; i<vt.size(); i++)
      |                       ~^~~~~~~~~~
gap.cpp:48:23: error: invalid type argument of unary '*' (have 'long long int')
   48 |         MinMax(0,1e18,*mn,*mx);
      |                       ^~~
gap.cpp:48:27: error: invalid type argument of unary '*' (have 'long long int')
   48 |         MinMax(0,1e18,*mn,*mx);
      |                           ^~~
gap.cpp:58:26: error: invalid type argument of unary '*' (have 'long long int')
   58 |             MinMax(l,l+h,*mn,*mx);
      |                          ^~~
gap.cpp:58:30: error: invalid type argument of unary '*' (have 'long long int')
   58 |             MinMax(l,l+h,*mn,*mx);
      |                              ^~~
gap.cpp:65:21: error: return-statement with no value, in function returning 'long long int' [-fpermissive]
   65 |                     return ;
      |                     ^~~~~~