제출 #1328571

#제출 시각아이디문제언어결과실행 시간메모리
1328571liwuyouArt Class (IOI13_artclass)C++20
78 / 100
32 ms3344 KiB
#include "artclass.h"
#include <bits/stdc++.h>
using namespace std;

int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
  int cnt = 0;
  for (int i = 0; i < 400; i += 50) {
    for (int j = 0; j < 400; j += 50) {
      int r = 0, g = 0, b = 0, t = 0;
      for (int x = 0; x < 100; x++) {
        for (int y = 0; y < 100; y++) {
          r += R[i + x][j + y];
          g += G[i + x][j + y];
          b += B[i + x][j + y];
        }
      }
      r /= 10000, g /= 10000, b /= 10000;
      for (int x = 0; x < 100; x++) {
        for (int y = 0; y < 100; y++) {
          t += abs(R[i + x][j + y] - r) + abs(G[i + x][j + y] - g) + abs(B[i + x][j + y] - b) <= 30;
          t -= (abs(R[i + x][j + y] - r) + abs(G[i + x][j + y] - g) + abs(B[i + x][j + y] - b) >= 90) * 5;
        }
      }
      if (t >= 95 * 95 && r + g + b >= 4) {
        cnt++;
      }
      if (r + g + b >= 680) {
        cnt -= 100;
      }
    }
  }
  if (cnt >= 3) {
    return 4;
  }
  cnt = 0;
  for (int i = 0; i < 450; i += 25) {
    for (int j = 0; j < 450; j += 25) {
      int t = 0;
      for (int x = 0; x < 50; x++) {
        for (int y = 0; y < 50; y++) {
          t += (R[i + x][j + y] >= 0xe0 && G[i + x][j + y] >= 0xe0 && B[i + x][j + y] >= 0xe0);
        }
      }
      if (t >= 45 * 45) {
        cnt++;
      }
    }
  }
  if (cnt >= 3) {
    return 1;
  }
  cnt = 0;
  for (int i = 0; i < 450; i += 25) {
    for (int j = 0; j < 450; j += 25) {
      int s = 0, t = 0;
      for (int x = 0; x < 50; x++) {
        for (int y = 0; y < 50; y++) {
          s += (G[i + x][j + y] * 1.0 / (R[i + x][j + y] + B[i + x][j + y]) >= 0.55);
        }
      }
      if (s >= 35 * 35) {
        cnt++;
      }
    }
  }
  if (cnt >= 80) {
    return 2;
  }
  return 3;
}
#Verdict Execution timeMemoryGrader output
Fetching results...