Submission #464699

# Submission time Handle Problem Language Result Execution time Memory
464699 2021-08-13T18:01:26 Z soba Strah (COCI18_strah) C++14
22 / 110
1000 ms 384 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 10000+1;

int n ,m , x;
vector<int>v1 , v2;

int main() {

    char arr[20][20];
    int n , m ;
    int a[20][20]={0};
    cin >> n >> m;
    for(int i = 0 ; i< n ; i++)
    {
        for(int j = 0 ; j < m ;j++)
        {
            cin >> arr[i][j];
        }
    }
    int ans=0;
    for(int i = 0 ; i< n ; i++)
    {
        for(int j = 0 ; j < m ;j++)
        {
            for(int k = i ; k < n ; k++ )
            {
                for(int l = j ; l < m ; l++)
                {
                    int num=0 , ex=0;
                    for(int x = i ; x <= k ; x++)
                    {

                        for(int y = j ;  y <= l ; y++)
                        {
                            if(arr[x][y]=='.')
                            {
                                num++;
                            }
                            else ex++;
                        }
                        //cout << i << " " << j << " " << k << " " << l << " = " << num << " " << ex <

                    }
                    if(ex==0)ans+=num;
                }

            }
        }
    }
    cout << ans;
    return 0;
}

Compilation message

strah.cpp: In function 'int main()':
strah.cpp:13:9: warning: unused variable 'a' [-Wunused-variable]
   13 |     int a[20][20]={0};
      |         ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1092 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 18 ms 312 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 11 ms 384 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 16 ms 288 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -