Submission #966711

# Submission time Handle Problem Language Result Execution time Memory
966711 2024-04-20T08:46:48 Z AliHasanli Bold (COCI21_bold) C++17
50 / 50
1 ms 604 KB
#include <iostream>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    char a[n][m];
    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
        cin>>a[i][j];
    for(int i=0;i<n-1;i++)
        for(int j=0;j<m-1;j++)
        {
            if(a[i][j]=='#' && a[i+1][j]=='.')a[i+1][j]='?';
            if(a[i][j]=='#' && a[i+1][j+1]=='.')a[i+1][j+1]='?';
            if(a[i][j]=='#' && a[i][j+1]=='.')a[i][j+1]='?';}
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++)
            if(a[i][j]!='.')cout<<"#";else cout<<".";cout<<endl;}
    return 0;
}

Compilation message

bold.cpp: In function 'int main()':
bold.cpp:18:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   18 |         for(int j=0;j<m;j++)
      |         ^~~
bold.cpp:19:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   19 |             if(a[i][j]!='.')cout<<"#";else cout<<".";cout<<endl;}
      |                                                      ^~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 604 KB Output is correct