Submission #148460

#TimeUsernameProblemLanguageResultExecution timeMemory
148460还没编好 (#200)List of Unique Integers (FXCUP4_unique)C++17
100 / 100
6 ms560 KiB
#include <bits/stdc++.h>
#include "unique.h"
using namespace std;
vector<int> PickUnique(int N) {
	vector<int> b(N,1);
	int p=0;
	for(int r=0;r<N;++r)
	{
		int g=UniqueCount(0,r);
		if(g<=p) b[r]=0; p=g;
	}
	p=0;
	for(int r=N-1;r>=0;--r)
	{
		int g=UniqueCount(r,N-1);
		if(g<=p) b[r]=0; p=g;
	}
	return b;
}
#ifdef LOCAL
#include "grader.cpp"
#endif

Compilation message (stderr)

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:10:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if(g<=p) b[r]=0; p=g;
   ^~
unique.cpp:10:20: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   if(g<=p) b[r]=0; p=g;
                    ^
unique.cpp:16:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if(g<=p) b[r]=0; p=g;
   ^~
unique.cpp:16:20: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   if(g<=p) b[r]=0; p=g;
                    ^
#Verdict Execution timeMemoryGrader output
Fetching results...