Submission #320543

# Submission time Handle Problem Language Result Execution time Memory
320543 2020-11-09T04:41:55 Z seedkin List of Unique Integers (FXCUP4_unique) C++17
100 / 100
1 ms 620 KB
#include <stdio.h>
#include <stdlib.h>
#include "unique.h"

int map[205][205];
std::vector<int> PickUnique(int N) {
	for(int i =0; i< N; i++) {
		map[0][i] = UniqueCount(0, i);
		map[i][N-1] = UniqueCount(i, N-1);
	}

	std::vector<int> res;
    for(int i=0 ; i<N ; i++)
    {
		if( i > 0 && map[0][i] == map[0][i-1] + 1 ) {
			if( i < N-1 && map[i][N-1] == map[i+1][N-1] +1) {
				res.push_back(1);
				continue;
			}
		}

		if( i == 0 && map[i][N-1] == map[i+1][N-1] +1) {
			res.push_back(1);
			continue;
		}

		if ( i == N-1 && map[0][i] == map[0][i-1] + 1) {
			res.push_back(1);
			continue;
		}
        res.push_back(0);
    }

	// for(int i =0; i< N; i++) {
	// 	printf("%d ", res[i]);
	// }
	return res;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Correct : C = 4
2 Correct 0 ms 364 KB Correct : C = 10
3 Correct 1 ms 364 KB Correct : C = 50
4 Correct 1 ms 364 KB Correct : C = 100
5 Correct 1 ms 364 KB Correct : C = 100
6 Correct 1 ms 492 KB Correct : C = 154
7 Correct 1 ms 492 KB Correct : C = 200
8 Correct 1 ms 620 KB Correct : C = 300
9 Correct 1 ms 620 KB Correct : C = 356
10 Correct 1 ms 620 KB Correct : C = 400
11 Correct 1 ms 620 KB Correct : C = 400
12 Correct 1 ms 620 KB Correct : C = 400
13 Correct 1 ms 620 KB Correct : C = 400
14 Correct 1 ms 620 KB Correct : C = 400
15 Correct 1 ms 620 KB Correct : C = 400