Submission #415895

#TimeUsernameProblemLanguageResultExecution timeMemory
415895Theo830Art Class (IOI13_artclass)C++17
0 / 100
81 ms3308 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e9+7;
ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ll,ii>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define pb push_back
#define vll vector<ll>
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///Think different approaches (bs,dp,greedy,graphs,shortest paths,mst)
///Stay Calm
///Look for special cases
///Beware of overflow and array bounds
///Think the problem backwards
///Deltix Round, Spring 2021 (open for everyone, rated, Div. 1 + Div. 2)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
uniform_int_distribution<ll> distr;
ll rnd(ll a, ll b){return distr(rng)%(b-a+1)+a;}
#include "artclass.h"
int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
    ll n = H,m = W;
    ll posa = (n * m + 3) / 4;
    ll ans = 1;
    f(i,0,n){
        f(j,0,m){
            ll maxi = max({abs(R[i][j] - G[i][j]),abs(R[i][j] - B[i][j]),abs(G[i][j] - B[i][j])});
        }
    }
    if(posa <= 0){
        ans = 2;
    }
    return ans;
}

Compilation message (stderr)

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:35:16: warning: unused variable 'maxi' [-Wunused-variable]
   35 |             ll maxi = max({abs(R[i][j] - G[i][j]),abs(R[i][j] - B[i][j]),abs(G[i][j] - B[i][j])});
      |                ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...