| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 998136 | dimashhh | Stone Arranging 2 (JOI23_ho_t1) | C++17 | 2031 ms | 282200 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e5 + 30, MOD = 1e9 + 7;
int n,a[N],lst[N];
map<int,vector<int>> pos;
void test(){
cin >> n;
for(int i = 1;i <= n;i++){
cin >> a[i];
if(pos[a[i]].size()){
for(int j = pos[a[i]].back() + 1;j < i;j++){
pos[a[j]].pop_back();
a[j] = a[i];
pos[a[i]].push_back(i);
}
}
pos[a[i]].push_back(i);
}
for(int i = 1;i <= n;i++){
cout << a[i] << '\n';
}
}
int main() {
ios_base::sync_with_stdio(false);cin.tie(0);
int t = 1;
// cin >> t;
while(t--){
test();
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
