| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 15765 | ainta | 미술 수업 (IOI13_artclass) | C++98 | 127 ms | 6560 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "artclass.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, tot = 0, val = 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){
tot++;
if(Diff(i,j,i+1,j) < bound)val++;
}
if(j+1 < W){
tot++;
if(Diff(i,j,i,j+1) < bound)val++;
}
}
}
if((double)val/tot < bound2){
return 2;
}
else{
return 1;
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
