Answers for "sfere numerate problema olinfo"

0

sfere numerate problema olinfo

#include<bits/stdc++.h>
using namespace std;

vector<int> sphere;
void inizio(int N,int M, int sfere[]){
	for (int i = 0; i < N; i++)
		sphere.push_back(sfere[i]);
}
void modifica(int posizione,int valore){
	sphere[posizione] = valore;
}
bool verifica(int l,int r){
	set<int> v;
	int K = (r - l) + 1;
	
	for(int i = 0; i < K; i++) v.insert(sphere[l + i]);

	set<int>::iterator 	lastIt = v.end();
	lastIt--;
if(*lastIt == K && v.size() == K) 
		return true; 
	else 
		return false;
}
Posted by: Guest on November-09-2020

Browse Popular Code Answers by Language