https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/11/Codeforces-Round-444-Div-2-problem-B-Cubes-for-Masha-Solution-In-CC1.png?fit=640%2C360

Codeforces Round #444 (Div. 2), problem: (B) Cubes for Masha Solution In C/C++

#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;
}

(Visited 21 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: