c/c++, C/C++ Programming

Assignment Help:
Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Necklaces require polishing the jewels.

Operationally, all jewels of the same colour can be polished in one sitting. Cost of polishing increases with every sitting. Your task is to minimize the cost of polishing the necklace, given following conditions

Jewels can only be removed for polishing from either end of the necklace (i.e. head or tail)
Cost of polishing = Sitting Number * Colour Value of the Luminous Jewel
The necklace is represented as a String and each character of the string is a Luminous Jewel
Similar character is the same Luminous Jewel which has same Colour Value

Colour Value for different Jewels named from a to z are 1 to 26 respectively. For e.g. a = 1, b = 2, ... z = 26.

Input Format:

First line starts with T, number of test cases. Each test case T contains a necklace (N).

Related Discussions:- c/c++

C++, #include long BixFunction(int x, int y = 5, float z = 5) { return...

#include long BixFunction(int x, int y = 5, float z = 5) { return(++x * ++y + (int)++z); } int main() { cout return 0; }

Source code, processing two jobs through 2 machine

processing two jobs through 2 machine

Algorithm, What is an algorithm and write an algorithm to calculate the sim...

What is an algorithm and write an algorithm to calculate the simple interest

Explain relational operators, Relational Operators A relational operato...

Relational Operators A relational operator is used to make comparison among two values. All these operators are binary and needs two operands. There are the following relationa

C++ and matlab, ">http://www.ee.nmt.edu/~erives/289_F12/EE289_Takehome_2.p...

">http://www.ee.nmt.edu/~erives/289_F12/EE289_Takehome_2.pdf http://www.ee.nmt.edu/~erives/289_F12/Takehome2_maze.GIF

Decoding, how to decode a number from mobile keypad

how to decode a number from mobile keypad

Two dimension array- c program, 2-D Array- C program: Define a two dim...

2-D Array- C program: Define a two dimension array using c. void convert ( int a[10][10] , int[] , int , int); void main()   {   clrscr();   int a[10][10], b[10

Return by reference, Return by reference: The return value of the funct...

Return by reference: The return value of the function must be an address variable.  In following program the function returns the value of x or y and their types are declare

Determine the capacitor voltage by c program, Write a program to determine ...

Write a program to determine V c for a given value of time (t)   #include stdio.h #include math.h void main() {      char prompt;   float vs,cr,t,vc;   /* input time */

Define some important point for bit fields with structures, Define some Imp...

Define some Important Point for bit fields with structures? Only n lower bits will be assigned to an n bit number thus type cannot take values larger than 15 (4 bits long)

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd