Submission #418407

#TimeUsernameProblemLanguageResultExecution timeMemory
418407jasminRectangles (IOI19_rect)C++14
Compilation error
0 ms0 KiB
#include "rect.h"
using namespace std;
#define int long long

int count_rectangles(vector<vector<int> > r){
    int n=r.size(); int m=r[0].size();
    if(n!=3) return 1;

    int ans=0;
    for(int i=1; i<m-1; i++){
        int maxi=0;
        for(int j=i; j<m-1; j++){
            maxi=max(maxi, r[1][j]);
            if(r[0][j]<=r[1][j] || r[2][j]<=r[1][j]) break;
            if(r[1][i-1]>maxi && r[1][j+1]>maxi){
                ans++;
            }
        }
    }
    return ans;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccluEabX.o: in function `main':
grader.cpp:(.text.startup+0x6fa): undefined reference to `count_rectangles(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
collect2: error: ld returned 1 exit status