The simulation, player 2 will always play according to the same strategy.
Method getPlayer2Move below is completed by assigning the correct value to result to be returned.
Explanation:
- You will write method getPlayer2Move, which returns the number of coins that player 2 will spend in a given round of the game. In the first round of the game, the parameter round has the value 1, in the second round of the game, it has the value 2, and so on.
#include <bits/stdc++.h>
using namespace std;
bool getplayer2move(int x, int y, int n)
{
int dp[n + 1];
dp[0] = false;
dp[1] = true;
for (int i = 2; i <= n; i++) {
if (i - 1 >= 0 and !dp[i - 1])
dp[i] = true;
else if (i - x >= 0 and !dp[i - x])
dp[i] = true;
else if (i - y >= 0 and !dp[i - y])
dp[i] = true;
else
dp[i] = false;
}
return dp[n];
}
int main()
{
int x = 3, y = 4, n = 5;
if (findWinner(x, y, n))
cout << 'A';
else
cout << 'B';
return 0;
}
Answer:
"LinkedIn" is the correct answer for the above question.
Explanation:
- LinkedIn is used to build a connection between people and communicate. But it is used to connect only business type contacts.
- So, when any user wants to make any business type of contacts, then he can do this with the help of making an account on LinkedIn and then add the business people on it.
- The above question asked about the networking site which is used to connect the business contacts. This site is known as LinkedIn.
Answer:
The answer to this question as follows:
Explanation:
In option a, When we use fork, a new mechanism, that uses fork() method, which is in the parental process, to replicate all sites. It has been installed in a space-differentiating operating system.
In option b, It is the present system cycle that scan and wait for any of the system processor to be installed.
In option c, The time delay happens when A operates. It is a global that make issues, which are cleared and slowed down when an interrupt happens. In this process, there are not any distractions. It splits into slowly as it heads into the ISR. It helps to understand the code easily.
Answer:
In a STAR TOPOLOGY network, each device on the network is attached to a central router. If the router fails, then the other devices will be unable to communicate, but if only one connected device fails, then all other devices will still be able to communicate.
Explanation:
In this type of topology all the computers are connected to a single router through a cable. This router is the central node and all others nodes are connected to the central node.