# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153161 | tushar_2658 | medians (balkan11_medians) | C++14 | 34 ms | 3448 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;
const int maxn = 2e5 + 5;
int b[maxn], a[maxn];
int main(int argc, char const *argv[])
{
// freopen("in.txt", "r", stdin);
int n;
scanf("%d", &n);
int maxi = -1;
for(int i = 1; i <= n; i++){
scanf("%d", &b[i]);
if(b[i] > maxi)maxi = b[i];
}
for(int i = 1; i <= n; i++){
a[2*i-1] = b[i];
}
for(int i = 1; i <= 2*n-1; i++){
if(!a[i])a[i] = maxi + 1;
}
for(int i = 1; i <= 2*n-1; i++)printf("%d ", a[i]);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |