# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
103248 | vex | 마상시합 토너먼트 (IOI12_tournament) | C++14 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define maxn 100005
using namespace std;
int n;
int l[maxn];
int r[maxn];
int tre=n;
int br[4*maxn];
int lazy[4*maxn];
void build(int v,int l,int r)
{
br[v]=r-l+1;a
lazy[v]=0;
if(l==r)return;
int mid=(l+r)/2;
build(2*v,l,mid);
build(2*v+1,mid+1,r);
}
int get(int v,int l,int r,int pos,int levo)
{
if(lazy[v]!=0)
{
br[v]-=lazy[v];
}
}
void destroy(int v,int l,int r,int lt,int rt)
{
}
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>l[i]>>r[i];
l[i]=get(1,0,n-1,l[i]);
r[i]=get(1,0,n-1,r[i]+1)-1;
tre-=r[i]-l[i]+1;
destroy(1,0,n-1,l[i],r[i]);
cout<<" "<<l[i]<<" "<<r[i]<<endl;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
tournament.cpp: In function 'void build(int, int, int)': tournament.cpp:15:17: error: 'a' was not declared in this scope br[v]=r-l+1;a ^ tournament.cpp: In function 'int get(int, int, int, int, int)': tournament.cpp:31:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ tournament.cpp: In function 'int main()': tournament.cpp:43:30: error: no matching function for call to 'get(int, int, int, int&)' l[i]=get(1,0,n-1,l[i]); ^ tournament.cpp:23:5: note: candidate: int get(int, int, int, int, int) int get(int v,int l,int r,int pos,int levo) ^~~ tournament.cpp:23:5: note: candidate expects 5 arguments, 4 provided In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1361:5: note: candidate: template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const std::tuple<_Elements ...>&) get(const tuple<_Types...>& __t) noexcept ^~~ /usr/include/c++/7/tuple:1361:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'const std::tuple<_Elements ...>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1355:5: note: candidate: template<class _Tp, class ... _Types> constexpr _Tp&& std::get(std::tuple<_Elements ...>&&) get(tuple<_Types...>&& __t) noexcept ^~~ /usr/include/c++/7/tuple:1355:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::tuple<_Elements ...>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1349:5: note: candidate: template<class _Tp, class ... _Types> constexpr _Tp& std::get(std::tuple<_Elements ...>&) get(tuple<_Types...>& __t) noexcept ^~~ /usr/include/c++/7/tuple:1349:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::tuple<_Elements ...>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1326:5: note: candidate: template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(std::tuple<_Elements ...>&&) get(tuple<_Elements...>&& __t) noexcept ^~~ /usr/include/c++/7/tuple:1326:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::tuple<_Elements ...>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1320:5: note: candidate: template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(const std::tuple<_Elements ...>&) get(const tuple<_Elements...>& __t) noexcept ^~~ /usr/include/c++/7/tuple:1320:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'const std::tuple<_Elements ...>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1314:5: note: candidate: template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(std::tuple<_Elements ...>&) get(tuple<_Elements...>& __t) noexcept ^~~ /usr/include/c++/7/tuple:1314:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::tuple<_Elements ...>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/tuple:39:0, from /usr/include/c++/7/functional:54, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/array:324:5: note: candidate: template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const std::array<_Tp, _Nm>&) get(const array<_Tp, _Nm>& __arr) noexcept ^~~ /usr/include/c++/7/array:324:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'const std::array<_Tp, _Nm>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/tuple:39:0, from /usr/include/c++/7/functional:54, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/array:316:5: note: candidate: template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(std::array<_Tp, _Nm>&&) get(array<_Tp, _Nm>&& __arr) noexcept ^~~ /usr/include/c++/7/array:316:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::array<_Tp, _Nm>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/tuple:39:0, from /usr/include/c++/7/functional:54, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/array:307:5: note: candidate: template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(std::array<_Tp, _Nm>&) get(array<_Tp, _Nm>& __arr) noexcept ^~~ /usr/include/c++/7/array:307:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::array<_Tp, _Nm>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:273:5: note: candidate: template<class _Tp, class _Up> constexpr _Tp&& std::get(std::pair<_Up, _Tp>&&) get(pair<_Up, _Tp>&& __p) noexcept ^~~ /usr/include/c++/7/utility:273:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::pair<_Up, _Tp>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:268:5: note: candidate: template<class _Tp, class _Up> constexpr const _Tp& std::get(const std::pair<_Up, _Tp>&) get(const pair<_Up, _Tp>& __p) noexcept ^~~ /usr/include/c++/7/utility:268:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'const std::pair<_Up, _Tp>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:263:5: note: candidate: template<class _Tp, class _Up> constexpr _Tp& std::get(std::pair<_Up, _Tp>&) get(pair<_Up, _Tp>& __p) noexcept ^~~ /usr/include/c++/7/utility:263:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::pair<_Up, _Tp>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:258:5: note: candidate: template<class _Tp, class _Up> constexpr _Tp&& std::get(std::pair<_T1, _T2>&&) get(pair<_Tp, _Up>&& __p) noexcept ^~~ /usr/include/c++/7/utility:258:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::pair<_T1, _T2>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:253:5: note: candidate: template<class _Tp, class _Up> constexpr const _Tp& std::get(const std::pair<_T1, _T2>&) get(const pair<_Tp, _Up>& __p) noexcept ^~~ /usr/include/c++/7/utility:253:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:248:5: note: candidate: template<class _Tp, class _Up> constexpr _Tp& std::get(std::pair<_T1, _T2>&) get(pair<_Tp, _Up>& __p) noexcept ^~~ /usr/include/c++/7/utility:248:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::pair<_T1, _T2>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:239:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const std::pair<_Tp1, _Tp2>&) get(const std::pair<_Tp1, _Tp2>& __in) noexcept ^~~ /usr/include/c++/7/utility:239:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'const std::pair<_Tp1, _Tp2>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:234:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(std::pair<_Tp1, _Tp2>&&) get(std::pair<_Tp1, _Tp2>&& __in) noexcept ^~~ /usr/include/c++/7/utility:234:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::pair<_Tp1, _Tp2>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ In file included from /usr/include/c++/7/algorithm:60:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65, from tournament.cpp:1: /usr/include/c++/7/utility:229:5: note: candidate: template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(std::pair<_Tp1, _Tp2>&) get(std::pair<_Tp1, _Tp2>& __in) noexcept ^~~ /usr/include/c++/7/utility:229:5: note: template argument deduction/substitution failed: tournament.cpp:43:30: note: mismatched types 'std::pair<_Tp1, _Tp2>' and 'int' l[i]=get(1,0,n-1,l[i]); ^ tournament.cpp:44:32: error: no matching function for call to 'get(int, int, int, int)' r[i]=get(1,0,n-1,r[i]+1)-1; ^ tournament.cpp:23:5: note: candidate: int get(int, int, int, int, int) int get(int v,int l,int r,int pos,int levo) ^~~ tournament.cpp:23:5: note: candidate expects 5 arguments, 4 provided In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1361:5: note: candidate: template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const std::tuple<_Elements ...>&) get(const tuple<_Types...>& __t) noexcept ^~~ /usr/include/c++/7/tuple:1361:5: note: template argument deduction/substitution failed: tournament.cpp:44:32: note: mismatched types 'const std::tuple<_Elements ...>' and 'int' r[i]=get(1,0,n-1,r[i]+1)-1; ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1355:5: note: candidate: template<class _Tp, class ... _Types> constexpr _Tp&& std::get(std::tuple<_Elements ...>&&) get(tuple<_Types...>&& __t) noexcept ^~~ /usr/include/c++/7/tuple:1355:5: note: template argument deduction/substitution failed: tournament.cpp:44:32: note: mismatched types 'std::tuple<_Elements ...>' and 'int' r[i]=get(1,0,n-1,r[i]+1)-1; ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1349:5: note: candidate: template<class _Tp, class ... _Types> constexpr _Tp& std::get(std::tuple<_Elements ...>&) get(tuple<_Types...>& __t) noexcept ^~~ /usr/include/c++/7/tuple:1349:5: note: template argument deduction/substitution failed: tournament.cpp:44:32: note: mismatched types 'std::tuple<_Elements ...>' and 'int' r[i]=get(1,0,n-1,r[i]+1)-1; ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1326:5: note: candidate: template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(std::tuple<_Elements ...>&&) get(tuple<_Elements...>&& __t) noexcept ^~~ /usr/include/c++/7/tuple:1326:5: note: template argument deduction/substitution failed: tournament.cpp:44:32: note: mismatched types 'std::tuple<_Elements ...>' and 'int' r[i]=get(1,0,n-1,r[i]+1)-1; ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1320:5: note: candidate: template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(const std::tuple<_Elements ...>&) get(const tuple<_Elements...>& __t) noexcept ^~~ /usr/include/c++/7/tuple:1320:5: note: template argument deduction/substitution failed: tournament.cpp:44:32: note: mismatched types 'const std::tuple<_Elements ...>' and 'int' r[i]=get(1,0,n-1,r[i]+1)-1; ^ In file included from /usr/include/c++/7/functional:54:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/tuple:1314:5: note: candidate: template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(std::tuple<_Elements ...>&) get(tuple<_Elements...>& __t) noexcept ^~~ /usr/include/c++/7/tuple:1314:5: note: template argument deduction/substitution failed: tournament.cpp:44:32: note: mismatched types 'std::tuple<_Elements ...>' and 'int' r[i]=get(1,0,n-1,r[i]+1)-1; ^ In file included from /usr/include/c++/7/tuple:39:0, from /usr/include/c++/7/functional:54, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/array:324:5: note: candidate: template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const std::array<_Tp, _Nm>&) get(const array<_Tp, _Nm>& __arr) noexcept ^~~ /usr/include/c++/7/array:324:5: note: template argument deduction/substitution failed: tournament.cpp:44:32: note: mismatched types 'const std::array<_Tp, _Nm>' and 'int' r[i]=get(1,0,n-1,r[i]+1)-1; ^ In file included from /usr/include/c++/7/tuple:39:0, from /usr/include/c++/7/functional:54, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/array:316:5: note: candidate: template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(std::array<_Tp, _Nm>&&) get(array<_Tp, _Nm>&& __arr) noexcept ^~~ /usr/include/c++/7/array:316:5: note: template argument deduction/substitution failed: tournament.cpp:44:32: note: mismatched types 'std::array<_Tp, _Nm>' and 'int' r[i]=get(1,0,n-1,r[i]+1)-1; ^ In file included from /usr/include/c++/7/tuple:39:0, from /usr/include/c++/7/functional:54, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71, from tournament.cpp:1: /usr/include/c++/7/array:307:5: note: candidate: template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(std::array<_Tp, _Nm>&) get(array<_Tp, _Nm>& __arr) noexcept ^~~ /usr/include/c++/7/array:307:5: note: template argument