Submission #1136488

#TimeUsernameProblemLanguageResultExecution timeMemory
1136488mychecksedadGame (IOI13_game)C++20
Compilation error
0 ms0 KiB
#include "artclass.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD1 (1000000000+7)
#define MOD (998244353)
#define pb push_back
#define all(x) x.begin(), x.end()
#define en cout << '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
const int N = 1e6+100, M = 1e5+10, K = 52, MX = 30;


int arr[4][2] = {
  {0, 1},
  {1, 0},
  {-1, 0},
  {0, -1}
};
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
  int li = -1, ri = 500, lj = -1, rj = 500;
  for(int i = 0; i < 500; ++i){
    for(int j = 0; j < 500; ++j){
      if(R[i][j] + G[i][j] + B[i][j] > 0){
        li = i;
        break;
      }
    }
    if(li != -1) break;
  }
  for(int j = 0; j < 500; ++j){
    for(int i = 0; i < 500; ++i){
      if(R[i][j] + G[i][j] + B[i][j] > 0){
        lj = j;
        break;
      }
    }
    if(lj != -1) break;
  }
  for(int i = 499; i >= 0; --i){
    for(int j = 0; j < 500; ++j){
      if(R[i][j] + G[i][j] + B[i][j] > 0){
        ri = i;
        break;
      }
    }
    if(ri < 500) break;
  }
  for(int j = 499; j >= 0; --j){
    for(int i = 0; i < 500; ++i){
      if(R[i][j] + G[i][j] + B[i][j] > 0){
        rj = j;
        break;
      }
    }
    if(rj < 500) break;
  }
  ll red = 0, blue = 0, green = 0, white = 0, black = 0;
  ll redd = 0;
  ll bluee = 0;
  for(int i = li; i <= ri; ++i) for(int j = lj; j <= rj; ++j) red += R[i][j];
  for(int i = li; i <= ri; ++i) for(int j = lj; j <= rj; ++j) green += G[i][j];
  for(int i = li; i <= ri; ++i) for(int j = lj; j <= rj; ++j) blue += B[i][j];
  for(int i = li; i <= ri; ++i) for(int j = lj; j <= rj; ++j) redd += R[i][j] >= 120 && B[i][j] <= 100 && G[i][j] <= 100;
  for(int i = li; i <= ri; ++i) for(int j = lj; j <= rj; ++j) bluee += B[i][j] >= 100 && B[i][j] >= R[i][j] && B[i][j] >= G[i][j];
  for(int i = li; i <= ri; ++i) for(int j = lj; j <= rj; ++j) white += (B[i][j] >= 150 && G[i][j] >= 150 && R[i][j] >= 150);
  for(int i = li; i <= ri; ++i) for(int j = lj; j <= rj; ++j) black += (B[i][j] + R[i][j] + B[i][j] <= 20);
  // ll s = red + blue + green;
  int coef = 0, row_equality = 0;
  for(int i = li; i <= ri; ++i){
    for(int j = lj; j <= rj; ++j){
      for(int k = 0; k < 4; ++k){
        int nx = i + arr[k][0];
        int ny = j + arr[k][1];
        if(nx >= li && ny >= lj && nx <= ri && ny <= rj){
          int dif = abs(R[i][j]-R[nx][ny]) + abs(G[i][j] - G[nx][ny]) + abs(B[i][j] - B[nx][ny]);
          if(dif < 20) coef++;
          if(dif < 40){
            if(k >= 1 && k <= 2) row_equality++;
          }
        }
      }
    }
  }
  // cout << redd << ' ';
  // cout << redd << ' ' << ' ' ;
  int tot = (ri-li+1)*(rj-lj+1); //cout << tot << ' ';
  if((white > tot / 3 || (redd > tot / 3 && white > tot / 10)) && coef > tot*5/2) return 1;
  if(row_equality > tot*100/55) return 4;
  if(red + green > blue*2 && coef > tot && black <= 6200){
    return 2;
  }
  // cout << red << ' ' << blue << ' ' << green << ' ' << s << ' ' << 500*500*3*150 << '\n';
  return 3;
}

Compilation message (stderr)

game.cpp:1:10: fatal error: artclass.h: No such file or directory
    1 | #include "artclass.h"
      |          ^~~~~~~~~~~~
compilation terminated.