Submission #403856

# Submission time Handle Problem Language Result Execution time Memory
403856 2021-05-13T14:16:56 Z PedroBigMan Art Class (IOI13_artclass) C++14
49 / 100
79 ms 11944 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]);}
	}
	ld indrand = (ld) dist/(ld) 1000000.0;
	if(indrand>=9.0) {return 3;}
	if(indrand<=1.5) {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 17 ms 5196 KB Output is correct
2 Incorrect 54 ms 10296 KB Output isn't correct
3 Incorrect 49 ms 9200 KB Output isn't correct
4 Correct 29 ms 5152 KB Output is correct
5 Incorrect 53 ms 9808 KB Output isn't correct
6 Incorrect 44 ms 9172 KB Output isn't correct
7 Correct 68 ms 11564 KB Output is correct
8 Correct 75 ms 10252 KB Output is correct
9 Correct 49 ms 8900 KB Output is correct
10 Incorrect 52 ms 10108 KB Output isn't correct
11 Correct 34 ms 6060 KB Output is correct
12 Correct 66 ms 10220 KB Output is correct
13 Incorrect 73 ms 9716 KB Output isn't correct
14 Incorrect 50 ms 9668 KB Output isn't correct
15 Correct 63 ms 11668 KB Output is correct
16 Correct 40 ms 8152 KB Output is correct
17 Correct 55 ms 10032 KB Output is correct
18 Correct 57 ms 9204 KB Output is correct
19 Correct 65 ms 11844 KB Output is correct
20 Correct 33 ms 6032 KB Output is correct
21 Correct 51 ms 9136 KB Output is correct
22 Incorrect 42 ms 7620 KB Output isn't correct
23 Incorrect 47 ms 8792 KB Output isn't correct
24 Correct 59 ms 9892 KB Output is correct
25 Correct 72 ms 11944 KB Output is correct
26 Correct 52 ms 9984 KB Output is correct
27 Correct 47 ms 9308 KB Output is correct
28 Incorrect 68 ms 11772 KB Output isn't correct
29 Correct 39 ms 8100 KB Output is correct
30 Correct 66 ms 11816 KB Output is correct
31 Correct 37 ms 6596 KB Output is correct
32 Correct 59 ms 8644 KB Output is correct
33 Correct 50 ms 9072 KB Output is correct
34 Correct 49 ms 8624 KB Output is correct
35 Correct 63 ms 8780 KB Output is correct
36 Correct 42 ms 8644 KB Output is correct
37 Correct 57 ms 10452 KB Output is correct
38 Correct 53 ms 7876 KB Output is correct
39 Correct 57 ms 10380 KB Output is correct
40 Incorrect 57 ms 10052 KB Output isn't correct
41 Incorrect 50 ms 8964 KB Output isn't correct
42 Incorrect 53 ms 10180 KB Output isn't correct
43 Correct 57 ms 10916 KB Output is correct
44 Correct 63 ms 11748 KB Output is correct
45 Incorrect 79 ms 10520 KB Output isn't correct
46 Correct 51 ms 10068 KB Output is correct
47 Correct 49 ms 9756 KB Output is correct
48 Correct 35 ms 6084 KB Output is correct
49 Correct 50 ms 8132 KB Output is correct
50 Correct 79 ms 11924 KB Output is correct
51 Correct 45 ms 8644 KB Output is correct
52 Correct 41 ms 8424 KB Output is correct
53 Incorrect 55 ms 9924 KB Output isn't correct
54 Correct 60 ms 10736 KB Output is correct
55 Correct 56 ms 7172 KB Output is correct
56 Correct 54 ms 10120 KB Output is correct
57 Correct 53 ms 10052 KB Output is correct
58 Incorrect 50 ms 8676 KB Output isn't correct
59 Correct 31 ms 7272 KB Output is correct
60 Incorrect 52 ms 9388 KB Output isn't correct
61 Correct 65 ms 11460 KB Output is correct
62 Incorrect 51 ms 9252 KB Output isn't correct
63 Correct 63 ms 11680 KB Output is correct
64 Correct 62 ms 11332 KB Output is correct
65 Correct 53 ms 10196 KB Output is correct
66 Correct 59 ms 11212 KB Output is correct
67 Correct 53 ms 10120 KB Output is correct
68 Correct 45 ms 9104 KB Output is correct
69 Incorrect 49 ms 8772 KB Output isn't correct
70 Incorrect 46 ms 8900 KB Output isn't correct
71 Correct 53 ms 9924 KB Output is correct
72 Correct 55 ms 9980 KB Output is correct
73 Correct 42 ms 8328 KB Output is correct
74 Correct 42 ms 7432 KB Output is correct
75 Correct 64 ms 11644 KB Output is correct
76 Incorrect 53 ms 9600 KB Output isn't correct
77 Correct 57 ms 10488 KB Output is correct
78 Correct 61 ms 8892 KB Output is correct
79 Incorrect 51 ms 8768 KB Output isn't correct
80 Incorrect 15 ms 2508 KB Output isn't correct
81 Incorrect 34 ms 6084 KB Output isn't correct
82 Incorrect 64 ms 8912 KB Output isn't correct
83 Incorrect 57 ms 9940 KB Output isn't correct
84 Correct 73 ms 9440 KB Output is correct
85 Incorrect 51 ms 10092 KB Output isn't correct
86 Incorrect 50 ms 8856 KB Output isn't correct
87 Incorrect 56 ms 9828 KB Output isn't correct
88 Correct 42 ms 7568 KB Output is correct
89 Incorrect 52 ms 9504 KB Output isn't correct
90 Incorrect 58 ms 10252 KB Output isn't correct
91 Correct 65 ms 11748 KB Output is correct
92 Correct 30 ms 4856 KB Output is correct
93 Correct 58 ms 10304 KB Output is correct
94 Correct 59 ms 11004 KB Output is correct
95 Correct 75 ms 11908 KB Output is correct
96 Correct 27 ms 4804 KB Output is correct
97 Correct 53 ms 9412 KB Output is correct
98 Correct 44 ms 7900 KB Output is correct
99 Incorrect 51 ms 9928 KB Output isn't correct
100 Incorrect 53 ms 9636 KB Output isn't correct
101 Correct 56 ms 10856 KB Output is correct
102 Correct 63 ms 11268 KB Output is correct