# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148712 | 샌즈뼈 (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 7 ms | 640 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "unique.h"
using namespace std;
std::vector<int> PickUnique(int N)
{
vector<int> ans(N,1);
int i,j,v1,v2;
int cnt[211][211]={};
for (i=0;i<N;i++)
for (j=i+1;j<N;j++)
cnt[i][j]=UniqueCount(i,j);
for (i=0;i<N;i++)
{
for (j=i+1;j<N;j++)
{
if (cnt[i][j]==0) ans[j]=0;
if (cnt[i][j-1]>cnt[i][j]) ans[j]=0;
}
}
for (i=N-1;i>=0;i--)
{
for (j=i-1;j>=0;j--)
{
if (cnt[j][i]==0) ans[j]=0;
if (cnt[j+1][i]>cnt[j][i]) ans[j]=0;
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |