2 051
Suscriptores
Sin datos24 horas
Sin datos7 días
Sin datos30 días
Archivo de publicaciones
Hi T.Sunanda , Welcome to this Community for 2022 Batch Daily Off Campus Jobs Updates join this channel ✅
👇👇
@offcampusjobs_0
@offcampusjobs_0
Hi Pratik Welcome to this Community. Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@placement_0
@placement_0
Hi Phoenix , Welcome to this Community for 2022 Batch Daily Off Campus Jobs Updates join this channel ✅
👇👇
@offcampusjobs_0
@offcampusjobs_0
Those who have infyTQ 3rd April 1 PM java slot can DM me for the what's app group link.
Dm me
Hi Akash Welcome to this Community. Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
pavani Dasari:
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int nSk(int n, int k){
if (n < 2)
return 1;
if (k > n-2)
return 0;
vector<int> numbers;
numbers.reserve(n - 2);
for (int i = 0; i < n - 2; ++i){
numbers.push_back(i + 2);
}
std::vector<bool> v(numbers.size());
std::fill(v.end() - k, v.end(), true);
int ret = 0;
do {
int tmpnum = 1;
for (int j = 0; j < numbers.size(); ++j) {
if (v[j])
{
tmpnum *= numbers[j];
}
}
ret += tmpnum;
} while (std::next_permutation(v.begin(), v.end()));
return ret;
}
int main(){
int n, d;
cin >> n;
cin >> d;
int sum = 0;
for (int k = 0; k < d; ++k){
sum += nSk(n, k);
}
//sum *= 2;
cout<< sum;
}
✅1 to N
Friends puzzle code
