# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
680234 | Dan4Life | 미술 수업 (IOI13_artclass) | C++17 | 84 ms | 3992 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "artclass.h"
#include <bits/stdc++.h>
using namespace std;
int avg(int a[][500], int y1=0, int x1=0, int y2=500, int x2=500){
int tot = 0;
for(int i = y1; i < y2; i++)
for(int j = x1; j < x2; j++)
tot+=a[i][j];
return tot/((x2-x1+1)*(y2-y1+1));
}
int cnt(int a[][500], int b[][500], int c[][500], int thl=0, int thr=255, int y1=0, int x1=0, int y2=500, int x2=500){
int tot = 0, x;
for(int i = y1; i < y2; i++)
for(int j = x1; j < x2; j++)
x = (a[i][j]+b[i][j]+c[i][j])/3, tot+=(x>=thl and x<=thr);
return tot;
}
int cnt(int a[][500], int thl=0, int thr=255, int y1=0, int x1=0, int y2=500, int x2=500){
int tot = 0;
for(int i = y1; i < y2; i++)
for(int j = x1; j < x2; j++)
tot+=(a[i][j]>=thl and a[i][j]<=thr);
return tot;
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
int r = avg(R), g = avg(G), b = avg(B);
int th = 125, nth = 500*500/3, nth2 = 430*420;
if(r>=200 and g>=200 and b>=200) return 1;
if(avg(G,150)>=th) return 2;
if(cnt(B,50,170)>=nth2) return 4;
if(r>=th and g>=th/2 and b<th) return 3;
return rand()%3+2;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |