제출 #1134860

#제출 시각아이디문제언어결과실행 시간메모리
1134860huoiList of Unique Integers (FXCUP4_unique)C++17
100 / 100
0 ms584 KiB
#include "unique.h" #include <bits/stdc++.h> using namespace std; std::vector<int> PickUnique(int n) { vector<int> ans(n, 1); int prev = -1; for (int i = 0; i < n; i++) { int cnt = UniqueCount(0, i); // cout << i << " " << cnt << "\n"; if (cnt <= prev) { ans[i] = 0; } prev = cnt; } prev = -1; for (int i = n - 1; i >= 0; i--) { int cnt = UniqueCount(i, n - 1); // cout << i << " " << cnt << "\n"; if (cnt <= prev) { ans[i] = 0; } prev = cnt; } // for (int i = 0; i < n; i++) cout << ans[i] << " \n"[i == n - 1]; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...