Submission #231174

#TimeUsernameProblemLanguageResultExecution timeMemory
231174CantfindmeList of Unique Integers (FXCUP4_unique)C++17
100 / 100
5 ms512 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<int,int> pi; #define f first #define s second #define FAST ios_base::sync_with_stdio(0); cin.tie(0); #include "unique.h" const int maxn = 210; int A[maxn]; std::vector<int> PickUnique(int N) { vector <int> v(N); int cursum = 0; for (int i =0;i<N;i++) { int res = UniqueCount(0,i); if (res == cursum+1) A[i] = 1; cursum = res; } for (int i =0;i<N-1;i++) { int res = UniqueCount(i+1,N-1); if (A[i] and res == cursum - 1) v[i] = 1; else v[i] = 0; cursum = res; } if (A[N-1]) v[N-1] = 1; else v[N-1] = 0; //for (auto i: v) cout << i << " "; return v; //UniqueCount(0, N-1); //UniqueCount(1, N-2); //return std::vector<int>({0, 0, 1, 0, 0}); }
#Verdict Execution timeMemoryGrader output
Fetching results...