|
|
back to boardWA #8 please help Really dont know what the mistake??? int main() { char src[1405][1405]; int n; cin >> n; for(int i = 0; i < n; i++) { for(int z = 0; z < n; z++) { cin >> src[i][z]; } } int s = 0, S = 0; for(int i = 0; i < n; i++) { int tmps = 0, tmpS = 0; for(int z = 0; z < n; z++) { if(src[i][z] == 's') { tmps++; s = max(s, tmps); tmpS = 0; } else { tmpS++; S = max(S, tmpS); tmps = 0; } } } for(int i = 0; i < n; i++) { int tmps = 0, tmpS = 0; for(int z = 0; z < n; z++) { if(src[z][i] == 's') { tmps++; s = max(s, tmps); tmpS = 0; } else { tmpS++; S = max(S, tmpS); tmps = 0; } } } for(int i = 0; i < n; i++) { int tmps = 0, tmpS = 0; for(int z = 0; z <= i; z++) { if(src[i - z][z] == 's') { tmps++; s = max(s, tmps); tmpS = 0; } else { tmpS++; S = max(S, tmpS); tmps = 0; } } } for(int i = 0; i < n; i++) { int tmps = 0, tmpS = 0; for(int z = i; z < n; z++) { if(src[z][z - i] == 's') { tmps++; s = max(s, tmps); tmpS = 0; } else { tmpS++; S = max(S, tmpS); tmps = 0; } } } if(s > S) { cout << "s\n" << s; } else if(s < S) { cout << "S\n" << S; } else { cout << "?\n" << s; } } |
|
|