Cod sursa(job #2469893)

Utilizator ArdeleanOficialAlexandru ArdeleanOficial Data 8 octombrie 2019 11:14:50
Problema Lacate Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("lacate.in");
ofstream fout("lacate.out");

int n, k;

vector < int > v[257];

int main()
{
    fin >> n;
    fout << n * (n - 1) / 2 << ' ' << n - 1 << '\n';
    for (int i = 1; i < n; ++i)
        for (int j = i + 1; j <= n; ++j)
            v[i].push_back(k), v[k].push_back(k), ++k;
    for (int i = 1; i <= n; ++i) {
        for (int j : v[i])
            fout << j << ' ';
        fout << '\n';
    }
    return 0;
}