188942025-11-09 18:46:21szabelrDíjazás több helyezettnekcpp17Accepted 80/80180ms500 KiB
// Díjazás több helyezettnek.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
using namespace std;
void back(int og,int a, int b, int index, vector<int>& subset,int elozo) {
	int max = b - ((a * (a - 1)) / 2);
	if (og == index and max==0) {
		for (int i = 0; i < subset.size(); i++) {
			cout << subset[i] << " ";
		}
		cout << endl;
		return;
	}
	if (elozo <= max)
		max = elozo-1;

	for (int i = max; i > 0; i--) {
		subset.push_back(i);
		back(og, a-1, b-i, index+1, subset,i);
		subset.pop_back();
	}

}
int main()
{
	int a, b,k;
	cin >> a >> b;
	int og = a;
	k = b-((a * (a - 1)) / 2);
	vector<int> subset;
	back(og,a, b, 0, subset,10000);
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Accepted3ms500 KiB
subtask25/5
3Accepted1ms316 KiB
4Accepted1ms316 KiB
5Accepted1ms316 KiB
6Accepted1ms316 KiB
7Accepted17ms316 KiB
subtask35/5
8Accepted1ms316 KiB
9Accepted1ms316 KiB
10Accepted1ms316 KiB
11Accepted2ms316 KiB
12Accepted25ms316 KiB
subtask415/15
13Accepted1ms500 KiB
14Accepted1ms316 KiB
15Accepted1ms316 KiB
16Accepted2ms316 KiB
17Accepted3ms316 KiB
subtask515/15
18Accepted1ms316 KiB
19Accepted2ms316 KiB
20Accepted2ms316 KiB
21Accepted2ms352 KiB
22Accepted1ms316 KiB
subtask615/15
23Accepted1ms316 KiB
24Accepted4ms316 KiB
25Accepted1ms316 KiB
26Accepted2ms316 KiB
27Accepted2ms316 KiB
28Accepted2ms352 KiB
29Accepted1ms316 KiB
30Accepted4ms316 KiB
31Accepted3ms408 KiB
32Accepted1ms500 KiB
33Accepted1ms316 KiB
34Accepted4ms316 KiB
35Accepted1ms316 KiB
36Accepted1ms316 KiB
37Accepted6ms416 KiB
38Accepted8ms412 KiB
39Accepted2ms316 KiB
subtask725/25
40Accepted1ms316 KiB
41Accepted4ms316 KiB
42Accepted1ms316 KiB
43Accepted1ms316 KiB
44Accepted1ms316 KiB
45Accepted1ms316 KiB
46Accepted17ms316 KiB
47Accepted1ms316 KiB
48Accepted1ms316 KiB
49Accepted1ms316 KiB
50Accepted2ms316 KiB
51Accepted25ms316 KiB
52Accepted1ms500 KiB
53Accepted1ms316 KiB
54Accepted1ms316 KiB
55Accepted2ms316 KiB
56Accepted3ms316 KiB
57Accepted1ms316 KiB
58Accepted2ms316 KiB
59Accepted2ms316 KiB
60Accepted2ms352 KiB
61Accepted1ms316 KiB
62Accepted4ms316 KiB
63Accepted3ms408 KiB
64Accepted1ms500 KiB
65Accepted1ms316 KiB
66Accepted4ms316 KiB
67Accepted1ms316 KiB
68Accepted1ms316 KiB
69Accepted6ms416 KiB
70Accepted8ms412 KiB
71Accepted2ms316 KiB
72Accepted32ms500 KiB
73Accepted6ms328 KiB
74Accepted54ms316 KiB
75Accepted2ms316 KiB
76Accepted6ms316 KiB
77Accepted107ms376 KiB
78Accepted6ms316 KiB
79Accepted180ms404 KiB
80Accepted41ms316 KiB
81Accepted82ms316 KiB