fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <vector>
  5. using namespace std;
  6. #define SZ(a) (int)(a).size()
  7. typedef long long ll;
  8. typedef unsigned int uint;
  9.  
  10. int main() {
  11. cin.sync_with_stdio(false);
  12. int n;
  13. cin >> n;
  14. auto a = vector<int>(n, ~(1u<<31));
  15. for (auto i = 0; i < n; i++) {
  16. for (auto j = 0; j < n; j++) {
  17. int x;
  18. cin >> x;
  19. a[i] &= x;
  20. a[j] &= x;
  21. }
  22. }
  23. for (auto i = 0; i < n; i++) {
  24. printf("%d%c", a[i], " \n"[i == n-1]);
  25. }
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty