Submission #139341

#TimeUsernameProblemLanguageResultExecution timeMemory
139341MrBrionixArt Class (IOI13_artclass)C++14
Compilation error
0 ms0 KiB
#include <stdio.h> #include<bits/stdc++.h> using namespace std; #include "artclass.h" long double m1,m2,m3; int whi,bl,gr,blu; int cont=0; int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) { for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ m1+=R[i][j]; m2+=G[i][j]; m3+=B[i][j]; if(R[i][j]>200 && G[i][j]>200 && B[i][j]>200)whi++; if(R[i][j]<50 && G[i][j]<50 && B[i][j]<50)bl++; if(G[i][j]>200 && R[i][j]<100 && B[i][j]<100)gr++; if(B[i][j]>200 && R[i][j]<100 && G[i][j]<100)blu++; } } m1/=(long double)(H*W); m2/=(long double)(H*W); m3/=(long double)(H*W); if(m1<90)cont++; if(m2<90)cont++; if(m3<90)cont++; if(whi>=((long double)(H*W*1.0)/8.0))return 1; if(cont==0)return 3; if((whi<10 || whi>(h*w*1.0/25.0)) && (bl<10 || bl>(h*w*1.0/25.0)) && (gr<10 || gr>(h*w*1.0/25.0)) && (blu<10 || blu>(h*w*1.0/25.0)))return 4; //if(gr<7000 && gr>0)return 2; return 2; }

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:43:23: error: 'h' was not declared in this scope
    if((whi<10 || whi>(h*w*1.0/25.0)) && (bl<10 || bl>(h*w*1.0/25.0)) && (gr<10 || gr>(h*w*1.0/25.0)) && (blu<10 || blu>(h*w*1.0/25.0)))return 4;
                       ^
artclass.cpp:43:25: error: 'w' was not declared in this scope
    if((whi<10 || whi>(h*w*1.0/25.0)) && (bl<10 || bl>(h*w*1.0/25.0)) && (gr<10 || gr>(h*w*1.0/25.0)) && (blu<10 || blu>(h*w*1.0/25.0)))return 4;
                         ^