# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230295 | Masterdan | Gondola (IOI14_gondola) | C++14 | 26 ms | 1452 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>
#define MAX 1e9+7
#define pb push_back
#define mk make_pair
#define all(a) a.begin (),a.end ()
using namespace std;
typedef vector<int> vi;
typedef long long int ll;
typedef pair<int, int> ii;
int valid(int n, int inputSeq[])
{
vi v;
int flag=0;
for(int i=0;i<n;i++)v.pb(inputSeq[i]);
for(int i=1;i<n;i++){
if(v[i]==1 && v[i-1]!=n)return 0;
if(v[i] != 1 && v[i-1] + 1 != v[i])return 0;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
vi v;
int sw=0;
for(int i=0;i<n;i++)v.pb(gondolaSeq[i]);
sort(all(v));
for(int i=0;i<n;i++){
if(v[i]!=i+1){replacementSeq[0]=i+1;
sw=1;
break;
}
}
return sw;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
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... |