Ambikapathy wants to decorate his girlfriend Amaravathi's house with a series of lights. The number of lights is M. Initially, all the lights are switched off. Ambikapathy finds that there are K numbers of buttons, each of them is connected to a set of lights. Ambikapathy can press any of these buttons. When the button is pressed, it turns on all the lights it’s connected to. Can Ambikapathy accomplish his task to switch on all the lights? If Ambikapathy presses the button such that some lights connected to it are already turned on, they do not change their state, i.e. remain turned on. Help him in his task to impress his valentine.

 #include <stdio.h>
int main()
{  int  k,m,count=0;
scanf("%d %d",&k,&m);
while(k--) { 
int lights[m]; 
int i;
for(i=0;i<m;i++) {
scanf("%d",&lights[i]);
}
for(i=0;i<m;i++){
if(lights[i]<=m);
else{
count+=1;
}
}
}
if(count==0){
printf("YES");
}
else{
printf("NO");
}
return 0;
}

Comments

  1. What sets Trehan Luxury Floors apart is how effortlessly it delivers more than you expect. The 3BHK Sohna Road homes combine functionality with luxury — large windows, airy rooms, and refined finishes that make every day feel grand. For anyone exploring Real Estate Gurgaon, this project offers that rare harmony between premium aesthetics and lasting value.

    ReplyDelete
  2. The consistent updates on brampton-homes.ca make it a dependable site for home searches.

    ReplyDelete

Post a Comment

Popular posts from this blog

Akash the die heart fan of AR Rahman went to the live concert happened in Bangalore with his family members.The event management firm responsible for the event arranged the seats for the audience in descending order of maximum number of tickets booked for single family.

Elavenil has a chessboard with N rows and M columns. In one step, he can choose two cells of the chessboard which share a common edge (that has not been cut yet) and cut this edge. Formally, the chessboard is split into two or more pieces if it is possible to partition its cells into two non-empty subsets S1 and S2 (S1∩S2=∅, |S1|+|S2|=NM) such that there is no pair of cells c1,c2 (c1∈S1,c2∈S2) which share a common edge that has not been cut.Elavenil does not want the board to split into two or more pieces. Compute the maximum number of steps he can perform while satisfying this condition.

Advika is trying to solve the puzzle problem during Mathematics class hour. she has a graph paper with G X N rows and columns, and the puzzle question is, an NCC training base in each cell for a total of G X N bases. He wants to drop food items to every point based on strategic points on the graph paper, marking each drop point with a red dot. If a base contains at least one food package inside or on top of its border fence, then it's considered to be supplied. For example: if Advika has four bases in a 2x2 grid. If he drops a single food package where the walls of all four bases intersect, then those four cells can access the food package.