Advertisement
OMEGAHEAD_MonkoX

1XBet

Dec 9th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.87 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. #include <sstream>
  5. #include <algorithm>
  6. #include <vector>
  7. #include <stdlib.h>
  8. #include <stdio.h>
  9. #include <fstream>
  10. #include <stack>
  11. #include <map>
  12. #include <cstring>
  13. #include <cmath>
  14.  
  15. using namespace std;
  16.  
  17. int main()
  18. {
  19.     int i, j, a, k, MonkoX, omegahead, n , b, c, d, Twohead;
  20.     bool NextStep;
  21.     cin >> k >> n;
  22.     vector<int> Race(k);
  23.     vector<int>::iterator aFind, bFind, cFind, dFind, Iterator;
  24.     vector <vector<int> > HSBGPuckichTop(n);
  25.     vector <vector<int> >::iterator iter;
  26.  
  27.     for (i = 0; i != n; i++)
  28.     {
  29.         cin >> a >> b >> c >> d;
  30.         HSBGPuckichTop[i].push_back(a);
  31.         HSBGPuckichTop[i].push_back(b);
  32.         HSBGPuckichTop[i].push_back(c);
  33.         HSBGPuckichTop[i].push_back(d);
  34.     }
  35.     for (i = 0; i < k; i++)
  36.         Race[i] = i + 1;
  37.     if (k > 1)
  38.     {
  39.          do{
  40.             i = 0;
  41.             NextStep = false;
  42.             while ((i < n) & (NextStep == false))
  43.             {
  44.                 aFind = find(Race.begin(), Race.end(), HSBGPuckichTop[i][0]);
  45.                 bFind = find(Race.begin(), Race.end(), HSBGPuckichTop[i][1]);
  46.                 cFind = find(Race.begin(), Race.end(), HSBGPuckichTop[i][2]);
  47.                 dFind = find(Race.begin(), Race.end(), HSBGPuckichTop[i][3]);
  48.                 if(((aFind < bFind) & (cFind >= dFind)) || ((aFind >= bFind) & (cFind < dFind)))
  49.                     i++;
  50.                 else
  51.                     NextStep = 1;
  52.              }
  53.              if (NextStep == false)
  54.              {
  55.                 for (auto Iterator1 = Race.begin(); Iterator1 != Race.end(); Iterator1++)
  56.                     cout << *Iterator1 << " ";
  57.                 cout << endl;
  58.                 return 0;
  59.              }
  60.         }while(next_permutation(Race.begin(), Race.end()) );
  61.     }
  62.     cout << 0;
  63.     return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement