Submission #1329721

#TimeUsernameProblemLanguageResultExecution timeMemory
1329721Valters07Stone Arranging 2 (JOI23_ho_t1)C++20
35 / 100
23 ms1612 KiB
#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define pb push_back
#define fi first
#define se second
#define en exit(0);
using namespace std;
const int N = 2e5 + 5;
const int INF = 1e9 + 5;
int a[N];
int main()
{
    fio
//    ifstream cin("in.in");
    int n;
    cin >> n;
    for(int i = 1;i <= n;i++)
        cin >> a[i];
    int lst = n;
    while(a[lst] != a[1])
        lst--;
    for(int i = 1;i <= lst;i++)
        a[i] = a[1];
    for(int i = 1;i <= n;i++)
        cout << a[i] << " ";
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...