Cod sursa(job #2483824)

Utilizator AlexNeaguAlexandru AlexNeagu Data 30 octombrie 2019 13:27:16
Problema Lacate Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.5 kb
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
vector < int > a[500];
ifstream in("lacate.in");
ofstream out("lacate.out");
int main() {
  int n, x = 1;
  in >> n;
  out << n * (n - 1) / 2 << " " << n - 1 << "\n";
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      a[i].pb(x);
      a[j].pb(x);
      x++;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (auto it : a[i]) {
      out << it << " ";
    }
    out << "\n";
  }
  return 0;
}