QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#39753 | #4250. Mars | lunchbox | 0 | 6ms | 4020kb | C++17 | 1.5kb | 2022-07-13 11:35:23 | 2024-04-28 07:14:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
struct dsu {
vector<int> ds;
dsu() {}
dsu(int n) {
ds.assign(n, -1);
}
const int& operator[](int i) {
return ds[i];
}
int find(int i) {
return ds[i] < 0 ? i : ds[i] = find(ds[i]);
}
int size(int i) {
return -ds[find(i)];
}
bool same(int i, int j) {
return find(i) == find(j);
}
bool join(int i, int j) {
i = find(i), j = find(j);
if (i == j)
return false;
if (ds[i] > ds[j])
swap(i, j);
ds[i] += ds[j], ds[j] = i;
return true;
}
};
const int N = 20 * 2 + 1;
string process(vector<vector<string>> ss, int i, int j, int k, int n) {
static int on[N][N];
int n_ = (k + 1) * 2 + 1;
if (k == 0)
for (int x1 = 0; x1 < 3; x1++)
for (int y1 = 0; y1 < 3; y1++)
on[i + x1][j + y1] = ss[x1][y1][0] - '0';
if (k < n - 1)
return string(100, '0');
else {
dsu ds(n_ * n_);
int m;
for (int x = 0; x < n_; x++)
for (int y = 0; y < n_; y++)
if (on[x][y]) {
if (x > 0 && on[x - 1][y])
ds.join(x * n_ + y, (x - 1) * n_ + y);
if (y > 0 && on[x][y - 1])
ds.join(x * n_ + y, x * n_ + (y - 1));
}
m = 0;
for (int i = 0; i < n_ * n_; i++)
if (ds[i] < 0 && on[i / n_][i % n_])
m++;
string t(100, '0');
for (int b = 0; b < 10; b++)
t[b] = '0' + (m >> b & 1);
return t;
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 6ms
memory: 4020kb
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 2 934 389 626 424 1010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 0110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 f18fba32-f6de-4dd0-ef1b-ea027937a4aa 001000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 5 934 390 626 424 1010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 1110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 9 935 389 626 424 0010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 1110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1100000000000000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 9 933 391 626 424 1010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 0101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 0110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 3 935 391 626 427 1010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 0110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0100000000000000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 5 935 391 626 427 0010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 1110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 4 935 391 626 427 0010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 0101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 1110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 1100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 5 935 390 626 424 0010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 0101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 0110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000...
result:
wrong answer 1st numbers differ - expected: '1', found: '0'
Subtask #2:
score: 0
Skipped
Subtask #3:
score: 0
Skipped
Subtask #4:
score: 0
Skipped
Subtask #5:
score: 0
Skipped
Subtask #6:
score: 0
Skipped
Subtask #7:
score: 0
Skipped
Subtask #8:
score: 0
Skipped
Subtask #9:
score: 0
Skipped
Subtask #10:
score: 0
Skipped