제출 #869114

#제출 시각아이디문제언어결과실행 시간메모리
869114normankr07미술 수업 (IOI13_artclass)C++17
87 / 100
50 ms3668 KiB
#include "artclass.h"
#include <bits/stdc++.h>

int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
    long long ans = 0;
    for (int x = 0; x < H; x++)
        for (int y = 0; y < W - 1; y++)
        {
            int RR = abs(R[x][y] - R[x][y + 1]);
            int GG = abs(G[x][y] - G[x][y + 1]);
            int BB = abs(B[x][y] - B[x][y + 1]);
            ans += (RR + GG + BB);
        }
    ans /= (H * (W - 1));
    // std::cerr << "inf: " << ans << '\n';
    if (ans <= 8)
        return 4;
    if (ans <= 30)
        return 1;
    if (ans <= 53)
        return 2;
    if (ans <= 120)
        return 3;
}

컴파일 시 표준 에러 (stderr) 메시지

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...