Submission #7419

#TimeUsernameProblemLanguageResultExecution timeMemory
7419kriii미술 수업 (IOI13_artclass)C++98
8 / 100
157 ms3964 KiB
#include "artclass.h"

#include <stdio.h>

int Color[64][64][64];
int Change_X[8]={1, 0, 0, -1, 0, 0};
int Change_Y[8]={0, 1, 0, 0, -1, 0};
int Change_Z[8]={0, 0, 1, 0, 0, -1};
int Change[3]  ={1, 0, -1};

int rand1[2] ={1, 4}, rand1check;
int rand2[2] ={2, 3}, rand2check;

int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {

    for(int i=0; i<H; i++) for(int j=0; j<W; j++) {
        int nowr=R[i][j], nowg=G[i][j], nowb=B[i][j];
        Color[nowr/8][nowg/8][nowb/8]++;
        /*
        for(int k1=0; k1<3; k1++) for(int k2=0; k2<3; k2++) for(int k3=0; k3<3; k3++) {
            int newr = nowr/8 + Change_X[k1];
            int newg = nowg/8 + Change_Y[k2];
            int newb = nowb/8 + Change_Z[k3];
            if(newr>=0 && newg>=0 && newb>=0)
                Color[newr][newg][newb]++;
        }
        */
        /*
        for(int k=0; k<6; k++) {
            int newr = nowr/8 + Change_X[k];
            int newg = nowg/8 + Change_Y[k];
            int newb = nowb/8 + Change_Z[k];
            if(newr>=0 && newg>=0 && newb>=0)
                Color[newr][newg][newb]++;
        }*/
    }
    int cnt=0;
    for(int i=0; i<32; i++) for(int j=0; j<32; j++) for(int k=0; k<32; k++) {
        if( (double)Color[i][j][k]/H/W*100. < 2) {
            Color[i][j][k]=0;
            continue;
        }
//        printf("%2d %2d %2d : %lf\n", i, j, k, (double)Color[i][j][k]/H/W*100.);
        Color[i][j][k]=0;
        cnt++;
    }
    if(cnt>=3) {
        rand1check = 1 - rand1check;
        return rand1[rand1check];
    }else{
        rand2check = 1 - rand2check;
        return rand2[rand2check];
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...