QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#40071 | #4250. Mars | ZeinDaner# | 0 | 7ms | 4052kb | C++14 | 1.3kb | 2022-07-16 03:34:21 | 2024-04-28 07:14:31 |
Judging History
answer
#include "mars.h"
#include <bits/stdc++.h>
using namespace std;
int ma[13][13];
int t;
void build(string &aux){
int id=0;
for(int i=0;i<t;i++){
for(int j=0;j<t;j++){
ma[i][j]=aux[id]-'0';
id++;
}
}
}
bool vis[13][13];
int X[5]={0,1,0,-1};
int Y[5]={-1,0,1,0};
void flod(int i,int j){
vis[i][j]=1;
for(int k=0;k<4;k++){
int xk=i+X[k];
int yk=j+Y[k];
if(xk>=0 && xk<t && yk>=0 && yk<t && ma[xk][yk] && !vis[xk][yk]){
flod(xk,yk);
}
}
}
std::string process(std::vector <std::vector<std::string>> a, int I, int J, int k, int n){
string ret="";
for(int i=0;i<100;i++) ret+='0';
if(k==0){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
ret[(I+i)*(2*n+1)+(J+j)]=a[i][j][0];
}
}
}
else{
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') ret[k]='1';
}
}
}
}
if(k==n-1){
t=2*n+1;
build(ret);
int ans=0;
for(int i=0;i<t;i++){
for(int j=0;j<t;j++){
if(!vis[i][j] && ma[i][j]){
ans++;
flod(i,j);
}
}
}
for(int i=0;i<100;i++) ret[i]='0';
for(int i=0;i<30;i++){
if(ans&(1<<i)) ret[i]='1';
else ret[i]='0';
}
}
return ret;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 7ms
memory: 4052kb
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 2 934 389 626 424 1010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 0110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0000000001001010000100000000000000000000000000000000000000000000000000000000000000000000000000000000 0110010000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 f18fba32-f6de-4dd0-ef1b-ea027937a4aa 010000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 5 934 390 626 424 1010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 1110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0000000000011000010000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000001001010010100000000000000000000000000000000000000000000000000000000000000000000000000000000 1110010000101000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 9 935 389 626 424 0010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 1110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0010000001001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0011100001001010000000000000000000000000000000000000000000000000000000000000000000000000000000000000 1100000000000000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 9 933 391 626 424 1010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 0101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 0110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0000000000011001010001100000000000000000000000000000000000000000000000000000000000000000000000000000 0000010100111001010000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000101001000011100000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 3 935 391 626 427 1010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 0110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000011000010000110000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 5 935 391 626 427 0010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 1101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 1110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000111001010000100000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000001000010100110000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 4 935 391 626 427 0010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 0101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 1110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 1100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0111000100011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0110000000011000000000000000000000000000000000000000000000000...
input:
224bb858-b13b-5e97-cbba-4a10b0455e79 5 935 390 626 424 0010111000011100001101110100011101000000010110011011101010001010000001011000010011000001111011111111 0101011000101100110110100011110010000010000100001010001110101111010000100001110000001110110011001010 0110111001011000110000110000011011100110001...
output:
f18fba32-f6de-4dd0-ef1b-ea027937a4aa 0111000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000010000011001010000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000001010000100111000000000000000000000000000000000000...
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