Submission #1101723

#TimeUsernameProblemLanguageResultExecution timeMemory
1101723rayan_bdList of Unique Integers (FXCUP4_unique)C++17
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> #include "unique.h" using namespace std; //vector<int> vec={1,1,2,2,3,3}; /*int UniqueCount(int L,int R){ set<int> st; for(int i=L;i<=R;++i){ st.insert(vec[i]); } return st.size(); }*/ vector<int> PickUnique(int N){ vector<int> ans(N,1); int prev=0,curr=0; for(int i=0;i<N;++i){ curr=UniqueCount(0,i); if(curr==prev){ ans[i]=0; } prev=curr; } return ans; } /*int main(){ vector<int> ans=PickUnique((int)vec.size()); for(auto it:ans) cout<<it<<" "; return 0; }*/
#Verdict Execution timeMemoryGrader output
Fetching results...