Submission #919606

#TimeUsernameProblemLanguageResultExecution timeMemory
919606Younis_DwaiStone Arranging 2 (JOI23_ho_t1)C++14
100 / 100
169 ms15956 KiB
#include <bits/stdc++.h> //#define int long long #define ll long long #define in insert #define F first #define S second #define pb push_back #define endl "\n" #define mid (l+r)/2 #define pop pop_back //#define all(v) v.begin(),v.end() using namespace std; const int M=998244353; int n,a[200001],b[200001],l[200009]; map<int,int> mp; int32_t main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; mp[a[i]]=i; } for(int i=1;i<=n;i++){ b[i]=a[i]; int j=i; for(j;j<=mp[a[i]];j++) b[j]=a[i]; i=j-1; } for(int i=1;i<=n;i++) cout<<b[i]<<' '; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int32_t main()':
Main.cpp:26:13: warning: statement has no effect [-Wunused-value]
   26 |         for(j;j<=mp[a[i]];j++) b[j]=a[i];
      |             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...