个人介绍
增加 13 行删除 39 行
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849288 行未改动全部展开https://cityquiz.io/quizzes/china/2999926https://monocalc.com/tool/programming/brainfuck_interpreter复赛pdf https://cnoi.mrpython.top/自家MC服务器域名 frp-sun.com:10856```cpp#include <bits/stdc++.h>using namespace std;const int maxn = 2e5 + 5;long long n, sum, ans;long long a[maxn];int main(){cin >> n;for (int i = 1; i <= n; ++i){cin >> a[i];sum += a[i];}if (sum % n != 0){cout << -1;return 0;}sum /= n;for (int i = 1; i < n; ++i){if (a[i] < sum){cout << -1;return 0;}long long x = a[i] - sum;a[i] = sum;a[i + 1] += x;ans += x;}cout << ans;return 0;}```### 线段树模板```cpp//P3372 【模板】线段树#include <bits/stdc++.h>288 行未改动全部展开1234567891011121314151617181920212223288 行未改动全部展开tw教育局 https://www.moe.gov.tw/Default.aspxtw字典 https://dict.mini.moe.edu.tw/神秘oj https://oj.fanplus.top神秘 https://cityquiz.io/quizzes/china/2999926BF 编译器https://monocalc.com/tool/programming/brainfuck_interpreter复赛pdf https://cnoi.mrpython.top/內網穿透 https://natfrp.com https://frp.onevPn節點 https://小黑子.xyz字体大全 https://www.100font.com/ Maruko https://github.com/max32002/maruko-gothic自家MC服务器域名 frp-oak.com:10856### 线段树模板```cpp//P3372 【模板】线段树#include <bits/stdc++.h>288 行未改动全部展开