Submission #147481

#TimeUsernameProblemLanguageResultExecution timeMemory
147481mosiashvililukaRectangles (IOI19_rect)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; long long a,b,f[2509][2509],pas; void rec(){ for(register int c=1; c<a; c++){ for(register int d=1; d<b; d++){ for(register int e=c; e<a; e++){ for(register int z=d; z<b; z++){ bool bo=0; for(register int x=c; x<=e; x++){ if(dp[x][d][z]==0){ bo=1;break; } } if(bo==0){ for(register int x=d; x<=z; x++){ if(dp2[c][x][e]==0){ bo=1;break; } } if(bo==0) pas++; } } } } } } long long c,d,e,z,x; bool dp[702][702][702],dp2[702][702][702]; long long count_rectangles(vector <vector <int> > A){ a=A.size(); b=A[0].size(); a--;b--; for(c=0; c<=a; c++) for(d=0; d<=b; d++) f[c][d]=A[c][d]; if(a==2){ for(c=1; c<b; c++){ z=0; for(d=c; d<b; d++){ if(z<f[1][d]) z=f[1][d]; if(z>=f[1][c-1]||f[1][d]>=f[0][d]||f[1][d]>=f[2][d]) break; if(z<f[1][d+1]) pas++; } } return pas; } for(c=1; c<a; c++){ for(d=1; d<b; d++){ z=0; for(e=d; e<b; e++){ if(z<f[c][e]) z=f[c][e]; if(z>=f[c][d-1]) break; if(z<f[c][e+1]){ dp[c][d][e]=1; } } } } for(c=1; c<a; c++){ for(d=1; d<b; d++){ z=0; for(e=c; e<a; e++){ if(z<f[e][d]) z=f[e][d]; if(z>=f[c-1][d]) break; if(z<f[e+1][d]) dp2[c][d][e]=1; } } } // cout<<dp[2][1][1]<<endl; rec(); return pas; }

Compilation message (stderr)

rect.cpp: In function 'void rec()':
rect.cpp:11:10: error: 'dp' was not declared in this scope
       if(dp[x][d][z]==0){
          ^~
rect.cpp:11:10: note: suggested alternative: 'd'
       if(dp[x][d][z]==0){
          ^~
          d
rect.cpp:17:11: error: 'dp2' was not declared in this scope
        if(dp2[c][x][e]==0){
           ^~~