제출 #1187865

#제출 시각아이디문제언어결과실행 시간메모리
1187865MalixGap (APIO16_gap)C++20
30 / 100
43 ms2340 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vii; typedef pair<int,int> pi; typedef vector<pi> pii; typedef tuple<ll,ll,ll> ti; typedef vector<ll> li; typedef vector<li> lii; #define REP(i,a,b) for(int i=a;i<b;i++) #define F first #define S second #define PB push_back #define LSOne(s) ((s)&(-s)) ll INF=1000000000000000010; int inf=1e9+10; ll M=1e9+7; long long findGap(int T, int n) { if(T==1){ vector<ll> a; ll l=0,r=1e18; ll mx,mn; while(a.size()!=n){ MinMax(l,r,&mn,&mx); a.PB(mn); if(mn!=mx)a.PB(mx); l=mn+1; r=mx-1; } sort(a.begin(),a.end()); ll ans=0; REP(i,0,n-1)ans=max(ans,a[i+1]-a[i]); return ans; } else{ } }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:45:1: warning: control reaches end of non-void function [-Wreturn-type]
   45 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...