제출 #998663

#제출 시각아이디문제언어결과실행 시간메모리
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++;}

컴파일 시 표준 에러 (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...