| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1324543 | tomthuy123 | Stone Arranging 2 (JOI23_ho_t1) | C++20 | 7 ms | 1848 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const ll MOD=1000000007;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll n;
cin >> n;
vector<ll> lst(n+1);
for(ll i=1;i<=n;i++){
cin >> lst[i];
}
if(n<=2000){
for(ll i=1;i<=n;i++){
ll Curr=lst[i];
ll Last=-1;
for(ll j=1;j<i;j++){
if(lst[j]==Curr){
Last=j;
}
}
if(Last==-1) continue;
for(ll j=Last;j<i;j++){
lst[j]=Curr;
}
}
for(ll i=1;i<=n;i++){
cout << lst[i] << "\n";
}
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
