Submission #403886

# Submission time Handle Problem Language Result Execution time Memory
403886 2021-05-13T14:39:31 Z PedroBigMan Art Class (IOI13_artclass) C++14
49 / 100
97 ms 9484 KB
#include "artclass.h"
/*
Author of all code: Pedro BIGMAN Dias
Last edit: 15/02/2021
*/
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <list>
#include <iomanip>
#include <stdlib.h>
#include <time.h>
#include <cstring>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=(ll) a; i<(ll) b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define whole(x) x.begin(),x.end()
#define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl
#define INF 500000000LL
#define EPS 0.00000001
#define pi 3.14159
ll mod=1000000007LL;

template<class A=ll> 
void Out(vector<A> a) {REP(i,0,a.size()) {cout<<a[i]<<" ";} cout<<endl;}

template<class A=ll>
void In(vector<A> &a, ll N) {A cur; REP(i,0,N) {cin>>cur; a.pb(cur);}}

int style(int h, int w, int r[500][500], int g[500][500], int b[500][500]) 
{
	cout.precision(20);
	ll H = (ll) h; ll W = (ll) w;
	vector<ll> xx; vector<vector<ll> > R,G,B; REP(i,0,W) {xx.pb(-1);} REP(i,0,H) {R.pb(xx); G.pb(xx); B.pb(xx);}
	REP(i,0,H) {REP(j,0,W) {R[i][j]=r[i][j]; G[i][j]=g[i][j]; B[i][j]=b[i][j];}}
	ll dist = 0LL;
	REP(i,0,H)
	{
		REP(j,0,W-1) {dist+=abs(R[i][j+1]-R[i][j]); dist+=abs(G[i][j+1]-G[i][j]); dist+=abs(B[i][j+1]-B[i][j]);}
	}
	REP(i,0,H-1) 
	{
		REP(j,0,W) {dist+=abs(R[i+1][j]-R[i][j]); dist+=abs(G[i+1][j]-G[i][j]); dist+=abs(B[i+1][j]-B[i][j]);}
	}
	ld indrand = (ld) dist/(ld) 2000000.0;
	if(indrand>=9.0) {return 3;}
	if(indrand<=2.0) {return 4;}
	return 1;
}

Compilation message

artclass.cpp:6: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    6 | #pragma GCC optimization ("O3")
      | 
artclass.cpp:7: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    7 | #pragma GCC optimization ("unroll-loops")
      |
# Verdict Execution time Memory Grader output
1 Correct 40 ms 7048 KB Output is correct
2 Correct 91 ms 9188 KB Output is correct
3 Incorrect 56 ms 8240 KB Output isn't correct
4 Correct 44 ms 7096 KB Output is correct
5 Incorrect 52 ms 8008 KB Output isn't correct
6 Correct 84 ms 7820 KB Output is correct
7 Incorrect 57 ms 7568 KB Output isn't correct
8 Correct 67 ms 9036 KB Output is correct
9 Correct 51 ms 7552 KB Output is correct
10 Correct 45 ms 6328 KB Output is correct
11 Incorrect 61 ms 7340 KB Output isn't correct
12 Correct 54 ms 7768 KB Output is correct
13 Correct 57 ms 8588 KB Output is correct
14 Correct 77 ms 8404 KB Output is correct
15 Correct 43 ms 7352 KB Output is correct
16 Correct 17 ms 4988 KB Output is correct
17 Correct 52 ms 7796 KB Output is correct
18 Incorrect 55 ms 8344 KB Output isn't correct
19 Incorrect 58 ms 8416 KB Output isn't correct
20 Correct 57 ms 8192 KB Output is correct
21 Incorrect 59 ms 8260 KB Output isn't correct
22 Incorrect 68 ms 7932 KB Output isn't correct
23 Incorrect 62 ms 7988 KB Output isn't correct
24 Correct 47 ms 7092 KB Output is correct
25 Incorrect 41 ms 6084 KB Output isn't correct
26 Incorrect 52 ms 7424 KB Output isn't correct
27 Incorrect 48 ms 7348 KB Output isn't correct
28 Correct 61 ms 8548 KB Output is correct
29 Correct 55 ms 8152 KB Output is correct
30 Correct 42 ms 6136 KB Output is correct
31 Incorrect 54 ms 8236 KB Output isn't correct
32 Correct 57 ms 8772 KB Output is correct
33 Correct 57 ms 8456 KB Output is correct
34 Incorrect 36 ms 5188 KB Output isn't correct
35 Correct 27 ms 4180 KB Output is correct
36 Incorrect 51 ms 7284 KB Output isn't correct
37 Correct 45 ms 7264 KB Output is correct
38 Correct 56 ms 8008 KB Output is correct
39 Correct 60 ms 8828 KB Output is correct
40 Correct 52 ms 8160 KB Output is correct
41 Correct 51 ms 8052 KB Output is correct
42 Correct 65 ms 9224 KB Output is correct
43 Incorrect 95 ms 7748 KB Output isn't correct
44 Incorrect 63 ms 8512 KB Output isn't correct
45 Correct 57 ms 8228 KB Output is correct
46 Incorrect 15 ms 2360 KB Output isn't correct
47 Correct 65 ms 9156 KB Output is correct
48 Correct 59 ms 7236 KB Output is correct
49 Incorrect 95 ms 7772 KB Output isn't correct
50 Correct 85 ms 9268 KB Output is correct
51 Incorrect 66 ms 7432 KB Output isn't correct
52 Correct 42 ms 7160 KB Output is correct
53 Incorrect 75 ms 7284 KB Output isn't correct
54 Correct 35 ms 6396 KB Output is correct
55 Incorrect 41 ms 6988 KB Output isn't correct
56 Correct 58 ms 8504 KB Output is correct
57 Incorrect 46 ms 5144 KB Output isn't correct
58 Correct 76 ms 7220 KB Output is correct
59 Correct 63 ms 9272 KB Output is correct
60 Correct 92 ms 8980 KB Output is correct
61 Correct 85 ms 9292 KB Output is correct
62 Incorrect 67 ms 9232 KB Output isn't correct
63 Correct 69 ms 8684 KB Output is correct
64 Correct 59 ms 8968 KB Output is correct
65 Correct 61 ms 5216 KB Output is correct
66 Correct 36 ms 6468 KB Output is correct
67 Correct 39 ms 4264 KB Output is correct
68 Correct 55 ms 7600 KB Output is correct
69 Correct 51 ms 7048 KB Output is correct
70 Correct 38 ms 6952 KB Output is correct
71 Correct 50 ms 8364 KB Output is correct
72 Incorrect 65 ms 8216 KB Output isn't correct
73 Incorrect 68 ms 8024 KB Output isn't correct
74 Correct 57 ms 6468 KB Output is correct
75 Correct 52 ms 5180 KB Output is correct
76 Correct 68 ms 9484 KB Output is correct
77 Correct 59 ms 8704 KB Output is correct
78 Incorrect 91 ms 8104 KB Output isn't correct
79 Correct 54 ms 8116 KB Output is correct
80 Incorrect 54 ms 7620 KB Output isn't correct
81 Correct 54 ms 8380 KB Output is correct
82 Correct 64 ms 9112 KB Output is correct
83 Correct 29 ms 4408 KB Output is correct
84 Correct 61 ms 8976 KB Output is correct
85 Correct 52 ms 8448 KB Output is correct
86 Correct 45 ms 7568 KB Output is correct
87 Correct 46 ms 7656 KB Output is correct
88 Correct 64 ms 9148 KB Output is correct
89 Incorrect 52 ms 7760 KB Output isn't correct
90 Correct 40 ms 5992 KB Output is correct
91 Correct 63 ms 9152 KB Output is correct
92 Correct 46 ms 7632 KB Output is correct
93 Incorrect 72 ms 8388 KB Output isn't correct
94 Correct 54 ms 8132 KB Output is correct
95 Correct 79 ms 8144 KB Output is correct
96 Incorrect 80 ms 7952 KB Output isn't correct
97 Correct 56 ms 8476 KB Output is correct
98 Correct 63 ms 9132 KB Output is correct
99 Incorrect 52 ms 7680 KB Output isn't correct
100 Incorrect 97 ms 7236 KB Output isn't correct
101 Correct 61 ms 8904 KB Output is correct
102 Correct 37 ms 5132 KB Output is correct