Advertisement
rotti321

Untitled

Mar 14th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. pair<int, string> build_sol_with_split(
  5.     const vector<int>& note_real_acolo, const vector<int>& note_uman_real_acolo,
  6.     vector<pair<int, int>> ours, const int how_many_real){
  7.     const int low_grade = (how_many_real == 0 ? -1 : note_real_acolo[how_many_real-1]);
  8.     auto it = partition(begin(ours), end(ours),
  9.         [&](const pair<int, int>& p){ return p.first >= low_grade; });
  10.     if(it-begin(ours) < how_many_real) return make_pair(-1, string(1, '0'));
  11.     sort(begin(ours), it, [](const pair<int, int>& a, const pair<int, int>& b){
  12.         return a.second < b.second; });
  13.     it = begin(ours) + how_many_real;
  14.     sort(it, end(ours), [](const pair<int, int>& a, const pair<int, int>& b){
  15.         return a.second > b.second; });
  16.  
  17.  
  18. }
  19.  
  20. int main()
  21. {
  22.     cout << "Hello world!" << endl;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement