Submission #66329

#TimeUsernameProblemLanguageResultExecution timeMemory
66329someone_aaGondola (IOI14_gondola)C++17
20 / 100
35 ms1712 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; int valid(int n, int arr[]) { bool check = true; for(int i=1;i<n;i++) { if(arr[i] > n) continue; else if(arr[i] == 1) { if(arr[i-1] < n) check = false; } else { if(arr[i-1] <= n && arr[i-1] != arr[i] - 1) check = false; } } sort(arr, arr+n); for(int i=1;i<n;i++) { if(arr[i] == arr[i-1]) check = false; } if(check) return 1; else return 0; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; } /*int main() { int arr[] = {6, 6, 7, 7}; cout<<valid(4, arr); }*/
#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...