Submission #776359

#TimeUsernameProblemLanguageResultExecution timeMemory
776359tolbiArt Class (IOI13_artclass)C++17
54 / 100
46 ms6156 KiB
#pragma optimize("Bismillahirrahmanirrahim")
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█■█
//█─█─█▄─█▄─█─█─█─█
//Allahuekber
//ahmet23 orz...
//FatihSultanMehmedHan
//YavuzSultanSelimHan
//AbdulhamidHan
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
#define author tolbi
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define sortarr(x) sort(x.begin(), x.end())
#define sortrarr(x) sort(x.rbegin(), x.rend())
#define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl;
#define rev(x) reverse(x.begin(), x.end())
#define tol(bi) (1LL<<((int)(bi)))
mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count());
typedef long long ll;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#include "artclass.h"
int r[500][500];
int g[500][500];
int b[500][500];
int delta_g(pair<int,int> ac, pair<int,int> bc){
	return 
	abs(r[ac.first][ac.second]-r[bc.first][bc.second])+
	abs(g[ac.first][ac.second]-g[bc.first][bc.second])+
	abs(b[ac.first][ac.second]-b[bc.first][bc.second]);
}
int style(int n, int m, int R[500][500], int G[500][500], int B[500][500]) {
	for (int i = 0; i < 500; i++){
		for (int j = 0; j < 500; j++){
			r[i][j]=R[i][j];
			g[i][j]=G[i][j];
			b[i][j]=B[i][j];
		}
	}
	int say = 0;
	int treshold1=100;
	int treshold2=10000;
	double treshold3=0.8;
	int treshold4=200;
	int grsay = 0;
	for (int i = 0; i < 500; i++){
		for (int j = 0; j < 500; j++){
			if (i && delta_g({i,j},{i-1,j})>treshold1) say++;
			if (j && delta_g({i,j},{i-1,j})>treshold1) say++;
			if (g[i][j]*treshold3>b[i][j] && b[i][j]>r[i][j]) grsay++;
		}
	}
	if (say<2000) return 4;
	if (say>50000) return 3;
	if (grsay>treshold4){
		return 2;
	}
	return 1;
}

Compilation message (stderr)

artclass.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      | 
artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:44:6: warning: unused variable 'treshold2' [-Wunused-variable]
   44 |  int treshold2=10000;
      |      ^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...