# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
781944 | I_Love_EliskaM_ | Gondola (IOI14_gondola) | C++14 | 40 ms | 5556 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 "gondola.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0;i<n;++i)
#define pb push_back
#define all(x) x.begin(),x.end()
#define pi pair<int,int>
#define f first
#define s second
using ll = long long;
const int inf=1e9;
const int mod=1e9+9;
int replacement(int n, int a[], int r[]) {
int m=inf;
forn(i,n) m=min(m,a[i]);
if (m>n) {
vector<int> p;
set<int> s;
forn(i,n) s.insert(i);
map<int,int> mp;
forn(i,n) mp[a[i]]=i;
int l=0; forn(i,n) l=max(l,a[i]);
vector<int> v(n); forn(i,n) v[i]=i+1;
for (int i=n+1; i<=l; ++i) {
if (mp.count(i)) {
p.pb(v[mp[i]]);
s.erase(mp[i]);
} else {
p.pb(v[*s.begin()]);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |