F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39304423_7603.cpp:8:7: error: expected nested-name-specifier before 'namespacestd'
    8 | using namespacestd;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(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_39304423_7603.cpp:8:20: error: 'list' does not name a type
    8 | using namespacestd;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(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_39304423_7603.cpp:8:31: error: 'list' does not name a type
    8 | using namespacestd;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(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_39304423_7603.cpp: In function 'int main()':
0_0_39304423_7603.cpp:8:73: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 | using namespacestd;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(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;}
      |                                                                         ^~~
      |                                                                         std::cin
In file included from 0_0_39304423_7603.cpp:2:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
0_0_39304423_7603.cpp:8:98: error: 'a' was not declared in this scope
    8 | using namespacestd;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(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_39304423_7603.cpp:8:186: error: 'it' was not declared in this scope; did you mean 't'?
    8 | using namespacestd;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(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;}
      |                                                                                                                                                                                          ^~
      |                                                                                                                                                                                          t
0_0_39304423_7603.cpp:8:274: error: 'it' was not declared in this scope; did you mean 't'?
    8 | using namespacestd;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(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;}
      |                                                                                                                                                                                                                                                                                  ^~
      |                                                                                                                                                                                                                                                                                  t
0_0_39304423_7603.cpp:8:332: error: expected ')' before ';' token
    8 | using namespacestd;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(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;}
      |                                                                                                                                                                                                                                                                                                                                        ~   ^
      |                                                                                                                                                                                                                                                                                                                                            )


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-27 10:41:46, Gzip enabled