Wednesday, 5 March 2014

Problem 1

Round 3 starts tonight. 
5 problems will be uploaded tonight. You have till 9 p.m on 6th March to solve these problems.
This round is open for everyone.
Here's your first problem:

Input:
The input begins with two positive integers n k (n, k<=107). The next n lines of input contain one positive integer t(i) each.
Output:
Write a single integer to output, denoting how many integers t(i) are divisible by k.


Example:
Input:
7 3
1
51
966369
7
9
999996
11

Output:

4

Round 3 for DCL....your FINAL chance !!

Round 3 for DAVIET Coding League will be help today.
This round is open for all and it is your final chance to make it to the finals. 5 questions will be posted today and 5 quickest contestants will be chosen for the final round !!
CODE! COMPILE ! CHEER!!
Stay tuned ...

Top 10 finalists from round 2

Greetings DCLites....
Great effort by all of you...
Here is the list of finalists from this round of coding league(ranks in order) :
1. Kartik Puri
2. Harkirat Singh
3. Arshpreet Singh Wadhera
4. Sukhraj Singh
5. Anjan Kaur
6. Rakshit Kuthiala
7. Naveen
8. Rishab Handa
9. Divyanshu Marwah
10. Sourav Sehgal

Final round for these top 10 will be held on 7th march at 10.30AM in lab 2.
for any queries contact our team.

Tuesday, 4 March 2014

Problem #9

Description :
Given n, calculate the sum LCM(1,n) + LCM(2,n) + .. + LCM(n,n), where LCM(i,n) denotes the Least Common Multiple of the integers i and n.

Input :
Input contain an integer n.

Output :
Output contains the required sum i.e LCM(1,n)+LCM(2,n) + .. + LCM(n,n).

Sample Input :
2
Sample Output :
4

Monday, 3 March 2014

Problem 8

Given a string, find the number of palindromic substring of the string whose length is a prime number. The string consists only of lower case English alphabet. These palindromes need not be distinct.
Note:
1. Palindrome is a string which when reversed is the same. e.g: nitin
2. 1 is not a prime number.

Sample Test Cases:
palindromicPrime ("abac")=1
Explanation: The palindromic substrings in the string are "a", "b", "a", "c" and "aba" but only "aba" is of prime length. So output is 1.

palindromicPrime ("ababac")=4
Explanation: The palindromic substrings in the string are "a", "b", "a", "b", "a", "c", "aba", "aba", "bab" and "ababa". The prime length palindromes are "aba", "aba", "bab" and "ababa". So output is 4. Here we take both "aba" and "aba" as two different palindromes.