Submission #1174419

#TimeUsernameProblemLanguageResultExecution timeMemory
1174419TsaganaStone Arranging 2 (JOI23_ho_t1)C++20
100 / 100
134 ms16520 KiB
#include<bits/stdc++.h>

#define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define all(x) x.begin(), x.end()
#define int long long
#define pq priority_queue
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pp pop_back
#define F first
#define S second

using namespace std;

void solve () {
	int n;
	cin >> n;
	vector<int> a(n+1);
	map<int, int> mp;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		mp[a[i]] = i;
	}
	for (int i = 1; i <= n; i++) {
		int x = a[i];
		int y = mp[a[i]];
		for (; i <= y; i++) cout << x << '\n';
		i--;
	}
}
signed main() {IOS solve(); return 0;}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...