# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
274554 | faresbasbs | Gondola (IOI14_gondola) | C++14 | 45 ms | 5740 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;
int valid(int n, int a[]){
vector<pair<int,int>> v;
for(int i = 0 ; i < n ; i += 1){
if(a[i] <= n){
v.push_back({a[i],i});
}
}
sort(v.begin(),v.end());
for(int i = 1 ; i < v.size() ; i += 1){
int diff1 = v[i].first-v[i-1].first , diff2;
if(v[i].second > v[i-1].second){
diff2 = v[i].second-v[i-1].second;
}else{
diff2 = n-v[i-1].second+v[i].second;
}
if(diff1 != diff2){
return 0;
}
}
set<int> st;
for(int i = 0 ; i < n ; i += 1){
if(st.count(a[i])){
return 0;
}
st.insert(a[i]);
}
return 1;
}
//----------------------
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... |