Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
36231 | yinzihe | 【S】T2 | C++ | 解答错误 | 91 | 327 MS | 4184 KB | 763 | 2025-02-10 14:39:37 |
#include<bits/stdc++.h>//60 #define int long long using namespace std; const int N=100010; int n,m,ans; int b[N],res; struct node{ int x1,y1,x2,y2; }p[N]; void solve() { cin>>n>>m; for(int i=1;i<=n;i++) b[i]=0; for(int i=1;i<=m;i++) cin>>p[i].x1>>p[i].y1>>p[i].x2>>p[i].y2; for(int i=1;i<=m;i++) { int x1=p[i].x1,y1=p[i].y1,x2=p[i].x2,y2=p[i].y2; b[x1]=max(b[x1],y1); b[x2]=max(b[x2],y2); } int ans=0; for(int i=1;i<=n;i++) ans+=b[i]; cout<<ans<<'\n'; } signed main() { //freopen("max.in","r",stdin); //freopen("max.out","w",stdout); ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); int T; cin>>T; while(T--) solve(); return 0; }