Main.cpp:2:47: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | using namespace std;int n,i,x;map<int,int>p,a;main(){cin>>n;while(i<n)cin>>a[i],p[a[i++]]=i;i=0;while(i<n,x=a[i])while(i<n&&p[x]>=i)cout<<x<<"\n",i++;}
| ^~~~
Main.cpp: In function 'int main()':
Main.cpp:2:86: warning: operation on 'i' may be undefined [-Wsequence-point]
2 | using namespace std;int n,i,x;map<int,int>p,a;main(){cin>>n;while(i<n)cin>>a[i],p[a[i++]]=i;i=0;while(i<n,x=a[i])while(i<n&&p[x]>=i)cout<<x<<"\n",i++;}
| ~^~
Main.cpp:2:86: warning: operation on 'i' may be undefined [-Wsequence-point]
Main.cpp:2:104: warning: left operand of comma operator has no effect [-Wunused-value]
2 | using namespace std;int n,i,x;map<int,int>p,a;main(){cin>>n;while(i<n)cin>>a[i],p[a[i++]]=i;i=0;while(i<n,x=a[i])while(i<n&&p[x]>=i)cout<<x<<"\n",i++;}
| ~^~
Main.cpp:2:108: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
2 | using namespace std;int n,i,x;map<int,int>p,a;main(){cin>>n;while(i<n)cin>>a[i],p[a[i++]]=i;i=0;while(i<n,x=a[i])while(i<n&&p[x]>=i)cout<<x<<"\n",i++;}