Advertisement
Guest User

backpack 1

a guest
May 23rd, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. int getBackpackMoney(unsigned int n, unsigned int m, vector<int>& objects, vector<int>& coins)
  9. {
  10.     // code here
  11. }
  12.  
  13. int main()
  14. {
  15.     vector<int> objects = vector<int>();
  16.     vector<int> coins = vector<int>();
  17.  
  18.     unsigned int n, m, a;
  19.     int res;
  20.  
  21.     fstream fin;
  22.     fin.open("input.txt", ios::in);
  23.     if (fin.is_open())
  24.     {
  25.         fin >> n >> m;
  26.  
  27.         for (int i = 0; i < n; ++i)
  28.         {
  29.             fin >> a;
  30.             objects.push_back(a);
  31.         }
  32.  
  33.         for (int i = 0; i < n; ++i)
  34.         {
  35.             fin >> a;
  36.             coins.push_back(a);
  37.         }
  38.  
  39.         fin.close();
  40.     }
  41.  
  42.     res = getBackpackMoney(n, m, objects, coins);
  43.  
  44.     fstream fout;
  45.     fout.open("output.txt", ios::out);
  46.     fout << res;
  47.     fout.close();
  48.  
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement