Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through these links, eBlogarithm may earn a commission at no extra cost to you. Prices and availability are subject to change.
#include<stdio.h>
int main()
{
int n,i,j,k,m,A[10][10],B[1000];
scanf(“%d”,&n);
for(i=1;i<=n;i++){
for(j=1;j<=6;j++){
scanf(“%d”,&A[i][j]);}
}
for(i=1;i<=100;i++){
B[i]=0;}
for(i=1;i<=n;i++){
for(j=1;j<=6;j++){
B[A[i][j]]=1;
for(k=1;k<=n;k++){
for(m=1;m<=6;m++){
if (k!=i){
B[A[i][j]*10+A[k][m]]=1;
}
}
}
}
}
i=1;
while(B[i]){
i++;}
printf(“%d”,i-1);
return 0;
}
📦 Looking for Codeforces Round 444 Div Problem Cubes? Check the best deals on Amazon.
🛒 Shop Codeforces Round 444 Div Problem Cubes on Amazon
As an Amazon Associate, eBlogarithm earns from qualifying purchases. Prices and availability are subject to change.
Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through these links, eBlogarithm may earn a commission at no extra cost to you. Prices and availability are subject to change.
#include<stdio.h>
int main()
{
int n,i,j,k,m,A[10][10],B[1000];
scanf(“%d”,&n);
for(i=1;i<=n;i++){
for(j=1;j<=6;j++){
scanf(“%d”,&A[i][j]);}
}
for(i=1;i<=100;i++){
B[i]=0;}
for(i=1;i<=n;i++){
for(j=1;j<=6;j++){
B[A[i][j]]=1;
for(k=1;k<=n;k++){
for(m=1;m<=6;m++){
if (k!=i){
B[A[i][j]*10+A[k][m]]=1;
}
}
}
}
}
i=1;
while(B[i]){
i++;}
printf(“%d”,i-1);
return 0;
}
📦 Looking for Codeforces Round 444 Div Problem Cubes? Check the best deals on Amazon.
🛒 Shop Codeforces Round 444 Div Problem Cubes on Amazon
As an Amazon Associate, eBlogarithm earns from qualifying purchases. Prices and availability are subject to change.