# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
396395 | definitelynotmee | 미술 수업 (IOI13_artclass) | C++98 | 0 ms | 0 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 <bits/stdc++.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 style(int n, int m, int r[500][500], int g[500][500], int b[500][500]){
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++){
medr+=r[j][i];
medg+=g[j][i];
medb+=b[j][i];
//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-100) + medb;
//double score2 = (double)score[2]/(n*m);
//cout << score[0] << ' ' << score[1] << ' ' << score2 << '\n';
if(score[0] <= 150)
return 1;
if(score[1] <= 210)
return 2;
return 4;
}
/*int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ifstream ccin;
srand(time(nullptr));
for(int opa = 1; opa <= 4; opa++){
cout << "Style " << opa << ":\n\n";
for(int k = 1; k < 10; k++){
string s = "C:\\Users\\Convidado\\Desktop\\c++zada\\ioi\\artclass\\grader\\images\\style-";
s+=to_string(opa);
s+= "\\style-";
s+= to_string(opa);
s+= '-';
s+=to_string(k);
s+=".txt";
//cout << s << endl;
ccin.open(s);
int n, m;
ccin >> n >> m;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
ccin >> R[j][i] >> G[j][i] >> B[j][i];
}
}
cout << style(n,m,R,G,B) << '\n';
ccin.close();
}
cout << "\n\n";
}
}*/