# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9837 | effserv | Uniting (kriii2_U) | C++98 | 0 ms | 0 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 <cstdio>
using namespace std;
typedef long long ll;
int main()
{
int N;
scanf_s("%d", &N);
ll a;
scanf_s("%lld", &a);
ll A = (ll)a;
ll C = 0;
for (int i = 0; i < N - 1; i++)
{
scanf_s("%lld", &a);
C += A*a;
A += a;
}
printf("%lld\n0", C);
return 0;
}