Cod sursa(job #2028120)

Utilizator OlivianOlivian Dan Cretu Olivian Data 27 septembrie 2017 10:38:35
Problema Lacate Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include<cstdio>
using namespace std;
int main()
{
    freopen("lacate.in","r",stdin);
    freopen("lacate.out","w",stdout);
    int ma[260][260],n,ct=0;
    scanf("%d",&n);
    for(int i=1; i<=n; i++)
        for(int j=i+1; j<=n; j++)
        {
            ct++;
            ma[i][j]=ct;
            ma[j][i]=ct;

        }
        printf("%d %d\n",ct,n-1);
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=n;j++)
                if(i!=j) printf("%d ",ma[i][j]);
            printf("\n");
        }
}