Submission #593379

#TimeUsernameProblemLanguageResultExecution timeMemory
593379skittles1412Art Class (IOI13_artclass)C++17
9 / 100
54 ms6036 KiB
#include "bits/extc++.h"

using namespace std;

template <typename T>
void dbgh(const T& t) {
    cerr << t << endl;
}

template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
    cerr << t << " | ";
    dbgh(u...);
}

#ifdef DEBUG
#define dbg(...)                                              \
    cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]: "; \
    dbgh(__VA_ARGS__);
#else
#define dbg(...)
#define cerr   \
    if (false) \
    cerr
#endif

#define endl "\n"
#define long int64_t
#define sz(x) int((x).size())

extern "C" int style(int n,
                     int m,
                     int arrr[500][500],
                     int arrg[500][500],
                     int arrb[500][500]) {
    int cnt[8] {}, lim = 128;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            int x = 0;
            x = (x << 1) | (arrr[i][j] > lim);
            x = (x << 1) | (arrg[i][j] > lim);
            x = (x << 1) | (arrb[i][j] > lim);
            cnt[x]++;
        }
    }
    if (cnt[7] <= 20000) {
        return 4;
    } else if (cnt[7] >= 80000) {
        return 1;
    } else if (35000 <= cnt[7] && cnt[7] <= 55000) {
        return 2;
    } else {
        return 3;
    }
    // for (int i = 0; i < 8; i++) {
    // cout << cnt[i] << " \n"[i == 7];
    // }
    // cout << cnt[7] << endl;
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...