Submission #734897

#TimeUsernameProblemLanguageResultExecution timeMemory
734897sandry24Gondola (IOI14_gondola)C++17
25 / 100
9 ms1236 KiB
#include <bits/stdc++.h> using namespace std; //#pragma GCC optimize("O3,unroll-loops") //#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; #define pb push_back #define mp make_pair #define f first #define s second #include "gondola.h" int freq[250001]; int valid(int n, int inputSeq[]){ int index_under_n = -1; for(int i = 0; i < n; i++){ freq[inputSeq[i]]++; if(freq[inputSeq[i]] > 1) return 0; if(inputSeq[i] <= n) index_under_n = i; } if(index_under_n == -1) return 1; int index = (index_under_n == n-1 ? 0 : index_under_n + 1); int next = (inputSeq[index_under_n] == n ? 1 : inputSeq[index_under_n] + 1); while(index != index_under_n){ if(inputSeq[index] < n){ if(inputSeq[index] != next){ return 0; } } index = (index == n-1 ? 0 : index + 1); next = (next == n ? 1 : next + 1); } return 1; } int replacement(int n, int gondolaSeq[], int replacementSeq[]){ return 1; } int countReplacement(int n, int inputSeq[]){ return 1; }
#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...