0_0_39304388_32091.cpp:3:21: error: declaration does not declare anything [-fpermissive]
3 | using namespace std;list<int>;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 c=1;for(it=a.begin();it!=a.end();){if(c++%k==0) it=a.erase(it);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;}
| ^~~~~~~~~
0_0_39304388_32091.cpp: In function 'int main()':
0_0_39304388_32091.cpp:3:98: error: 'a' was not declared in this scope
3 | using namespace std;list<int>;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 c=1;for(it=a.begin();it!=a.end();){if(c++%k==0) it=a.erase(it);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;}
| ^
|