제출 #633916

#제출 시각아이디문제언어결과실행 시간메모리
633916fadi57Gap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "gap.h" using namespace std; typedef long long ll; const ll inf =1e18; const ll mod=998244353; ll findGap(int T, int N){ ll mn=0; ll mx=1e18; MinMax( 0, mx, &mn, &mx); ll st=mn;ll en=mx; ll len=(mx-(mn+1))/(N-1); itn last=mn; vector<ll>v; v.push_back(mn); for(ll i=mn+1;<mx;i+=len){ MinMax( i, i+len-1, &mn, &mx); if(mn!=-1){ v.push_back(mn); v.push_back(mx); } } v.push_back(en); ll ans=len; for(int i=1;i<v.size();i++){ ans=max(ans,v[i].first-v[i-1].second); } return ans; } int main() { }

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

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:13:1: error: 'itn' was not declared in this scope; did you mean 'int'?
   13 | itn last=mn;
      | ^~~
      | int
gap.cpp:16:15: error: expected primary-expression before '<' token
   16 | for(ll i=mn+1;<mx;i+=len){
      |               ^
gap.cpp:27:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 | for(int i=1;i<v.size();i++){
      |             ~^~~~~~~~~
gap.cpp:28:22: error: request for member 'first' in 'v.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   28 |     ans=max(ans,v[i].first-v[i-1].second);
      |                      ^~~~~
gap.cpp:28:35: error: request for member 'second' in 'v.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)(i - 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   28 |     ans=max(ans,v[i].first-v[i-1].second);
      |                                   ^~~~~~
gap.cpp:11:4: warning: unused variable 'st' [-Wunused-variable]
   11 | ll st=mn;ll en=mx;
      |    ^~