| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1364474 | clemmy14 | Stone Arranging 2 (JOI23_ho_t1) | C++20 | 154 ms | 13480 KiB |
#include<bits/stdc++.h>
using namespace std;
signed main() {
int n; cin >> n;
vector<int> v(n);
for(int i=0; i<n; i++) cin >> v[i];
map<int, int> lastSeen;
for(int i=0; i<n; i++) {
lastSeen[v[i]]=i;
}
vector<int> ans;
int idx=0;
while(idx != n) {
int last = lastSeen[v[idx]];
for(int i=idx; i<=last; i++) ans.push_back(v[idx]);
idx=last+1;
}
for(auto x : ans) cout << x << '\n';
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
