Guest User

Untitled

a guest
Nov 21st, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t, n;
  6. cin >> t;
  7. assert(1 <= t && t <= 10);
  8. while(t--) {
  9. cin >> n;
  10. assert(1 <= n && n <= 1000);
  11. vector<int> a(n), b(n);
  12. for(int i = 0; i < n; ++i) {
  13. for(int j = 0; j < n; ++j) {
  14. cin >> a[j];
  15. assert(1 <= a[j] && a[j] <= 100000);
  16. }
  17. sort(a.begin(), a.end());
  18. b[i] = a[n/2];
  19. }
  20. sort(b.begin(), b.end());
  21. cout << b[n/2] << "\n";
  22. }
  23. return 0;
  24. }
Add Comment
Please, Sign In to add comment