Submission #521249

# Submission time Handle Problem Language Result Execution time Memory
521249 2022-02-01T09:58:40 Z penguin133 List of Unique Integers (FXCUP4_unique) C++17
100 / 100
1 ms 460 KB
#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> PickUnique(int N) {
	vector<int>v;
	int L[201], R[202];
	L[0] = 0, R[201] = 0;
	for(int i=0;i<N;i++){
		L[i+1] = UniqueCount(0, i);
		R[i+1] = UniqueCount(i, N-1);
	}
	int cnt = 0, cnt2 = R[200];
	for(int i=1;i<=N;i++){
		if(L[i] > L[i-1] && R[i] > R[i+1])v.push_back(1);
		else v.push_back(0);
		cnt = L[i];
		cnt2 = R[i];
	}
	
	return v;
}

Compilation message

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:12:6: warning: variable 'cnt' set but not used [-Wunused-but-set-variable]
   12 |  int cnt = 0, cnt2 = R[200];
      |      ^~~
unique.cpp:12:15: warning: variable 'cnt2' set but not used [-Wunused-but-set-variable]
   12 |  int cnt = 0, cnt2 = R[200];
      |               ^~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Correct : C = 4
2 Correct 1 ms 204 KB Correct : C = 10
3 Correct 1 ms 304 KB Correct : C = 50
4 Correct 1 ms 308 KB Correct : C = 100
5 Correct 1 ms 332 KB Correct : C = 100
6 Correct 1 ms 332 KB Correct : C = 154
7 Correct 1 ms 332 KB Correct : C = 200
8 Correct 1 ms 432 KB Correct : C = 300
9 Correct 1 ms 460 KB Correct : C = 356
10 Correct 1 ms 460 KB Correct : C = 400
11 Correct 1 ms 460 KB Correct : C = 400
12 Correct 1 ms 460 KB Correct : C = 400
13 Correct 1 ms 460 KB Correct : C = 400
14 Correct 1 ms 460 KB Correct : C = 400
15 Correct 1 ms 460 KB Correct : C = 400