#include "mars.h"
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
const int N = 105;
const int oo = 1e18 + 7, mod = 1e9 + 7;
int n, a[N];
bool b[N][N];
//int xx[] = {0, 1, -1, 0};
//int yy[] = {1, 0, 0, -1};
bool vis[N][N];
void ff(int i, int j, int n){
if(i < 0 || j < 0 || i >= n || j >= n || b[i][j] != 1 || vis[i][j]) return;
vis[i][j] = 1;
ff(i + 1, j, n);
ff(i - 1, j, n);
ff(i, j - 1, n);
ff(i, j + 1, n);
}
string process(vector<vector<string>> a, int x, int y, int k, int n)
{
if(!k){
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
if(a[i][j][0] == '1'){
a[i][j][0] = '0';
a[i][j][((x + i) * 10) + (y + j)] = '1';
}
}
}
}
string temp = "";
temp.resize(100);
for(int i = 0; i < 100; i++) temp[i] = '0';
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
for(int k = 0; k < 100; k++) if(a[i][j][k] == '1') temp[k] = '1';
}
}
//cout << temp << "\n";
for(int i = 0; i < 100; i++) b[i/10][i%10] = '0';
for(int i = 0; i < 100; i++){
//cout << i << " " << (i / 10) << " " << (i % 10) << " " << b[i/10][i%10] << " " << temp[i] << "\n";
b[i / 10][i % 10] = temp[i] - '0';
}
if(k == (n - 1)){
for(int i = 0; i <= 2 * n; i++){
for(int j = 0; j <= 2 * n; j++) vis[i][j] = 0;
}
int answer = 0;
for(int i = 0; i <= (2 * n); i++){
for(int j = 0; j <= (2 * n); j++){
//cout << b[i][j];
if(!vis[i][j] && b[i][j] == 1){
answer++;
ff(i, j, 2 * n + 1);
}
//cout << "\n";
}
//cout << "\n";
}
//cout << answer << "\n";
string tempo = "";
for(int i = 0; i < 100; i++) tempo += "0";
for(int i = 0; i < 10; i++) if(answer & (1LL << i)) tempo[i] = '1';
return tempo;
}
else return temp;
}
/*
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
process();
}*/
Compilation message
mars.cpp:16:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
16 | const int oo = 1e18 + 7, mod = 1e9 + 7;
| ~~~~~^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
14 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
14 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
14 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
14 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
14 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
14 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
14 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
2348 KB |
Output is correct |
2 |
Correct |
8 ms |
2072 KB |
Output is correct |
3 |
Correct |
8 ms |
1912 KB |
Output is correct |
4 |
Correct |
8 ms |
1908 KB |
Output is correct |
5 |
Correct |
8 ms |
2164 KB |
Output is correct |
6 |
Correct |
8 ms |
2132 KB |
Output is correct |
7 |
Correct |
13 ms |
2020 KB |
Output is correct |
8 |
Correct |
16 ms |
2232 KB |
Output is correct |
9 |
Correct |
16 ms |
2188 KB |
Output is correct |
10 |
Correct |
16 ms |
2184 KB |
Output is correct |
11 |
Correct |
17 ms |
2308 KB |
Output is correct |
12 |
Correct |
16 ms |
2172 KB |
Output is correct |
13 |
Correct |
16 ms |
2176 KB |
Output is correct |
14 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
15 |
Halted |
0 ms |
0 KB |
- |