| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 15766 | ainta | 미술 수업 (IOI13_artclass) | C++98 | 132 ms | 6548 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "artclass.h"
#include<stdio.h>
#include<algorithm>
#define bound 30
#define bound2 0.8
using namespace std;
int r[501][501], g[501][501], b[501][501];
int Diff(int x,int y,int x2, int y2){
return abs(r[x][y]-r[x2][y2]) + abs(g[x][y]-g[x2][y2]) + abs(b[x][y]-b[x2][y2]);
}
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
int i, j, tot1 = 0, tot2 = 0, val1 = 0, val2 = 0;
for(i=0;i<H;i++){
for(j=0;j<W;j++){
r[i][j] = R[i][j], g[i][j] = G[i][j], b[i][j] = B[i][j];
}
}
for(i=0;i<H;i++){
for(j=0;j<W;j++){
if(i+1 < H){
tot1++;
if(Diff(i,j,i+1,j) < bound)val1++;
}
if(j+1 < W){
tot2++;
if(Diff(i,j,i,j+1) < bound)val2++;
}
}
}
double t = (double)(val1+val2)/(tot1+tot2);
if(t > bound2){
double t1 = (double)(tot1 - val1)/tot1, t2 = (double)(tot2 - val2)/tot2;
if(t1/t2 < 0.86 || t2/t1 < 0.86)return 4;
return 1;
}
else{
if(t < 0.45)return 3;
else return 2;
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
