Submission #148390

# Submission time Handle Problem Language Result Execution time Memory
148390 2019-09-01T04:16:00 Z Torat(#3726, Osama_Alkhodairy, mohammedehab2002, mahmoudbadawy) List of Unique Integers (FXCUP4_unique) C++17
100 / 100
7 ms 688 KB
#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
int ret[205][205];
int get(int l,int r)
{
	if (r<l)
	return 0;
	if (ret[l][r]!=-1)
	return ret[l][r];
	return ret[l][r]=UniqueCount(l,r);
}
vector<int> PickUnique(int n)
{
	memset(ret,-1,sizeof(ret));
	vector<int> ans(n);
	for (int i=0;i<n;i++)
	ans[i]=(get(0,i)-get(0,i-1)>0 && get(i,n-1)-get(i+1,n-1)>0);
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 512 KB Correct : C = 3
2 Correct 6 ms 512 KB Correct : C = 8
3 Correct 6 ms 512 KB Correct : C = 45
4 Correct 6 ms 512 KB Correct : C = 91
5 Correct 6 ms 512 KB Correct : C = 94
6 Correct 6 ms 512 KB Correct : C = 140
7 Correct 5 ms 512 KB Correct : C = 181
8 Correct 6 ms 640 KB Correct : C = 276
9 Correct 7 ms 640 KB Correct : C = 322
10 Correct 6 ms 640 KB Correct : C = 371
11 Correct 6 ms 640 KB Correct : C = 371
12 Correct 6 ms 640 KB Correct : C = 358
13 Correct 7 ms 640 KB Correct : C = 365
14 Correct 6 ms 688 KB Correct : C = 201
15 Correct 6 ms 640 KB Correct : C = 399