제출 #383631

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
3836312021-03-30 12:27:33alireza_kaviani미술 수업 (IOI13_artclass)C++11
96 / 100
68 ms3436 KiB
#include <bits/stdc++.h>
#include "artclass.h"
using namespace std;
int cntR[256] , cntG[256] , cntB[256];
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
int r = 0 , g = 0 , b = 0;
int mnr = 500 , mxr = 0 , mng = 500 , mxg = 0 , mnb = 500 , mxb = 0;
for(int i = 0 ; i < H ; i++){
for(int j = 0 ; j < W ; j++){
r += R[i][j];
cntR[R[i][j]]++;
mnr = min(mnr , R[i][j]); mxr = max(mxr , R[i][j]);
g += G[i][j];
cntG[G[i][j]]++;
mng = min(mng , G[i][j]); mxg = max(mxg , G[i][j]);
b += B[i][j];
cntB[B[i][j]]++;
mnb = min(mnb , B[i][j]); mxb = max(mxb , B[i][j]);
}
}
long long diff = 0 , diff2 = 0;
for(int i = 1 ; i < H ; i++){
for(int j = 0 ; j < W ; j++){
diff += abs(R[i][j] - R[i - 1][j]);
diff += abs(G[i][j] - G[i - 1][j]);
diff += abs(B[i][j] - B[i - 1][j]);
diff2 += (R[i][j] - R[i - 1][j]) * (R[i][j] - R[i - 1][j]);
diff2 += (G[i][j] - G[i - 1][j]) * (G[i][j] - G[i - 1][j]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...