Submission #319120

#TimeUsernameProblemLanguageResultExecution timeMemory
319120daringtriflesGondola (IOI14_gondola)C++17
20 / 100
16 ms1152 KiB
//control+option+n to run! #include <bits/stdc++.h> #include "gondola.h" using namespace std; #define pb push_back #define ll long long #define pll pair<ll, ll> #define FOR(i, a, b) for (signed long long i = (signed long long)(a); i < (signed long long)(b); i++) #define NEGFOR(i, a, b) for (ll i = (a); i > (b); i--) #define vll vector<long long> #define sll set<long long> #define ld long double #define inf 1000000000000000000 #define mll multiset<long long> #define vpll vector<pll> #define nn << "\n" #define ss << " " #define F(i, b) for (ll i = 0; i < b; i++) int valid(int n, int inputSeq[]){ ll mi=inf, curr=0; FOR(i,0,n){ if(mi>inputSeq[i]){ curr=i; } mi=min(mi,(ll)inputSeq[i]); } ll past=mi-1; FOR(i,curr,curr+n){ if (past+1==inputSeq[i%n]){ past++; } else return 0; } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; } /* int main(){ int n; cin>>n; int x[n]; FOR(i,0,n) cin>>x[i]; cout<<valid (n,x); } */
#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...