98122024-03-07 09:39:36EsVagyKönyvkupaccpp17Partially correct 82.34/1003ms2976 KiB
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <climits>
#include <queue>
#include <fstream>
#include <sstream>
#include <math.h>
#include <list>

using namespace std;
using ll = long long;


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    vector<vector<int>> kupac(10000);
    int cur = 1;
    for (size_t i = 0; i < n; i++)
    {
        kupac[0].push_back(i);
    }
    for (size_t i = 0; i < n; i++)
    {
        if (kupac[cur].size() < kupac[0].size()) {
            int movedIdx = kupac[0][kupac[0].size() - 1];
            kupac[cur].push_back(movedIdx);
            kupac[0].pop_back();
            cout << 1 << " " << 0 << " " << cur << "\n";
        }
        else {
            cur++;
            i--;
        }
    }
    int sum = 0;
    for (int i = cur; i > 1; i--)
    {
        int number = kupac[i].size();
        sum += number;
        cout << sum << " " << i << " " << i-1 << "\n";
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms2164 KiB
2Accepted3ms2396 KiB
subtask282.34/100
3Partially correct3ms2632 KiB
4Partially correct3ms2644 KiB
5Partially correct3ms2752 KiB
6Partially correct3ms2756 KiB
7Partially correct3ms2760 KiB
8Partially correct3ms2976 KiB