链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=168
模拟即可:
#include <iostream> using namespace std; int sign[200]; int main() { int t; int n; int i; int j; int ans; cin>>t; int a,b,c; while(t--) { cin>>n; ans=0; for(i=0;i<200;i++) sign[i]=0; for(i=0;i<n;i++) { cin>>a>>b>>c; for(j=b;j<b+c;j++) sign[j]+=a; } for(i=0;i<180;i++) { if(ans<sign[i]) ans=sign[i]; } cout<<ans<<endl; } return 0; }