Advertisement
Guest User

Untitled

a guest
Dec 29th, 2019
2,797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. ios_base::sync_with_stdio(0);
  7. cin.tie(nullptr);
  8.  
  9. int n, k;
  10. cin>>n>>k;
  11. vector<int> elements;
  12. for (int i = 1; i<=k+1; i++)
  13. {
  14. cout<<"? ";
  15.  
  16. for (int j = 1; j<=k+1; j++) if (j!=i) cout<<j<<' ';
  17. cout<<endl;
  18.  
  19. int pos, el;
  20. cin>>pos>>el;
  21. elements.push_back(el);
  22. }
  23. int maxx = elements[0];
  24. for (auto it: elements) maxx = max(maxx, it);
  25. int m = 0;
  26. for (auto it: elements) if (it==maxx) m++;
  27. cout<<"! "<<m<<endl;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement