This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "mars.h"
#include <bits/stdc++.h>
#define rep(a,b,c) for(int a=b; a<c; a++)
#define repr(a,b,c) for(int a=b-1; a>c-1; a--)
#define repa(a,b) for(auto a:b)
#define fi first
#define se second
#define pii pair<int, int>
#define ll long long
#define pb push_back
using namespace std;
string process(vector<vector<string>> a, int I, int J, int k, int n){
string s;
s.resize(100);
if(!k){
queue<pii> q;
bool vis[3][3]{};
int c=0, z=0;
rep(i,0,3) rep(j,0,3) if(a[i][j][0]=='0') vis[i][j]=true;
rep(x,0,3){
rep(y,0,3){
if(vis[x][y]) continue;
else c++;
q.push({x,y});
vis[x][y]=true;
while(q.size()){
int i=q.front().fi, j=q.front().se;
q.pop();
if((i==I && I) || (j==J && J)) z=1;
if(i<2 && !vis[i+1][j]){
q.push({i+1,j});
vis[i+1][j]=true;
}
if(i && !vis[i-1][j]){
q.push({i-1,j});
vis[i-1][j]=true;
}
if(j<2 && !vis[i][j+1]){
q.push({i,j+1});
vis[i][j+1]=true;
}
if(j && !vis[i][j]){
q.push({i,j-1});
vis[i][j-1]=true;
}
}
if(z) c--;
}
}
rep(i,0,100){
if(i>10) s[i]='0';
else if((c>>i)&1) s[i]='1';
else s[i]='0';
}
return s;
}else{
int c=0;
rep(i,0,10){
if(a[0][0][i]=='1') c+=(1<<i);
if(a[0][2][i]=='1') c+=(1<<i);
if(a[2][0][i]=='1') c+=(1<<i);
}
rep(i,0,100){
if(i>10) s[i]='0';
else if((c>>i)&1) s[i]='1';
else s[i]='0';
}
return s;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |