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_39319308_14063.cpp:2:3: error: stray '#' in program
    2 | 1 #include<iostream> 2 using namespace std;3 int main()4{5 int n,t;6 cin>>t;7 while (t--)8 {9 int n;10 cin>>n;11 if(n<=3)12 {13 if(n==1) cout<<"1"<<endl;14 if(n==2) cout<<"1 "<<"2"<<endl;15 if(n==3)16 cout<<"1 "<<"2 "<<"3"<<endl;17 }18 else 19 {20 int a[5000];21 for (int k=0;k<=n;k++)22 a[k]=1;23 int b=2,l=n,j=0;24 for (int i=1;i<=n;i++)25 {26 27 if (a[i])28 {29 j++;30 if (j==b)31 {32 a[i]=0;33 j=0;34 35 }36 }38 if (i==n)39 {40 l-=(l/b);41 if (l<=3) break;42 43 if (b==2) b=3;44 else b=2;45 i=0;46 j=0;47 48 }49 50 }51 int w=0;52 for (int h=1;h<=n;h++)53 if (a[h])54 {w++;55 56 cout<<h;57 if(w<l)cout<<" ";58 else cout<<endl;59 }60 }61 }62 return 0;63}
      |   ^
0_0_39319308_14063.cpp:2:1: error: expected unqualified-id before numeric constant
    2 | 1 #include<iostream> 2 using namespace std;3 int main()4{5 int n,t;6 cin>>t;7 while (t--)8 {9 int n;10 cin>>n;11 if(n<=3)12 {13 if(n==1) cout<<"1"<<endl;14 if(n==2) cout<<"1 "<<"2"<<endl;15 if(n==3)16 cout<<"1 "<<"2 "<<"3"<<endl;17 }18 else 19 {20 int a[5000];21 for (int k=0;k<=n;k++)22 a[k]=1;23 int b=2,l=n,j=0;24 for (int i=1;i<=n;i++)25 {26 27 if (a[i])28 {29 j++;30 if (j==b)31 {32 a[i]=0;33 j=0;34 35 }36 }38 if (i==n)39 {40 l-=(l/b);41 if (l<=3) break;42 43 if (b==2) b=3;44 else b=2;45 i=0;46 j=0;47 48 }49 50 }51 int w=0;52 for (int h=1;h<=n;h++)53 if (a[h])54 {w++;55 56 cout<<h;57 if(w<l)cout<<" ";58 else cout<<endl;59 }60 }61 }62 return 0;63}
      | ^
0_0_39319308_14063.cpp:2:44: error: expected unqualified-id before numeric constant
    2 | 1 #include<iostream> 2 using namespace std;3 int main()4{5 int n,t;6 cin>>t;7 while (t--)8 {9 int n;10 cin>>n;11 if(n<=3)12 {13 if(n==1) cout<<"1"<<endl;14 if(n==2) cout<<"1 "<<"2"<<endl;15 if(n==3)16 cout<<"1 "<<"2 "<<"3"<<endl;17 }18 else 19 {20 int a[5000];21 for (int k=0;k<=n;k++)22 a[k]=1;23 int b=2,l=n,j=0;24 for (int i=1;i<=n;i++)25 {26 27 if (a[i])28 {29 j++;30 if (j==b)31 {32 a[i]=0;33 j=0;34 35 }36 }38 if (i==n)39 {40 l-=(l/b);41 if (l<=3) break;42 43 if (b==2) b=3;44 else b=2;45 i=0;46 j=0;47 48 }49 50 }51 int w=0;52 for (int h=1;h<=n;h++)53 if (a[h])54 {w++;55 56 cout<<h;57 if(w<l)cout<<" ";58 else cout<<endl;59 }60 }61 }62 return 0;63}
      |                                            ^


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 08:24:02, Gzip enabled