Submission #288679

#TimeUsernameProblemLanguageResultExecution timeMemory
288679BasilhijazRectangles (IOI19_rect)C++14
Compilation error
0 ms0 KiB
#include "rect.h"

using namesapce std;

long long count_rectangles(std::vector<std::vector<int> > grid) {
    int n = grid.size();
    int m = grid[0].size();
    int cnt = 0;
    for(int i = 1; i <= n - 2; i++){
        for(int j = 1; j <= m - 2; j++){
            for(int r = 1; r < n - 1; r++){
                if(r + i - 1 >= n - 1)break;
                for(int k = 1; k < m - 1; k++){
                    if(k + j - 1 >= m - 1)break;
                    bool ok = 1;
                    for(int a = r; a <= r + i - 1; a++){
                        if(!ok)break;
                        for(int b = k; b <= k + j - 1; b++){
                            if(grid[a][b] >= grid[r - 1][b] || grid[a][b] >= grid[r + i][b] || grid[a][b] >= grid[a][k - 1] || grid[a][b] >= grid[a][k + j]){
                                ok = 0;
                                break;
                            }
                        }
                    }
                    if(ok){
                        cnt++;
                    }
                }
            }
        }
    }
	return cnt;
}

Compilation message (stderr)

rect.cpp:3:7: error: expected nested-name-specifier before 'namesapce'
    3 | using namesapce std;
      |       ^~~~~~~~~