mfgnik

Untitled

May 12th, 2020
1,365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. std::pair<std::vector<int>, std::vector<std::pair<int, int>>>
  2. ReadGoldAndTrusts(std::istream &in_stream) {
  3.     int people_amount, trusts_amount;
  4.     std::vector<int> golds;
  5.     std::vector<std::pair<int, int>> trusts;
  6.     in_stream >> people_amount >> trusts_amount;
  7.     golds.resize(people_amount);
  8.     for (auto &person : golds) {
  9.         in_stream >> person;
  10.     }
  11.     trusts.resize(trusts_amount);
  12.     for (auto &[from, to] : trusts) {
  13.         in_stream >> from >> to;
  14.     }
  15.     return {golds, trusts};
  16. }
Advertisement
Add Comment
Please, Sign In to add comment