Submission #206968

#TimeUsernameProblemLanguageResultExecution timeMemory
206968okoArt Class (IOI13_artclass)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "artclass.h"
using namespace std;
const long long mod=1e9+7;

int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
    int n=H,m=W;
    sum=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            sum+=(R[i][j]-R[i][j-1])+(R[i][j]-R[i-1][j])+(B[i][j]-B[i][j-1])+(B[i][j]-B[i-1][j])+(G[i][j]-G[i][j-1])+(G[i][j]-G[i-1][j]);
        }
    }
    sum/=n*m;
    if(sum<=25)return 4;
    if(sum>=100)return 3;
    if(sum>=50)return 1;
    return 1;
}

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:9:5: error: 'sum' was not declared in this scope
     sum=0;
     ^~~