Submission #724089

# Submission time Handle Problem Language Result Execution time Memory
724089 2023-04-14T17:29:01 Z Urvuk3 Art Class (IOI13_artclass) C++17
0 / 100
78 ms 9244 KB
#include "artclass.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long
const int INF=1e9;
const ll LINF=1e18;
#define fi first
#define se second
#define pii pair<int,int>
#define mid ((l+r)/2)
#define sz(a) (int((a).size()))
#define all(a) a.begin(),a.end()
#define endl "\n"
#define pb push_back

void PRINT(int x) {cerr << x;}
void PRINT(ll x) {cerr << x;}
void PRINT(double x) {cerr << x;}
void PRINT(char x) {cerr << '\'' << x << '\'';}
void PRINT(string x) {cerr << '\"' << x << '\"';}
void PRINT(bool x) {cerr << (x ? "true" : "false");}

template<typename T,typename V>
void PRINT(pair<T,V>& x){
    cerr<<"{";
    PRINT(x.fi);
    cerr<<",";
    PRINT(x.se);
    cerr<<"}";
}
template<typename T>
void PRINT(T &x){
    int id=0;
    cerr<<"{";
    for(auto _i:x){
        cerr<<(id++ ? "," : "");
        PRINT(_i);
    }
    cerr<<"}";
}
void _PRINT(){
    cerr<<"]\n";
}
template<typename Head,typename... Tail>
void _PRINT(Head h,Tail... t){
    PRINT(h);
    if(sizeof...(t)) cerr<<", ";
    _PRINT(t...);
}

#define Debug(x...) cerr<<"["<<#x<<"]=["; _PRINT(x)

bool Valid(int i,int j){
    return (0<=i && i<500) && (0<=j && j<500);
}

int style(int H, int W, int R[500][500], int G[500][500], int B[500][500]) {
    vector<int> di={-1,0,1,0};
    vector<int> dj={0,1,0,-1};
    ll dif=0;
    for(int i=0;i<500;i++){
        for(int j=0;j<500;j++){
            for(int d=0;d<4;d++){
                int i1=i+di[d];
                int j1=j+dj[d];
                if(Valid(i1,j1)) dif+=abs(R[i][j]-R[i1][j1])+abs(G[i][j]-G[i1][j1])+abs(B[i][j]-B[i1][j1]);
            }
        }
    }
    ///Debug(dif);
    if(dif<=10000000) return 4;
}

Compilation message

artclass.cpp: In function 'int style(int, int, int (*)[500], int (*)[500], int (*)[500])':
artclass.cpp:60:29: warning: control reaches end of non-void function [-Wreturn-type]
   60 |     vector<int> di={-1,0,1,0};
      |                             ^
# Verdict Execution time Memory Grader output
1 Correct 66 ms 5492 KB Output is correct
2 Runtime error 32 ms 4044 KB Execution killed with signal 6
3 Incorrect 38 ms 3348 KB Output isn't correct
4 Runtime error 55 ms 7500 KB Execution killed with signal 6
5 Runtime error 40 ms 7876 KB Execution killed with signal 6
6 Runtime error 33 ms 4788 KB Execution killed with signal 6
7 Runtime error 52 ms 7980 KB Execution killed with signal 6
8 Correct 35 ms 4608 KB Output is correct
9 Runtime error 64 ms 9056 KB Execution killed with signal 6
10 Runtime error 74 ms 8640 KB Execution killed with signal 6
11 Runtime error 49 ms 6604 KB Execution killed with signal 6
12 Runtime error 51 ms 7136 KB Execution killed with signal 6
13 Runtime error 43 ms 8264 KB Execution killed with signal 6
14 Runtime error 38 ms 7708 KB Execution killed with signal 6
15 Runtime error 50 ms 7228 KB Execution killed with signal 6
16 Runtime error 55 ms 8480 KB Execution killed with signal 6
17 Runtime error 55 ms 8476 KB Execution killed with signal 6
18 Runtime error 56 ms 8264 KB Execution killed with signal 6
19 Correct 53 ms 5328 KB Output is correct
20 Runtime error 39 ms 5768 KB Execution killed with signal 6
21 Correct 29 ms 4368 KB Output is correct
22 Correct 16 ms 3668 KB Output is correct
23 Correct 50 ms 5336 KB Output is correct
24 Runtime error 55 ms 7468 KB Execution killed with signal 6
25 Runtime error 30 ms 3756 KB Execution killed with signal 6
26 Runtime error 51 ms 7364 KB Execution killed with signal 6
27 Correct 54 ms 6080 KB Output is correct
28 Runtime error 33 ms 4716 KB Execution killed with signal 6
29 Correct 52 ms 5268 KB Output is correct
30 Runtime error 29 ms 3964 KB Execution killed with signal 6
31 Runtime error 57 ms 8740 KB Execution killed with signal 6
32 Runtime error 47 ms 6732 KB Execution killed with signal 6
33 Runtime error 52 ms 7628 KB Execution killed with signal 6
34 Correct 40 ms 4988 KB Output is correct
35 Runtime error 47 ms 6712 KB Execution killed with signal 6
36 Runtime error 51 ms 8140 KB Execution killed with signal 6
37 Correct 47 ms 5080 KB Output is correct
38 Runtime error 58 ms 9244 KB Execution killed with signal 6
39 Runtime error 36 ms 4776 KB Execution killed with signal 6
40 Incorrect 62 ms 5860 KB Output isn't correct
41 Correct 47 ms 4408 KB Output is correct
42 Runtime error 53 ms 7340 KB Execution killed with signal 6
43 Correct 46 ms 5060 KB Output is correct
44 Correct 36 ms 4736 KB Output is correct
45 Runtime error 48 ms 8508 KB Execution killed with signal 6
46 Incorrect 50 ms 4884 KB Output isn't correct
47 Runtime error 58 ms 8380 KB Execution killed with signal 6
48 Correct 56 ms 5324 KB Output is correct
49 Runtime error 49 ms 8508 KB Execution killed with signal 6
50 Runtime error 48 ms 8400 KB Execution killed with signal 6
51 Incorrect 46 ms 5328 KB Output isn't correct
52 Runtime error 45 ms 6860 KB Execution killed with signal 6
53 Runtime error 58 ms 8580 KB Execution killed with signal 6
54 Runtime error 68 ms 9084 KB Execution killed with signal 6
55 Correct 43 ms 4852 KB Output is correct
56 Runtime error 50 ms 7176 KB Execution killed with signal 6
57 Runtime error 36 ms 7892 KB Execution killed with signal 6
58 Runtime error 52 ms 7612 KB Execution killed with signal 6
59 Runtime error 39 ms 5836 KB Execution killed with signal 6
60 Runtime error 57 ms 8864 KB Execution killed with signal 6
61 Runtime error 78 ms 9024 KB Execution killed with signal 6
62 Runtime error 44 ms 6108 KB Execution killed with signal 6
63 Runtime error 53 ms 7344 KB Execution killed with signal 6
64 Runtime error 55 ms 7332 KB Execution killed with signal 6
65 Runtime error 60 ms 8940 KB Execution killed with signal 6
66 Runtime error 48 ms 6788 KB Execution killed with signal 6
67 Correct 49 ms 5452 KB Output is correct
68 Runtime error 60 ms 8956 KB Execution killed with signal 6
69 Correct 52 ms 5452 KB Output is correct
70 Runtime error 32 ms 4792 KB Execution killed with signal 6
71 Correct 41 ms 4992 KB Output is correct
72 Runtime error 47 ms 6660 KB Execution killed with signal 6
73 Runtime error 64 ms 8952 KB Execution killed with signal 6
74 Runtime error 49 ms 7212 KB Execution killed with signal 6
75 Runtime error 16 ms 2068 KB Execution killed with signal 6
76 Runtime error 46 ms 6836 KB Execution killed with signal 6
77 Runtime error 49 ms 7108 KB Execution killed with signal 6
78 Runtime error 47 ms 8004 KB Execution killed with signal 6
79 Runtime error 62 ms 9008 KB Execution killed with signal 6
80 Runtime error 48 ms 6704 KB Execution killed with signal 6
81 Correct 42 ms 5136 KB Output is correct
82 Runtime error 63 ms 9024 KB Execution killed with signal 6
83 Runtime error 52 ms 8400 KB Execution killed with signal 6
84 Runtime error 46 ms 6716 KB Execution killed with signal 6
85 Correct 51 ms 5720 KB Output is correct
86 Correct 44 ms 5008 KB Output is correct
87 Correct 52 ms 5708 KB Output is correct
88 Runtime error 66 ms 8492 KB Execution killed with signal 6
89 Runtime error 54 ms 8416 KB Execution killed with signal 6
90 Runtime error 52 ms 6900 KB Execution killed with signal 6
91 Runtime error 53 ms 8236 KB Execution killed with signal 6
92 Runtime error 55 ms 7612 KB Execution killed with signal 6
93 Correct 53 ms 5132 KB Output is correct
94 Runtime error 40 ms 5556 KB Execution killed with signal 6
95 Runtime error 43 ms 8268 KB Execution killed with signal 6
96 Runtime error 40 ms 5900 KB Execution killed with signal 6
97 Incorrect 36 ms 4760 KB Output isn't correct
98 Correct 36 ms 4624 KB Output is correct
99 Runtime error 58 ms 8908 KB Execution killed with signal 6
100 Correct 48 ms 5256 KB Output is correct
101 Runtime error 63 ms 8792 KB Execution killed with signal 6
102 Runtime error 53 ms 6844 KB Execution killed with signal 6