Cod sursa(job #2600971)

Utilizator alex_benescubenescu alexandru alex_benescu Data 13 aprilie 2020 15:07:17
Problema Patrate2 Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.3 kb
#import<fstream>
using namespace std;ifstream I("patrate2.in");ofstream O("patrate2.out");int i,j,t,n,p[10101];void m(int a){for(t=0,j=1;j<=p[0];++j)p[j]=p[j]*a+t,t=p[j]/10,p[j]%=10;while(t)p[++p[0]]=t%10,t/=10;}main(){p[0]=p[1]=1;for(I>>n,i=2;i<=n;++i)m(i);for(i=1;i<=n*n;i++)m(2);for(i=p[0];i;i--)O<<p[i];}