Skip to content

Commit

Permalink
Add 31628.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Mar 31, 2024
1 parent c43c727 commit 5be11d0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions 31xxx/31628.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <iostream>
#include <string>
#include <vector>
using namespace std;

bool solve(void) {
vector<vector<string>> v(10, vector<string>(10));
for (int i=0; i<10; i++) for (int j=0; j<10; j++) cin >> v[i][j];

for (int i=0; i<10; i++) {
bool flag = true;
for (int j=1; j<10; j++) if (v[i][j] != v[i][j-1]) flag = false;
if (flag) return true;
flag = true;
for (int j=1; j<10; j++) if (v[j][i] != v[j-1][i]) flag = false;
if (flag) return true;
}
return false;
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

cout << solve();
return 0;
}

0 comments on commit 5be11d0

Please sign in to comment.