0_0_39304396_7800.cpp: In function 'int main()':
0_0_39304396_7800.cpp:3:240: error: no matching function for call to 'std::__cxx11::list<int>::erase()'
3 | using namespace std;list<int>a;list<int>::iterator it;int main(){int T,n;cin>>T;while(T--){cin>>n;a.clear();int k=2;for(int i=1;i<=n;i++){a.push_back(i);}while(a.size()>3){int cnt=1;for(it=a.begin();it !=a.end();){if(cnt++%k==0){it=a.erase();}else{it++;}}k=(k==2 ? 3 : 2);}for(it=a.begin();it !=a.end();it++){if(it !=a.begin()){printf(" ");}printf("%d",*it);}printf("\n");}return 0;}
| ~~~~~~~^~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/list:66,
from .\stdc++.h:150:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/list.tcc:150:5: note: candidate: 'std::__cxx11::list<_Tp, _Alloc>::iterator std::__cxx11::list<_Tp, _Alloc>::erase(const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::__cxx11::list<int>::iterator; const_iterator = std::__cxx11::list<int>::const_iterator]'
150 | list<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/list.tcc:150:5: note: candidate expects 1 argument, 0 provided
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/list:65:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_list.h:1550:7: note: candidate: 'std::__cxx11::list<_Tp, _Alloc>::iterator std::__cxx11::list<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::__cxx11::list<int>::iterator; const_iterator = std::__cxx11::list<int>::const_iterator]'
1550 | erase(const_iterator __first, const_iterator __last) noexcept
| ^~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_list.h:1550:7: note: candidate expects 2 arguments, 0 provided
|