# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
747 | gs12117 | 지도 색칠하기 (GA3_map) | C++98 | 808 ms | 1088 KiB |
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<stdio.h>
int n,m;
int edge[22][22];
int en[22];
int c[22];
int dfs(int a,int b,int graph){
int i,j;
c[a]=b;
for(i=0;i<en[a];i++){
if((graph>>edge[a][i])&1){
if(c[edge[a][i]]==0){
j=dfs(edge[a][i],3-b,graph);
if(j==0)return 0;
}
if(c[edge[a][i]]==b)return 0;
}
}
return 1;
}
long long int color(int a){
int b,i,j,k;
long long int r=1;
for(i=0;i<n;i++){
c[i]=0;
}
for(i=0;i<n;i++){
if((a>>i)&1){
if(c[i]==0){
j=dfs(i,1,a);
if(j==0)return 0;
# | 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... |