求助NOIP T4性质B
  • 板块学术版
  • 楼主mutan
  • 当前回复3
  • 已保存回复3
  • 发布时间2023/11/19 11:21
  • 上次更新2023/11/19 13:45:05
查看原帖
求助NOIP T4性质B
749371
mutan楼主2023/11/19 11:21

性质 B 是代表活动之间不会冲突吗?

那我的骗分能骗到吗?

#include <bits/stdc++.h>

#define ll long long 
using namespace std;
#define _DEBUG114514_
constexpr int MAXN = 100000;
int arr[MAXN+2];
bool vis[MAXN+2];
inline void fastio()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}



int main()
{
	int i,j,c,t;
	int n,m,k,d;
	int x,y,v;
	ll ans = 0;
	char op;
	
	#ifndef _DEBUG114514_
	freopen("run.in","r",stdin);
	freopen("run.out","w",stdout);
	#endif
	fastio();
	
	cin>>c>>t;
	while(t--) {
		cin>>n>>m>>k>>d;
		for(i=0;i<m;i++) {
			cin>>x>>y>>v;
			if(x-y <= k && (x-y)*d < v) //天数不超限制,且收益大于付出
			ans+=v-(x-y)*d;
		}
	}
	
	cout<<ans<<endl;
	#ifndef _DEBUG114514_
	fclose(stdin);
	fclose(stdout);
	#endif
}
2023/11/19 11:21
加载中...