제출 #344170

#제출 시각아이디문제언어결과실행 시간메모리
344170juggernautGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include"gap.h"
#ifdef EVAL
#else
#include"grader.cpp"
#endif
using namespace std;
typedef long long ll;
ll ans,mn,mx,n,l=-1,r=1e19+1;
vector<ll>x,y;
ll findGap(int t, int N){
	n=N;
	if(t==1){
		while(x.size()+y.size()<n){
			l++,r--;
			MinMax(l,r,&l,&r);
			x.push_back(l);
			y.push_back(r);
		}
	}else{
		MinMax(l,r,&l,&r);
		x.push_back(l),y.push_back(r);
		ll s=r-l+1LL;
		s/=n;
		s++;
		for(ll i=l;i+1<r;i+=s){
			ll nx=min(r-1,i+s);
			MinMax(i+1,nx,&mn,&mx);
			if(mn!=-1)x.push_back(mn);
			if(mx!=-1)x.push_back(mx);
		}

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

gap.cpp:9:27: warning: overflow in conversion from 'double' to 'll' {aka 'long long int'} changes value from '1.0e+19' to '9223372036854775807' [-Woverflow]
    9 | ll ans,mn,mx,n,l=-1,r=1e19+1;
      |                       ~~~~^~
gap.cpp: In function 'll findGap(int, int)':
gap.cpp:14:26: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'll' {aka 'long long int'} [-Wsign-compare]
   14 |   while(x.size()+y.size()<n){
      |         ~~~~~~~~~~~~~~~~~^~
gap.cpp:31:3: error: expected '}' at end of input
   31 |   }
      |   ^
gap.cpp:20:7: note: to match this '{'
   20 |  }else{
      |       ^
gap.cpp:31:3: error: expected '}' at end of input
   31 |   }
      |   ^
gap.cpp:11:25: note: to match this '{'
   11 | ll findGap(int t, int N){
      |                         ^
gap.cpp:31:3: warning: no return statement in function returning non-void [-Wreturn-type]
   31 |   }
      |   ^