Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
- #define X first
- #define Y second
- #define Push push_back
- #define ALL(x) x.begin(), x.end()
- using lli = long long;
- using pll = pair<lli, lli>;
- using Double = long double;
- template<typename T>
- using Vector = vector<vector<T>>;
- template<typename T>
- using prior = priority_queue<T>;
- int main() {
- IOS;
- int n, m;
- cin >> n >> m;
- vector<string> mp(n);
- for (auto &x : mp) cin >> x;
- vector<int> row(n, 0), col(m, 0), ls(n + m - 1, 0), rs(n + m - 1, 0);
- for (int i = 0; i < n; ++i) {
- for (int j = 0; j < m; ++j) {
- if (mp[i][j] == 'x') {
- ++row[i];
- ++col[j];
- ++ls[i + m - 1 - j];
- ++rs[i + j];
- }
- }
- }
- for (int i = 0; i < n; ++i) {
- for (int j = 0; j < m; ++j) {
- if (mp[i][j] == 'x') {
- if (row[i] > 1 or col[j] > 1 or ls[i + m - 1 - j] > 1 or rs[i + j] > 1) {
- cout << '(' << i << ',' << j << ')';
- }
- }
- }
- }
- cout << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement