# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9837 | 2014-10-01T13:57:04 Z | effserv | Uniting (kriii2_U) | C++ | 0 ms | 0 KB |
#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; }