Submission #500757

#TimeUsernameProblemLanguageResultExecution timeMemory
500757InternetPerson10Gondola (IOI14_gondola)C++17
20 / 100
21 ms1008 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1000000009; int valid(int n, int inputSeq[]) { vector<int> nums(n); for(int i = 0; i < n; i++) { nums[i] = inputSeq[i]; } sort(nums.begin(), nums.end()); int mi = MOD; for(int i = 0; i < n-1; i++) { if(nums[i] == nums[i+1]) return 0; mi = min(mi, nums[i]); } int k = 0; for(int i = 0; i < n; i++) { if(mi == inputSeq[i]) k = i; } k -= mi; k += (n+1); k %= n; for(int i = 0; i < n; i++) { nums[i] = inputSeq[(k+i)%n]; } for(int i = 0; i < n; i++) { if(nums[i] <= n && nums[i] != i+1) 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...