# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
396934 | definitelynotmee | 미술 수업 (IOI13_artclass) | C++98 | 93 ms | 3944 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "artclass.h"
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INFL = (1LL<<62)-1;
const int INF = (1<<30)-1;
const int MAXN = 500;
//int R[500][500], G[500][500], B[500][500];
//int N, M;
int dx[]{1,0,-1,0};
int dy[]{0,1,0,-1};
int style(int n, int m, int r[500][500], int g[500][500], int b[500][500]){
//N = n, M = m;
ll medr =0, medg = 0, medb = 0;
ll score[4] {0,0,0,0};
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
const int cr = r[j][i];
const int cg = g[j][i];
const int cb = b[j][i];
medr+=cr;
medg+=cg;
medb+=cb;
for(int k = 0; k < 4; k++){
int xi = j + dx[k];
int yi = i + dy[k];
if(xi < 0 || yi < 0 || xi >= m || yi >= n)
continue;
score[2]+= (cr-r[xi][yi])*(cr-r[xi][yi]) + (cg-g[xi][yi])*(cg-g[xi][yi]) + (cb-b[xi][yi])*(cb-b[xi][yi]);
}
//if((r[j][i] <= 55 && g[j][i] <= 55 && b[j][i] <= 55) ||(r[j][i] >= 200 && g[j][i] >= 200 && b[j][i] >= 200))
// score[2]++;
}
}
medr/=n*m;
medg/=n*m;
medb/=n*m;
score[0] = (medr-255) + abs(medg-255) + abs(medb-255);
score[1] = medr + abs(medg-125) + medb;
score[2]/= n*m;
//cout << score[0] << ' ' << score[1] << ' ' << score[2] << ' ' << green << '\n';
if(score[2] >= 7000)
return 3;
if(score[2] <= 850)
return 4;
if(score[1] <= 245)
return 2;
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |