题解:P14574 批话哥
P14574 题解
题目传送门
直接模拟,初始设置每个人的分数为
Code
#include <bits/stdc++.h>
using namespace std;
#define FILE(x) freopen(x".in", "r", stdin);freopen(x".out", "w", stdout);
int n, m, k, l, r, ans[501];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int x, y, v;
cin >> n >> m >> k >> l >> r;
while (k--){
cin >> x >> y >> v;
if (v <= l){
ans[x] += 100;
} else if (v < r){
ans[x] += v;
}
}
for (int i = 1; i <= n; i++){
cout << ans[i] << " ";
}
return 0;
}