Submission #426795

#TimeUsernameProblemLanguageResultExecution timeMemory
426795dreezyRectangles (IOI19_rect)C++17
Compilation error
0 ms0 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; long long count_rectangles(vector<vector<int> > a) { int n = a.size(); int m = a[0].size(); ll ans = 0; for(int i =1; i<n-1 ;i++){ for(int j =1 ;j <m-1; j++){ int cnt = 0; if(a[i-1][j] < a[i][j]) cnt++; if(a[i+1][j] < a[i][j]) cnt++; if(a[i][j-1] < a[i][j]) cnt++ if(a[i][j+1] < a[i][j]) cnt++; if(cnt == 4) ans++; } } return an; } /************/

Compilation message (stderr)

rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:12:2: error: 'll' was not declared in this scope
   12 |  ll ans = 0;
      |  ^~
rect.cpp:21:10: error: expected ';' before 'if'
   21 |     cnt++
      |          ^
      |          ;
   22 |    if(a[i][j+1] < a[i][j])
      |    ~~     
rect.cpp:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     ans++;
      |     ^~~
      |     abs
rect.cpp:28:9: error: 'an' was not declared in this scope; did you mean 'n'?
   28 |  return an;
      |         ^~
      |         n