2 051
Подписчики
Нет данных24 часа
Нет данных7 дней
Нет данных30 дней
Архив постов
#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;
}
Bob questions
07 мая 2021, 06:06
Hi chandu Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
22 дек. 2021, 21:23
#free
Coding Ninja Free Registration 🚀
India's biggest coding competition. Participate and win prizes worth 1 million and get internship Opportunities.Rewards for best coders in each college and exclusive placement cell access to top 100 rankers.
Free Registration:-
https://bit.ly/31FxvkD
13 нояб. 2021, 08:00
VERBAL
1. A( earned how some browni)
2. C( fallen
3. B( raise her game)
4. A
5. c
6.
7.enabling
8.profilgacy
Telegram- @Coding_solution_0
18 дек. 2021, 00:23
Hi Jeremy Patel Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
25 нояб. 2021, 04:59
Hi Sai Welcome to this Community. Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@placement_0
@placement_0
05 мая 2021, 01:59
Hi SS Welcome to this Community, Subscribe Our YouTube Channel📣 for Daily Jobs Updates and Study Material
15 мар. 2021, 14:10
Hi Aysha Welcome to this Community. Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
27 мар. 2022, 21:41
Hi Sandeep , Welcome to this Community for 2022 Batch Daily Off Campus Jobs Updates join this channel ✅
👇👇
@offcampusjobs_0
@offcampusjobs_0
02 апр. 2021, 12:45
