个人介绍
增加 113 行删除 0 行
61 行未改动6263646561 行未改动}return 0;}```61 行未改动626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717861 行未改动}return 0;}``````cpp#include <bits/stdc++.h>using namespace std;//#define int long longconst int N = 2e5+10;int n,cnt;int dfn[N],pre[N],siz[N],dep[N],fa[N],son[N],top[N];vector<int> e[N];struct Tree {int l,r;int sum,mn,mx;int tag;}tr[N<<2];void dfs1(int u,int f) {siz[u] = 1,dep[u] = dep[f]+1,fa[u] = f;for (auto v : e[u]) {if (v == fa) continue;dfs1(v,u);siz[u] += siz[v];if (siz[v] > siz[son[u]]) son[u] = v;}}void dfs2(int u,int tp) {dfn[u] = ++cnt,pre[low] = u;top[u] = tp;if (son[u]) dfs2(son[u],tp);for (auto v : e[u]) {if (v == fa[u] || v == son[u]) continue;dfs2(v,v);}}signed main() {// freopen(".in","r",stdin);// freopen(".out","w",stdout);ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cin >> n;for (int i = 1;i < n;i ++) {int u,v,w;cin >> u >> v >> w;e[u].push_back(v);e[v].push_back(u);}dfs1(1,0);dfs2(1,1);int m;cin >> m;while (m --) {string s;int a,b;cin >> s >> a >> b;if (s == "C") {}else if (s == "N") {}else if (s == "SUM") {}else if (s == "MAX") {}else {}}return 0;}`````` cpp#include <bits/stdc++.h>using namespace std;//#define int long longconst int N = 1e6+10;int n,m,t;vector<int> a[N],d[N],col[N];signed main() {freopen("water4.in","r",stdin);freopen("water.out","w",stdout);ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cin >> n >> m >> t;for (int i = 0;i <= n+1;i ++) {a[i].resize(m+1);for (int j = 0;j <= m+1;j ++) a[i][j] = 0;d[i].resize(m+2);col[i].resize(m+2);for (int j = 0;j <= m+2;j ++) d[i][j] = col[i][j] = 0;}for (int i = 1;i <= n;i ++)for (int j = 1;j <= m;j ++)cin >> a[i][j];for (int i = 1;i <= t;i ++) {int x1,y1,x2,y2;cin >> x1 >> y1 >> x2 >> y2;d[x1][y1] ++,d[x1][y2+1] --,d[x2+1][y1] --,d[x2+1][y2+1] ++;col[x1][y1] += i,col[x1][y2+1] -= i,col[x2+1][y1] -= i,col[x2+1][y2+1] += i;}for (int i = 1;i <= n;i ++) {for (int j = 1;j <= m;j ++) {d[i][j] += d[i-1][j]+d[i][j-1]-d[i-1][j-1];col[i][j] += col[i-1][j]+col[i][j-1]-col[i-1][j-1];}}// for (int i = 1;i <= n;i ++) {// for (int j = 1;j <= m;j ++) cerr << d[i][j] << ' ';// cerr << '\n';// }// for (int i = 1;i <= n;i ++) {// for (int j = 1;j <= m;j ++) cerr << col[i][j] << ' ';// cerr << '\n';// }int ans = 0;for (int i = 1;i <= n;i ++)for (int j = 1;j <= m;j ++)if (col[i][j] == 0 || (d[i][j] == 1 && a[i][j] == col[i][j]))ans ++;cout << n*m-ans;return 0;}```