Input : First line contains T - No. of test cases. For each test case there are two lines. first line contains N. Second line contains N space separated integers A[1] to A[N].
Output : Print answer of the mystery in separate lines.
It will be more helpful to others if you post the solution after the assignment deadline has passed, rather than before it. Students won't learn if they have the solution ready. The idea is to make them think and solve. Nothing much is lost even if someone is not able to answer, but they lose a lot if they simply end up copying the answer. By giving the solutions before the deadline, you are violating the following:
1. The copyright and terms of use of NPTEL 2. Code of honor
No one can stop me From posting solution and neither i am afraid of getting banned from nptel. But I respect my Teachers , As Today i saw on the forum that SIR has asked the poster to remove the post So from now on I Will not post any solution before The dead Line. However Will give a hint to solve the program. Sorry Shankar Sir
Solution will be send after the deadline is over. please try to solve it for yourself , if you encounter any problem i will definitely help you.please try yourself first. if you want logic i will readily explain you
Abhimanyu makes a complete binary tree of level L, called Crazy Tree. The levels are numbered 1, 2, ..., L from top to bottom. The root of the tree is at level 1. He numbers all the leaf nodes 1, 2, 3, ... from left to right. The value of every parent node is the product of values of its child nodes.
Below are Level 2 (left) and Level 3 (right) Crazy Trees.
Level 2 Crazy Tree Level 3 Crazy Tree
Abhimanyu has a magical function S:
S(Z): This function gives sum of all the nodes at level Z For two magical integers X and Y, Abhimanyu wants to find the value of W % M, where:
W = S(X) + S(X + 1) + ... + S(Y) M = 1299709 Input
First line of input contains two space separated integers L and Q, where L is the number of levels in Crazy Tree and Q is number of queries. Each of next Q lines contains two space separated integers X and Y.
Output
Output W % M, for each test case in single line.
Constraints
1 <= L <= 21 1 <= Q <= L (L + 1) / 2 1 <= X <= L X <= Y <= L M = 1299709
sorry for the inconvenience but i am kind of busy in something and i am weak in my tree concept so have to carefully give this question my sometime.so will try providing you the answer after few days.. sorry :(
Mike is very much fond of numbers. Two numbers are defined as pseudo-equal if sum of squares of their digits is equal. For example, 143 is pseudo-equal to 51 as 12 + 42 + 32 is equal to 52 + 12.
Now Mike is interested in counting how many ordered pairs (i, j) are there such that 0 ≤ i, j ≤ 10N and i is pseudo-equal to j.
As the answer can be large print it modulo 109 + 7.
Input format
The only line containing N.
Output format
Print in a single line, the required answer modulo 109 + 7.
Constraints
0 ≤ N ≤ 200
Sample Input(Plaintext Link) 1
Sample Output(Plaintext Link) 13
Explanation The required ordered pairs are (0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (1, 10), (10, 1). So there are 13 such pairs.
You are given a sorted(either in the increasing or in the decreasing order) sequence of positive numbers, ending with a -1. You can assume that there are atleast three numbers before the ending -1.
Note : -1 is not a part of input. It only signifies that input has ended.
Let us call the sequence x0 x1 ... xn -1.
You have to output 1 if there are atleast three distinct numbers in the sequence. otherwise output 0
i need a program to count the number of factorial numbers within a given inerval.
ReplyDeleteplease give a program for nptel week 3 assignment blocks world
ReplyDeleteRequest accepted :)
DeleteCheck the home page.
hey man,
ReplyDeletecan you provide the solution to this problem....
Solve the mystery.
Input :
First line contains T - No. of test cases.
For each test case there are two lines.
first line contains N.
Second line contains N space separated integers A[1] to A[N].
Output :
Print answer of the mystery in separate lines.
Constraints :
1<=T<=10
1<= N <= 10^5
0<= A[i] <= 10^5
Sample Input(Plaintext Link)
6
3
2 2 2
3
1 2 3
5
2 2 3 3 4
5
1 2 3 4 5
4
2 4 5 6
6
1 2 3 1 2 3
Sample Output(Plaintext Link)
0
4
6
9
5
8
please provide full question .
DeleteI will definitely try solving the question.
But the question is incomplete.
Please provide full question
this is the full question
Deletehope this helps
Deletehttp://cprogrammingquest.blogspot.in/2016/02/solve-mystery.html
when are the quiz 3 solutions coming out?
ReplyDeletei need to cross check a few
please wait for two days.Sorry for delay. :(
Deletehttp://cprogrammingquest.blogspot.in/2016/02/quiz-3.html
Deletewhere is quiz2 answers we are wainting
ReplyDeleteIt will be more helpful to others if you post the solution after the assignment deadline has passed, rather than before it. Students won't learn if they have the solution ready. The idea is to make them think and solve. Nothing much is lost even if someone is not able to answer, but they lose a lot if they simply end up copying the answer. By giving the solutions before the deadline, you are violating the following:
ReplyDelete1. The copyright and terms of use of NPTEL
2. Code of honor
This comment has been removed by the author.
DeleteNo one can stop me From posting solution and neither i am afraid of getting banned from nptel.
DeleteBut I respect my Teachers , As Today i saw on the forum that SIR has asked the poster to remove the post So from now on I Will not post any solution before The dead Line.
However Will give a hint to solve the program.
Sorry Shankar Sir
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteplease send the solution of closest numbers
ReplyDeleteplease send the solution of closest numbers
ReplyDeleteSolution will be send after the deadline is over.
Deleteplease try to solve it for yourself , if you encounter any problem i will definitely help you.please try yourself first. if you want logic i will readily explain you
Can you provide solution for this question ?
ReplyDeleteAbhimanyu makes a complete binary tree of level L, called Crazy Tree. The levels are numbered 1, 2, ..., L from top to bottom. The root of the tree is at level 1. He numbers all the leaf nodes 1, 2, 3, ... from left to right. The value of every parent node is the product of values of its child nodes.
Below are Level 2 (left) and Level 3 (right) Crazy Trees.
Level 2 Crazy Tree Level 3 Crazy Tree
Abhimanyu has a magical function S:
S(Z): This function gives sum of all the nodes at level Z
For two magical integers X and Y, Abhimanyu wants to find the value of W % M, where:
W = S(X) + S(X + 1) + ... + S(Y)
M = 1299709
Input
First line of input contains two space separated integers L and Q, where L is the number of levels in Crazy Tree and Q is number of queries. Each of next Q lines contains two space separated integers X and Y.
Output
Output W % M, for each test case in single line.
Constraints
1 <= L <= 21
1 <= Q <= L (L + 1) / 2
1 <= X <= L
X <= Y <= L
M = 1299709
Sample Input(Plaintext Link)
3 6
1 1
1 2
1 3
2 2
2 3
3 3
Sample Output(Plaintext Link)
24
38
48
14
24
10
Explanation
The tree is Level 3 tree. So, S(1) = 24 S(2) = 14 S(3) = 10
sorry for the inconvenience but i am kind of busy in something and i am weak in my tree concept so have to carefully give this question my sometime.so will try providing you the answer after few days.. sorry :(
DeleteMike is very much fond of numbers. Two numbers are defined as pseudo-equal if sum of squares of their digits is equal. For example, 143 is pseudo-equal to 51 as 12 + 42 + 32 is equal to 52 + 12.
ReplyDeleteNow Mike is interested in counting how many ordered pairs (i, j) are there such that 0 ≤ i, j ≤ 10N and i is pseudo-equal to j.
As the answer can be large print it modulo 109 + 7.
Input format
The only line containing N.
Output format
Print in a single line, the required answer modulo 109 + 7.
Constraints
0 ≤ N ≤ 200
Sample Input(Plaintext Link)
1
Sample Output(Plaintext Link)
13
Explanation
The required ordered pairs are (0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10), (1, 10), (10, 1). So there are 13 such pairs.
i want solution to this problem, please if u can help ?
ReplyDeleteYou are given a sorted(either in the increasing or in the decreasing order) sequence of positive numbers, ending with a -1. You can assume that there are atleast three numbers before the ending -1.
ReplyDeleteNote : -1 is not a part of input. It only signifies that input has ended.
Let us call the sequence x0 x1 ... xn -1.
You have to output 1 if there are atleast three distinct numbers in the sequence.
otherwise output 0
Kindly do not use arrays in the code.