제출 #553169

#제출 시각아이디문제언어결과실행 시간메모리
553169fcmalkcinGap (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 conversion from 'long long int' to 'long long int*' [-fpermissive]
   32 |             MinMax(l+1,h-1,mn,mx);
      |                            ^~
      |                            |
      |                            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:32:31: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   32 |             MinMax(l+1,h-1,mn,mx);
      |                               ^~
      |                               |
      |                               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: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 conversion from 'long long int' to 'long long int*' [-fpermissive]
   48 |         MinMax(0,1e18,mn,mx);
      |                       ^~
      |                       |
      |                       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:48:26: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   48 |         MinMax(0,1e18,mn,mx);
      |                          ^~
      |                          |
      |                          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:58:26: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   58 |             MinMax(l,l+h,mn,mx);
      |                          ^~
      |                          |
      |                          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:58:29: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   58 |             MinMax(l,l+h,mn,mx);
      |                             ^~
      |                             |
      |                             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:65:21: error: return-statement with no value, in function returning 'long long int' [-fpermissive]
   65 |                     return ;
      |                     ^~~~~~