You are viewing a single comment's thread. Return to all comments →
Using C++
int main(){ int n; cin >> n; vector grid(n); for(int i = 0; i < n; i++){ cin >> grid[i]; } std::string::iterator it,jt1,jt2; int c=0; char temp; for(int i = 1; i < n-1; i++) { c=0; int d=0,e=0; for (it=grid[i].begin(); it!=grid[i].end(); it++) { c++; if(c>1 && c*jt1) {
for(jt2=grid[i+1].begin(); jt2!=grid[i+1].end(); jt2++) { e++; if(e==c) { if(temp>*jt2) temp='X'; } } } } } } *it=temp; } } } for(int i = 0; i < n; i++) cout<< grid[i]<<endl; return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Cavity Map
You are viewing a single comment's thread. Return to all comments →
Using C++
int main(){ int n; cin >> n; vector grid(n); for(int i = 0; i < n; i++){ cin >> grid[i]; } std::string::iterator it,jt1,jt2; int c=0; char temp; for(int i = 1; i < n-1; i++) { c=0; int d=0,e=0; for (it=grid[i].begin(); it!=grid[i].end(); it++) { c++; if(c>1 && c*jt1) {
}