Cerinta completa You have N soldiers numbered from 1 to N. Each of your soldiers is either a liar or a truthful person. You have M sets of information about them. Each set of information tells you the number of
Making Candies
Cerinta completa Karl loves playing games on social networking sites. His current favorite is CandyMaker, where the goal is to make candies. Karl just started a level in which he must accumulate candies starting with machines and workers. In a
Knapsack
Cerinta completa Given an array of integers and a target sum, determine the sum nearest to but not exceeding the target that can be created. To create the sum, use any element of your array zero or more times. For
LCS Returns
Cerinta completa Given two strings, and , find and print the total number of ways to insert a character at any position in string such that the length of the Longest Common Subsequence of characters in the two strings increases
Jumping on the Clouds
Cerinta completa There is a new mobile game that starts with consecutively numbered clouds. Some of the clouds are thunderheads and others are cumulus. The player can jump on any cumulus cloud having a number that is equal to the
Lovely Triplets
Cerinta completa Daniel loves graphs. He thinks a graph is special if it has the following properties: It is undirected. The length of each edge is . It includes exactly different lovely triplets. A triplet is a set of different
Kruskal (MST): Really Special Subtree
Cerinta completa Given an undirected weighted connected graph, find the Really Special SubTree in it. The Really Special SubTree is defined as a subgraph consisting of all the nodes in the graph and: There is only one exclusive path from
Lisa’s Workbook
Cerinta completa Lisa just got a new math workbook. A workbook contains exercise problems, grouped into chapters. Lisa believes a problem to be special if its index (within a chapter) is the same as the page number where it’s located.
Kingdom Division
Cerinta completa King Arthur has a large kingdom that can be represented as a tree, where nodes correspond to cities and edges correspond to the roads between cities. The kingdom has a total of cities numbered from to . The
Iterate It
Cerinta completa Consider the following pseudocode, run on an array of length : rep := 0 while A not empty: B := [] for x in A, y in A: if x != y: append absolute_value(x – y) to B
