# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1026871 | MarwenElarbi | Gondola (IOI14_gondola) | C++17 | 24 ms | 5072 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>
#include "gondola.h"
using namespace std;
#define pb push_back
#define se second
#define fi first
const int nax=5e5+5;
const int MOD=1e9+7;
vector<pair<int,int>> tab;
int valid(int n, int inputSeq[])
{
bool test=true;
set<int> stt;
for (int i = 0; i < n; ++i)
{
stt.insert(inputSeq[i]);
}
test&=(stt.size()==n);
int cnt=-1e9;
for (int i = 0; i < n; ++i)
{
if(inputSeq[i]<=n){
cnt=(inputSeq[i]-(i+1)+n)%n;
}
}
if(cnt==-1e9) return test;
for (int i = 0; i < n; ++i)
{
if(inputSeq[i]<=n){
if((inputSeq[i]-(i+1)+n)%n!=cnt) test=false;
}
}
return test;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
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... |