Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef pair<ll, ll> pll;
- typedef pair<int, int> pii;
- #define endl "\n"
- const ll INF = 1e15;
- const int MOD = 1e9 + 7;
- const double EPS = 1e-9;
- const double PI = acos(-1.0);
- mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());
- const int N = 1e5 + 5;
- vector<int> G[N];
- ll b, l, d, n[N], t[N], m[N];
- bool vis[N];
- int main() {
- ios::sync_with_stdio(false);
- cin.tie(NULL), cout.tie(NULL);
- cin >> b >> l >> d;
- for (int i = 0; i < b; ++i) {
- cin >> n[i] >> t[i] >> m[i];
- G[i].resize(n[i]);
- for (int j = 0; j < n[i]; ++j)
- cin >> G[i][j];
- }
- vector<int> lib;
- for (int i = 0; i < l; ++i)
- lib.push_back(i);
- shuffle(lib.begin(), lib.end(), rng);
- vector<vector<int>> ans;
- int cur = 0;
- for (int i = 0; i < l; ++i) {
- int idx = lib[i];
- cur += t[idx];
- if (cur > days)
- break;
- ans.push_back(vector<int>());
- sort(G[i].begin(), G[i].end());
- reverse(G[i].begin(), G[i].end());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement