Submission #998663

#TimeUsernameProblemLanguageResultExecution timeMemory
9986630npataStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
308 ms21092 KiB
#include <bits/stdc++.h> 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++;}

Compilation message (stderr)

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++;}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...