Вы находитесь на странице: 1из 4

UVCE NCODE 3.0 [IEEE UVCE PROGRAMMERS CLUB] UVCE NCODE is back again with another coding contest.

Its simple. There are five Problems. Your job is to code the solutions to them in either C or C++. Exciting prizes are in store for the winners. This is a free and open event for all students. Submissions and queries can be made to: uvce.ncode@gmail.com Last Date for submissions: 23rd October 2011 (Sunday)

Problem 1

[15 Points]

Given an array of 1s and 0s, find the largest subset of array with equal no of 1's and 0's.

INPUT First line of input contains the number of test cases (T Each line contains an input of 1s and 0s of max length N. (N OUTPUT The size of the largest block of 1s and 0s SAMPLE INPUT 3 1110110011101100001 11111 SAMPLE OUTPUT 6 4 0 Explanation: In case 1, from position 3 to position 8. In case 2, position 1 to position 4.

Problem 2

[Points 15]

The three endpoints of a are triangle given, determine whether a given point is lying inside the triangle or not. INPUT First line of input contains the number of test cases (T Each test case consists of 4 sets of values corresponding to: (x1,y1), (x2,y2), (x3,y3) and (x,y).

Where (x,y) corresponds to the point for which the location has to be determined. OUTPUT Whether the point lies Inside or Outside. (lying on the line is also counted as lying inside in the triangle.) SAMPLE INPUT 2 0 0 100 0 0 100 20 20 0 0 100 0 0 100 300 300 SAMPLE OUTPUT Inside Outside Problem 3 Eg: Hello H,E,L,L,O,LL = 6 MADAM M,A,D,A,M,ADA,MADAM=7 [Points 20]

Given a string, find the number of palindromes in the string.

INPUT First line of input contains the number of test cases (T Next T lines contains a string in each line. OUTPUT Number of palindromes in the string. SAMPLE INPUT 2 HELLO MADAM SAMPLE OUTPUT 6 7 Problem 4 [Points 25]

Given a rectangle of dimension MxN, made up of unit squares. Find the number of unit squares the diagonal passes through. INPUT First line of input contains the number of test cases (T SAMPLE INPUT 2 55 34 SAMPLE OUTPUT 5 6 Problem 5 [Points 15]

Given a number n, find remainder when (n! + (n-1)! + (n-2)! + ......1! +0!) is divided by 100. INPUT First line of input contains the number of test cases (T SAMPLE INPUT 2 3 8 SAMPLE OUTPUT 10 34

Congratulations to Priyanka(III Sem CSE), Meghna(VII Sem ISE) and Ramitha(III Sem CSE), the winners of Ncode 2.0!!! RULES: i) All programs must run on a Turbo C/ Turbo C++ or GCC compiler. Java programs are also accepted. ii) Please provide your name, branch, semester and contact number along with your submissions. iii) Winners will be chosen on a first come basis (So get coding to get a head start on your competition). iv) You may submit one solution at a time or in bulk, but please mention the problem number along with your details in your e-mails.

v) vi)

Solutions may also be submitted offline in pen drive, at IEEE UVCE room. Judges discretion is final in all matters.

For further details or any queries contact: Sairam 9740452194 Bijil 9880842687 Bharath - 9620052277

Вам также может понравиться