# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427304 | AmineWeslati | Art Class (IOI13_artclass) | C++14 | 89 ms | 4548 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int>vi;
#define pb push_back
#define sz(v) (int)v.size()
typedef pair<int,int>pi;
#define fi first
#define se second
typedef vector<pi>vpi;
#define eb emplace_back
#define FOR(i,a,b) for(int i=a; i<b; i++)
#define ROF(i,a,b) for(int i=b-1; i>=a; i--)
void ckmax(int &x, int y){x=max(x,y);}
void ckmin(int &x, int y){x=min(x,y);}
const int MX=1e5+10;
//-----------------------------
int style(int N, int M, int R[500][500], int G[500][500], int B[500][500]) {
int H=N,W=M;
int cnt=0,cnt2=0;
FOR(i,0,N) FOR(j,0,M){
if(B[i][j]<=min(G[i][j],R[i][j])) cnt++;
if(G[i][j]>=max(B[i][j],R[i][j])) cnt2++;
}
if(cnt>=H*W/3){
if(cnt2>=H*W/3) return 2;
return 3;
}
cnt=0;
FOR(i,0,N) FOR(j,0,M){
if(G[i][j]<=min(B[i][j],R[i][j])) cnt++;
}
if(cnt>=H*W/3) return 1;
cnt=0;
FOR(i,0,N) FOR(j,0,M){
if(R[i][j]>=max(B[i][j],G[i][j])) cnt++;
}
if(cnt>=H*W/3) return 4;
return 3;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |