Advertisement
PikMike

Untitled

Feb 21st, 2017
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. int calc(int n){
  2.     set<int> cur;
  3.     fore(i, n / 2, n)
  4.         cur.insert(gr[i]);
  5.     fore(i, 1, (*cur.rbegin()) + 2)
  6.         if (cur.find(i) == cur.end())
  7.             return i;
  8.     return 0;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement