# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
644338 | Kripton | Zalmoxis (BOI18_zalmoxis) | C++14 | 131 ms | 12424 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;
int steve[1000001],vf;
int v[1000001],v1[1000001];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n,k,i,x;
cin>>n>>k;
for(i=1;i<=n;i++)
{
cin>>v[i];
v1[i]=v[i];
while(v[i]==v[steve[vf]])
{
v[i]++;
vf--;
}
steve[++vf]=i;
}
int ind,min1=40;
for(i=1;i<=vf;i++)
if(v[steve[i]]<min1)
{
min1=v[steve[i]];
ind=steve[i];
}
for(i=1;i<=n;i++)
{
cout<<v1[i]<<" ";
if(i==ind)
cout<<min1<<" ";
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |