Advertisement
Ali-ElMasry

Untitled

Feb 20th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.14 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. typedef long long ll;
  6. typedef pair<ll, ll> pll;
  7. typedef pair<int, int> pii;
  8.  
  9. #define endl "\n"
  10.  
  11. const ll INF = 1e15;
  12. const int MOD = 1e9 + 7;
  13. const double EPS = 1e-9;
  14. const double PI = acos(-1.0);
  15.  
  16. mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());
  17.  
  18. const int N = 1e5 + 5;
  19.  
  20. vector<int> G[N];
  21. ll b, l, d, n[N], t[N], m[N];
  22.  
  23. bool vis[N];
  24.  
  25. int main() {
  26.     ios::sync_with_stdio(false);
  27.     cin.tie(NULL), cout.tie(NULL);
  28.  
  29.     cin >> b >> l >> d;
  30.  
  31.     for (int i = 0; i < b; ++i) {
  32.         cin >> n[i] >> t[i] >> m[i];
  33.         G[i].resize(n[i]);
  34.         for (int j = 0; j < n[i]; ++j)
  35.             cin >> G[i][j];
  36.     }
  37.  
  38.     vector<int> lib;
  39.     for (int i = 0; i < l; ++i)
  40.         lib.push_back(i);
  41.  
  42.     shuffle(lib.begin(), lib.end(), rng);
  43.  
  44.     vector<vector<int>> ans;
  45.     int cur = 0;
  46.     for (int i = 0; i < l; ++i) {
  47.         int idx = lib[i];
  48.         cur += t[idx];
  49.         if (cur > days)
  50.             break;
  51.  
  52.         ans.push_back(vector<int>());
  53.  
  54.         sort(G[i].begin(), G[i].end());
  55.         reverse(G[i].begin(), G[i].end());
  56.  
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement