版本比较
csp考前集训-数据结构
正文
增加 5 行删除 5 行
50 行未改动51525354555657585962 行未改动1221231241251261271281291307 行未改动13813914014114214314414514611 行未改动15815916016116216316416516675 行未改动24224324424524624724824925058 行未改动50 行未改动Q:记录两个数组,分别为前缀和数组s和前缀和的前缀最大值数组pre插入第n+1个元素:s[n+1]=s[n]+a[n+1],pre[n+1]=max(s[n+1],pre[n])```cpp62 行未改动int main(){ios::sync_with_stdio(false); cin.tie(0);cin >> n >> m;for (int i = 0; i <= n - 1; i++)pos[i] = i;bool f = false;while (m--) {cin >> op >> x;7 行未改动int tmp = pos[n-1];for (int i = n - 1; i > 0; i--)pos[i] = pos[i - 1];pos[0] = tmp;}else {if (!f) {cout << x << endl;11 行未改动return 0;}```## P10288 [GESP样题 八级] 区间```cpp#include<bits/stdc++.h>75 行未改动}int main() {ios::sync_with_stdio(false); cin.tie(0);cin >> n >> m >> q;for (int i = 1; i <= m; i++)cin >> e[i].x >> e[i].y;for (int i = 1; i <= q; i++) {cin >> p[i].s;if (p[i].s == "DELETE") {58 行未改动50 行未改动51525354555657585962 行未改动1221231241251261271281291307 行未改动13813914014114214314414514611 行未改动15815916016116216316416516675 行未改动24224324424524624724824925058 行未改动50 行未改动Q:记录两个数组,分别为前缀和数组s和前缀和的前缀最大值数组pre插入第n+1个元素:s[n+1]=s[n]+a[n+1],pre[n+1]=max(s[n+1],pre[n])```cpp62 行未改动int main(){ios::sync_with_stdio(false); cin.tie(0);cin >> n >> m;for (int i = 0; i <= n - 1; i++)pos[i] = i;bool f = false;while (m--) {cin >> op >> x;7 行未改动int tmp = pos[n-1];for (int i = n - 1; i > 0; i--)pos[i] = pos[i - 1];pos[0] = tmp;}else {if (!f) {cout << x << endl;11 行未改动return 0;}```## P10288 [GESP样题 八级] 区间```cpp#include<bits/stdc++.h>75 行未改动}int main() {ios::sync_with_stdio(false); cin.tie(0);cin >> n >> m >> q;for (int i = 1; i <= m; i++)cin >> e[i].x >> e[i].y;for (int i = 1; i <= q; i++) {cin >> p[i].s;if (p[i].s == "DELETE") {58 行未改动