# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9610 | pichulia | Uniting (kriii2_U) | C++98 | 0 ms | 2648 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#define M 1000000007LL
int n;
long long int a[100009];
long long int f[100009];
long long int s,t,u;
int main()
{
scanf("%d",&n);
int i,j, k;
f[0] = 1;
for(i=0;i<n;i++)
{
scanf("%lld",&a[i]);
s = (s+a[i])%M;
t = (t+a[i]*a[i])%M;
f[i+1] = (f[i] * (i+1))%M;
}
u = (s*s-t)%M;
u = (u * (M/2+1))%M;
printf("%lld\n%lld\n",u,f[n]);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |