Submission #201193

#TimeUsernameProblemLanguageResultExecution timeMemory
201193gratus907미술 수업 (IOI13_artclass)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(x) ((x).begin()),((x).end())
using pii = pair <int, int>;

#define colordist(x1,y1,x2,y2) (abs(R[x1][y1]-R[x2][y2])+abs(G[x1][y1]-G[x2][y2])+abs(B[x1][y1]-B[x2][y2]))
int R[505][505],B[505][505],G[505][505];
int style(int H, int W)
{
    double avg_color_dist = 0;
    for (int i = 1; i<H; i++)
    {
        for (int j = 1; j<W; j++)
        {
            double a = colordist(i,j,i-1,j);
            double b = colordist(i,j,i,j-1);
            avg_color_dist += (a+b);
        }
    }
    avg_color_dist /= (H*W);
    if(avg_color_dist < 18) return 4;
    if(avg_color_dist < 47) return 1;
    if(avg_color_dist > 107) return 3;
    return 2;
}

int main()
{
    int h, w;
    cin >> h >> w;
    for (int i = 0; i<h; i++)
    {
        for (int j = 0; j<w; j++)
        {
            cin >> R[i][j];
        }
    }
    for (int i = 0; i<h; i++)
    {
        for (int j = 0; j<w; j++)
        {
            cin >> G[i][j];
        }
    }
    for (int i = 0; i<h; i++)
    {
        for (int j = 0; j<w; j++)
        {
            cin >> B[i][j];
        }
    }
    cout << style(h,w);
}

Compilation message (stderr)

/tmp/ccfNapFP.o: In function `main':
artclass.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccLR1R9M.o:grader.c:(.text.startup+0x0): first defined here
/tmp/ccLR1R9M.o: In function `main':
grader.c:(.text.startup+0x21a): undefined reference to `style'
collect2: error: ld returned 1 exit status