Submission
Status:
[PPPPTSSSSSSSSSSSSSSS]
Subtask/Task Score:
{0/100}
Score: 0
User: Krovmoroz
Problemset: ฮีโร่และมอนสเตอร์
Language: cpp
Time: 1.093 second
Submitted On: 2026-01-16 22:47:56
#include <bits/stdc++.h>
using namespace std;
int N,M;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
cin >> N >> M;
vector<int> hero(N);
for (auto &x : hero) cin >> x;
vector<pair<int,int>> mons(M);
for (auto &x : mons) cin >> x.first >> x.second;
for (auto &x : hero) {
long long c = 0;
for (auto &y : mons) if (x >= y.first) c += y.second;
cout << c << '\n';
}
return 0;
}