185552025-10-26 18:16:41szabelrDíjazás több helyezettnekcpp17Wrong answer 0/801ms508 KiB
// Díjazás több helyezettnek.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
using namespace std;
int diak[21];
void kiir(int h) {
    for (int i = h; i > 0; i--)
        cout << diak[i] << " ";
    cout << endl;
}
int main()
{
    int h, e;
    cin >> h >> e;
    for (int i = 1; i <= h; i++) {
        diak[i] = i;
        e = e - i;
    }
    diak[h] = diak[h] + e;
    kiir(h);
    int x = h;
    int lehete = 0;
    while(lehete==0)
    {
        
        while (diak[x] - 1 > diak[x - 1] + 1) {
            diak[x]--;
            diak[x - 1]++;
            kiir(h);
            //cout << "x:" << x << endl;
        }
        if (diak[x] - 1 == diak[x - 1] + 1) {
            diak[h]--;
            diak[x - 1]++;
            kiir(h);
            //cout << "x:" << x << endl;
        }
        x--;
        if (x < 2)
            break;
    }
}

// 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
1Accepted1ms508 KiB
2Wrong answer1ms316 KiB
subtask20/5
3Accepted1ms316 KiB
4Wrong answer1ms316 KiB
5Wrong answer1ms316 KiB
6Wrong answer1ms316 KiB
7Wrong answer1ms316 KiB
subtask30/5
8Accepted1ms316 KiB
9Accepted1ms316 KiB
10Wrong answer1ms508 KiB
11Wrong answer1ms500 KiB
12Wrong answer1ms316 KiB
subtask40/15
13Accepted1ms316 KiB
14Wrong answer1ms316 KiB
15Wrong answer1ms316 KiB
16Wrong answer1ms316 KiB
17Wrong answer1ms316 KiB
subtask50/15
18Wrong answer1ms316 KiB
19Wrong answer1ms316 KiB
20Wrong answer1ms316 KiB
21Wrong answer1ms316 KiB
22Wrong answer1ms316 KiB
subtask60/15
23Accepted1ms316 KiB
24Wrong answer1ms316 KiB
25Wrong answer1ms316 KiB
26Wrong answer1ms316 KiB
27Wrong answer1ms316 KiB
28Wrong answer1ms316 KiB
29Wrong answer1ms316 KiB
30Wrong answer1ms316 KiB
31Wrong answer1ms316 KiB
32Wrong answer1ms328 KiB
33Wrong answer1ms316 KiB
34Wrong answer1ms344 KiB
35Wrong answer1ms316 KiB
36Wrong answer1ms508 KiB
37Wrong answer1ms392 KiB
38Wrong answer1ms316 KiB
39Wrong answer1ms316 KiB
subtask70/25
40Accepted1ms316 KiB
41Wrong answer1ms316 KiB
42Accepted1ms316 KiB
43Wrong answer1ms316 KiB
44Wrong answer1ms316 KiB
45Wrong answer1ms316 KiB
46Wrong answer1ms316 KiB
47Accepted1ms316 KiB
48Accepted1ms316 KiB
49Wrong answer1ms508 KiB
50Wrong answer1ms500 KiB
51Wrong answer1ms316 KiB
52Accepted1ms316 KiB
53Wrong answer1ms316 KiB
54Wrong answer1ms316 KiB
55Wrong answer1ms316 KiB
56Wrong answer1ms316 KiB
57Wrong answer1ms316 KiB
58Wrong answer1ms316 KiB
59Wrong answer1ms316 KiB
60Wrong answer1ms316 KiB
61Wrong answer1ms316 KiB
62Wrong answer1ms316 KiB
63Wrong answer1ms316 KiB
64Wrong answer1ms328 KiB
65Wrong answer1ms316 KiB
66Wrong answer1ms344 KiB
67Wrong answer1ms316 KiB
68Wrong answer1ms508 KiB
69Wrong answer1ms392 KiB
70Wrong answer1ms316 KiB
71Wrong answer1ms316 KiB
72Wrong answer1ms316 KiB
73Wrong answer1ms316 KiB
74Wrong answer1ms316 KiB
75Wrong answer1ms316 KiB
76Wrong answer1ms316 KiB
77Wrong answer1ms316 KiB
78Wrong answer1ms316 KiB
79Wrong answer1ms316 KiB
80Wrong answer1ms316 KiB
81Wrong answer1ms316 KiB