Submission #319130

#TimeUsernameProblemLanguageResultExecution timeMemory
319130daringtriflesGondola (IOI14_gondola)C++17
20 / 100
59 ms12260 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[]) { sll s; ll mi=-inf; FOR(i,0,n){ mi=max(mi,(ll)gondolaSeq[i]); } FOR(i,1,250005){ s.insert(i); } FOR(i,0,n){ s.erase(gondolaSeq[i]); } ll ans=0; for(auto i:s){ if(i>mi){ break; } ans++; } return ans; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; } /* int main(){ int n; cin>>n; int x[n],g[n]; FOR(i,0,n) cin>>x[i]; cout<<replacement (n,x,g); } */
#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...