# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
139271 | MrBrionix | 미술 수업 (IOI13_artclass) | C++14 | 76 ms | 3452 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include<bits/stdc++.h>
using namespace std;
#include "artclass.h"
long double m1,m2,m3;
int whi,bl,gr;
int cont=0;
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++){
m1+=R[i][j];
m2+=G[i][j];
m3+=B[i][j];
if(R[i][j]>200 && G[i][j]>200 && B[i][j]>200)whi++;
if(R[i][j]<50 && G[i][j]<50 && B[i][j]<50)bl++;
if(G[i][j]>200 && R[i][j]<100 && B[i][j]<100)gr++;
}
}
m1/=(long double)(H*W);
m2/=(long double)(H*W);
m3/=(long double)(H*W);
if(whi>=((long double)(H*W*1.0)/8.0))return 1;
if(m1<90)cont++;
if(m2<90)cont++;
if(m3<90)cont++;
if(gr>0 && gr<7000 && whi<20)return 2;
return 4;
if(cont>=1)return 4;
return 3;
}
/*
static int DIM[2];
static int R[500][500];
static int G[500][500];
static int B[500][500];
int main() {
FILE *in = fopen("artclass.txt", "r");
if(in == NULL) {
puts("Failed to open input file (artclass.txt).");
return 0;
}
if(fscanf(in, "%d%d", DIM, DIM+1) != 2) {
printf("Line 1: H, W must be integers\n");
return 0;
}
if(DIM[0] < 100 || 500 < DIM[0]) {
printf("Line 1: 100 <= H <= 500\n");
return 0;
}
if(DIM[1] < 100 || 500 < DIM[1]) {
printf("Line 1: 100 <= W <= 500\n");
return 0;
}
for(int i = 0; i< DIM[0]; i++) {
for(int j = 0; j < DIM[1]; j++) {
if(fscanf(in, "%d%d%d", &R[i][j], &G[i][j], &B[i][j]) != 3) {
printf("Line %d: R[i][j], G[i][j], B[i][j] must be integers", i*DIM[1]+j+2, i, j);
return 0;
}
if(R[i][j] < 0 || 255 < R[i][j]) {
printf("Line %d: 0 <= R[%d][%d] <= 255", i*DIM[1]+j+2, i, j);
return 0;
}
if(G[i][j] < 0 || 255 < G[i][j]) {
printf("Line %d: 0 <= G[%d][%d] <= 255", i*DIM[1]+j+2, i, j);
return 0;
}
if(B[i][j] < 0 || 255 < B[i][j]) {
printf("Line %d: 0 <= B[%d][%d] <= 255", i*DIM[1]+j+2, i, j);
return 0;
}
}
}
printf("%d\n", style(DIM[0], DIM[1], R, G, B));
return 0;
}*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |