#include "rainbow.h"
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define X first
#define Y second
const int maxn = 2e5 + 5;
int n,m,k;
int a[55][55];
int p[55][55];
void init(int N, int M, int sx, int sy, int K, char *s) {
n = N; m = M; k = K;
int x = sx, y = sy;
a[x][y] = 1;
for(int i=0;i<k;i++) {
if(s[i]=='N') x--;
if(s[i]=='E') y++;
if(s[i]=='W') y--;
if(s[i]=='S') x++;
a[x][y] = 1;
}
}
int colour(int r1, int c1, int r2, int c2) {
for(int x=r1-1;x<=r2+1;x++) {
for(int y=c1-1;y<=c2+1;y++) {
if(x==r1-1 || x==r2+1 || y==c1-1 || y==c2+1) p[x][y] = 1;
else p[x][y] = a[x][y];
}
}
int v = 0, e = 0;
for(int x=r1-1;x<=r2+1;x++) {
for(int y=c1-1;y<=c2+1;y++) {
if(p[x][y]) v++;
if(y+1<=c2+1 && p[x][y] && p[x][y+1]) e++;
if(x+1<=r2+1 && p[x][y] && p[x+1][y]) e++;
}
}
int res = e-v+1;
for(int x=r1-1;x<=r2;x++) {
for(int y=c1-1;y<=c2;y++) {
if(p[x][y] && p[x][y+1] && p[x+1][y] && p[x+1][y+1]) res--;
}
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
488 KB |
Output is correct |
2 |
Correct |
2 ms |
488 KB |
Output is correct |
3 |
Runtime error |
3 ms |
744 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
744 KB |
Output is correct |
2 |
Runtime error |
3 ms |
804 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |