Test Instructions: ∑100i=1i2− (∑100i=1i) 2 \sum_{i = 1} ^ {100}i^2-(\sum _ {i = 1} ^ {100}i) ^2
Analysis: There are still two ways to consider.
1. Violence seeks out two values.
2. The previous one equals n (n+1) (2n+1) 6 \frac{n (n + 1) (2n + 1)}{6}, and the latter Equals (n (n+1) 2) 2 \left (\frac{n (n + 1)}{2}\right) ^2.
#include <bits/stdc++.h> #define LL Long long #define PII std::p air<int,int> #define MP Std::make_pair #defi Ne fi first #define SE second #define SZ (x) (int) (x). Size () #define PB push_back template<class t>inline void chkm Ax (t &x, const T &y) {if (x < y) x = y;} template<class t>inline void Chkmin (t &x, const T &y) {if
(x > Y) x = y;}
Template<class t> inline void read (T &x) {char C;int f = 1;x = 0;
while ((C=getchar () < ' 0 ' | | c > ' 9 ') && c! = '-');
if (c = = '-') F = -1;else x = C ' 0 ';
while ((C=getchar ()) >= ' 0 ' && C <= ' 9 ') x = x*10+c-' 0 ';
x *= F;
} static int outn;
static char out[(int) 2e7];
Template<class t> inline void Write (T x) {if (x < 0) out[outn++] = '-', x =-X;
if (x) {static int tmpn;
static Char tmp[20];
TMPN = 0;
while (x) tmp[tmpn++] = x%10+ ' 0 ', x/= 10;
while (TMPN) out[outn++] = Tmp[--tmpn]; } else Out[outn++] = ' 0 ';
} int C1 (int n) {return n * (n + 1) * (2 * n + 1)/6;}
int C2 (int n) {return n * n * (n + 1) * (n + 1)/4;}
int main () {printf ("%d\n", C2 (+)-C1 (100));
return 0;
}