# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9621 | yukariko | Uniting (kriii2_U) | C11 | 12 ms | 1360 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>
int main()
{
int N;
int s[100001];
long long cnt;
long long sum;
int i,j;
cnt = 1;
sum = 0;
scanf("%d",&N);
for(i=0;i<N;i++)scanf("%d",s+i);
for(i=0;i<N-1;i++)
{
sum += s[i]*s[i+1];
s[i+1] += s[i];
cnt = (cnt*(N-i)*(N-i-1))%1000000007;
}
printf("%lld\n",N==1?1:sum);
printf("%lld\n",N==1?0:cnt);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |