제출 #396394

#제출 시각아이디문제언어결과실행 시간메모리
396394Kenzo_1114미술 수업 (IOI13_artclass)C++17
7 / 100
86 ms6084 KiB
#include<bits/stdc++.h>
#include"artclass.h"
using namespace std;
const int MAXN = 500;
const int MAXC = 260;

int style(int H, int W, int R[500][500], int G[500][500], int B[500][500])
{
	int ans = 0, T = 0;

	for(int i = 0; i < H; i++)
		for(int j = 0; j < W; j++)
		{
			int r = R[i][j];
			int g = G[i][j];
			int b = B[i][j];

			if(j)
			{
				int r2 = R[i][j - 1];
				int g2 = G[i][j - 1];
				int b2 = B[i][j - 1];

				if(abs(r - r2) + abs(g - g2) + abs(b - b2) <= 30)	continue;
			}

			if(i)
			{
				int r2 = R[i - 1][j];
				int g2 = G[i - 1][j];
				int b2 = B[i - 1][j];

				if(abs(r - r2) + abs(g - g2) + abs(b - b2) <= 30)	continue;
			}

			++T;
		}

	if(T <= 700)	return 4;
	return rand() % 3 + 1;
}

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

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:9:6: warning: unused variable 'ans' [-Wunused-variable]
    9 |  int ans = 0, T = 0;
      |      ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...