Submission #716141

#TimeUsernameProblemLanguageResultExecution timeMemory
716141BaytoroGondola (IOI14_gondola)C++17
20 / 100
63 ms6112 KiB
#include "gondola.h" #include <bits/stdc++.h> //#include "grader.cpp" using namespace std; int valid(int n, int a[]){ map<int,int> mp; for(int i=0;i<n;i++){ if(mp[a[i]]!=0) return 0; mp[a[i]]=1; } vector<pair<int,int>> v; for(int i=0;i<n;i++){ if(a[i]<=n){ v.push_back({a[i],i}); } } sort(v.begin(),v.end()); for(int i=1;i<(int)v.size();i++){ int k=(v[i].first-v[i-1].first); int s=(v[i].second-v[i-1].second+n)%n; if(k!=s) return 0; } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...