DP + Priority Queue : O(n*m * log(n*m))
\n\tint kthLargestValue(vector<vector<int>>& a, int k) \n    {\n        int n = a.size();\n        int m = a[0].size();\n        \n        for(int i = 1; i < n;
```\n\tint kthLargestValue(vector<vector<int>>& a, int k) \n    {\n        int n = a.size();\n        int m = a[0].size();\n        \n        for(int i = 1; i < n; i++) a[i][0] ^= a[i - 1][0];\n        for(int j = 1; j < m; j++) a[0][j] ^= a[0][j - 1];\n        \n        for(int i = 1; i < n; i++)\n            for(int j = 1; j < m; j++)\n                a[i][j] ^= (a[i - 1][j] ^ a[i][j - 1] ^ a[i - 1][j - 1]);\n        \n        priority_queue<int> Q;\n        for(auto b : a) for(auto x : b) Q.push(x);\n        \n        int ans = -1;\n        while(!Q.empty() && k--)\n        {\n            ans = Q.top();\n            Q.pop();\n        }\n        \n        return ans;\n    }\n```
[]