Cod sursa(job #2643222)

Utilizator hhhhhhhAndrei Boaca hhhhhhh Data 19 august 2020 11:20:42
Problema Lacate Scor 100
Compilator cpp-64 Status done
Runda prbd1 Marime 0.95 kb
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ifstream fin("lacate.in");
ofstream fout("lacate.out");
int n,nr;
vector<int> v[1001];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    fin>>n;
    int nr=0;
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++)
        {
            nr++;
            v[i].push_back(nr);
            v[j].push_back(nr);
        }
    fout<<nr<<" "<<v[1].size()<<'\n';
    for(int i=1;i<=n;i++)
    {
        for(auto j:v[i])
            fout<<j<<" ";
        fout<<'\n';
    }
    return 0;
}