Submission #759102

#TimeUsernameProblemLanguageResultExecution timeMemory
759102Dan4LifeStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
335 ms21156 KiB
#include <bits/stdc++.h> using namespace std; int n,i,x; map<int,int>a,p; main(){ cin>>n;while(i<n)cin>>a[i],p[a[i]]=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:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
Main.cpp: In function 'int main()':
Main.cpp:7:12: warning: left operand of comma operator has no effect [-Wunused-value]
    7 |     while(i<n,x=a[i])while(i<n&&p[x]>=i)cout<<x<<"\n",i++;
      |           ~^~
Main.cpp:7:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    7 |     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...