//control+option+n to run!
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
#define pb push_back
#define ll long long
#define pll pair<ll, ll>
#define FOR(i, a, b) for (signed long long i = (signed long long)(a); i < (signed long long)(b); i++)
#define NEGFOR(i, a, b) for (ll i = (a); i > (b); i--)
#define vll vector<long long>
#define sll set<long long>
#define ld long double
#define inf 1000000000000000000
#define mll multiset<long long>
#define vpll vector<pll>
#define nn << "\n"
#define ss << " "
#define F(i, b) for (ll i = 0; i < b; i++)
int valid(int n, int inputSeq[]){
ll mi=inf, curr=0;
FOR(i,0,n){
if(mi>inputSeq[i]){
curr=i;
}
mi=min(mi,(ll)inputSeq[i]);
}
ll past=mi-1;
FOR(i,curr,curr+n){
if (past+1==inputSeq[i%n]){
past++;
}
else return 0;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
sll s;
ll mi=-inf;
FOR(i,0,n){
mi=max(mi,(ll)gondolaSeq[i]);
}
FOR(i,1,250005){
s.insert(i);
}
FOR(i,0,n){
s.erase(gondolaSeq[i]);
}
ll ans=0;
for(auto i:s){
if(i>mi){
break;
}
replacementSeq[ans]=i;
ans++;
}
return ans;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
/*
int main(){
int n; cin>>n; int x[n],g[n];
FOR(i,0,n) cin>>x[i];
cout<<replacement (n,x,g);
}
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
5 ms |
620 KB |
Output is correct |
7 |
Correct |
12 ms |
876 KB |
Output is correct |
8 |
Correct |
10 ms |
876 KB |
Output is correct |
9 |
Correct |
4 ms |
492 KB |
Output is correct |
10 |
Correct |
11 ms |
876 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
6 ms |
620 KB |
Output is correct |
7 |
Correct |
11 ms |
876 KB |
Output is correct |
8 |
Correct |
10 ms |
1004 KB |
Output is correct |
9 |
Correct |
3 ms |
492 KB |
Output is correct |
10 |
Correct |
11 ms |
1132 KB |
Output is correct |
11 |
Correct |
1 ms |
364 KB |
Output is correct |
12 |
Correct |
0 ms |
364 KB |
Output is correct |
13 |
Correct |
5 ms |
740 KB |
Output is correct |
14 |
Correct |
1 ms |
492 KB |
Output is correct |
15 |
Correct |
12 ms |
1004 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
12008 KB |
Output is correct |
2 |
Correct |
59 ms |
12004 KB |
Output is correct |
3 |
Correct |
64 ms |
12004 KB |
Output is correct |
4 |
Correct |
59 ms |
12052 KB |
Output is correct |
5 |
Correct |
59 ms |
12132 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
12004 KB |
Output is correct |
2 |
Correct |
59 ms |
12004 KB |
Output is correct |
3 |
Correct |
57 ms |
12004 KB |
Output is correct |
4 |
Correct |
57 ms |
12132 KB |
Output is correct |
5 |
Correct |
59 ms |
12004 KB |
Output is correct |
6 |
Correct |
57 ms |
12004 KB |
Output is correct |
7 |
Incorrect |
57 ms |
12004 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
12004 KB |
Output is correct |
2 |
Correct |
61 ms |
12132 KB |
Output is correct |
3 |
Correct |
58 ms |
12280 KB |
Output is correct |
4 |
Correct |
58 ms |
12004 KB |
Output is correct |
5 |
Correct |
57 ms |
12004 KB |
Output is correct |
6 |
Correct |
57 ms |
12008 KB |
Output is correct |
7 |
Incorrect |
57 ms |
12004 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Integer -3 violates the range [0, 1000000008] |
2 |
Halted |
0 ms |
0 KB |
- |