// In the name of GOD
#include "rainbow.h"
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
#define BeGood ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define orset tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define nl '\n'
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define pb push_back
typedef long long ll;
typedef double db;
const int N = 1e4 + 5;
//const int M = 1e9 + 7;
int a[111][111];
void init(int R, int C, int sr, int sc, int M, char *S){
BeGood
int n = R;
int k = C;
int x = sr;
int y = sc;
int slen = M;
if(n <= 55 && k <= 55){
for(int i = 1; i <= n; ++i){
for(int j = 1; j <= k; ++j){
a[i][j] = 0;
}
}
for(int i = 0; i < slen; ++i){
a[x][y] = 1;
if(S[i] == 'N'){
x--;
}
if(S[i] == 'W'){
y--;
}
if(S[i] == 'S'){
x++;
}
if(S[i] == 'E'){
y++;
}
}
a[x][y] = 1;
}
}
int colour(int ar, int ac, int br, int bc){
int x1 = ar;
int x2 = br;
int y1 = ac;
int y2 = bc;
int ans = 0;
vector<int> t[55];
for(int i = 0; i < 54; ++i){
t[i].resize(55, 0);
}
for(int i = x1; i <= x2; ++i){
for(int j = y1; j <= y2; ++j){
if(a[i][j] == 0){
if(t[i - 1][j] != 2 && t[i + 1][j] != 2 && t[i][j - 1] != 2 && t[i][j + 1] != 2){
ans++;
}
t[i][j] = 2;
}
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
512 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
3 |
Runtime error |
3 ms |
896 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Runtime error |
4 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
512 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
512 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |