Author Topic: Code Champ Season 1  (Read 24321 times)

0 Members and 1 Guest are viewing this topic.

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Code Champ Season 1
« on: July 15, 2015, 10:30:20 am »

Code Champ Season 1


In this code champ season there will be five challenges. The overall time period of this code champ season 1 is 8 days.


Start date : 15 July 2015, 11:00 AM


End Date : 23 July 2015, 11:00 AM


There will be five challenges will be given within season 1.


The bonus points will be awarded for each challenge as  :


Lowest execution time of main algo : 20 Points
Lowest source code size: 15 Points
Lowest memory: 20 Points


The maximum point gainer will win a challenge. In case of tie they will be given considered both as winner of a specific challenge


Final winner will be the one who got maximum points after completing season 1.


So get ready...



Participating languages
NodeJs, C, C++, Java, PHP, HTML5(html+css+javascript based), Python
« Last Edit: July 16, 2015, 09:44:47 pm by pK12 »
You do not have permission to give points
point 0 Points

This topic did not receive points.

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #1 on: July 15, 2015, 10:31:01 am »
« Last Edit: July 16, 2015, 09:45:34 pm by pK12 »

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #2 on: July 15, 2015, 10:31:17 am »
Submissions:



:=> Challenge 1

:=> Challenge 2

:=> Challenge 3

Updating....
« Last Edit: July 16, 2015, 09:49:09 pm by pK12 »

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #3 on: July 15, 2015, 10:32:38 am »
Winners:

RESULTS NOT ANNOUNCED YET
« Last Edit: July 16, 2015, 09:50:00 pm by pK12 »

Offline drdrb

  • Super Member
  • *
  • Points: 2688
  • Posts: 1583

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #4 on: July 15, 2015, 10:34:32 am »
Lowest source code size: 15 Points <== L-)  mazak hai kya? ab toh variables ke name bhi ek letter se zyada use ni karne padenge fir  :challenge_accepted   :O)

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #5 on: July 15, 2015, 11:07:30 am »
Challenge 1





You are given a one dimensional integer array A of length N. You need to maintain the array under Q queries of the following four types.




Query 1 : 1 x y v


This implies adding v to array A to all the indices from x to y, i.e.,
for (i = x; i <= y; i++)   
   Ai += v;
 


Query 2 : 2 x y v
This implies multiplying the scalar v with the array A for all the indices from x to y, i.e.,
for (i = x; i <= y; i++)   
        Ai *= v


Query 3 : 3 x y v
This implies initializing the array A at all the indices from x to y with the value v, i.e.,
for (i = x; i <= y; i++)   
   Ai = v


Query 4 : 4 x y
This is a report query which needs to find the sum of the values in A from x to y, i.e.,
sum = 0;
for (i = x; i <= y; i++)
   sum += Ai
   sum %= M


Output sum.
Note: a%b represents the remainder of a when divided by b.

Input
[size=78%]First line contains two space separated integers N, Q.[/size]
Next line contains N space separated integers denoting the array A.
Next Q lines contain queries which can be of any of the above four types.


Output


Print array elements separated with space after each operation. In case of Query 4 type, print since integer as result of it.


Points
All type of Queries in program : 50 Points
Any three Queries in program: 35 Points
Any two Queries in program: 20 points


One query in program:8 Points


Example


Input:
4 4
1 2 3 4
4 1 4




Output:

Time Before algo => ....
10
Time after algo => ....



Explanation


Initial A : [1, 2, 3, 4]
Result of first query : 1 + 2 + 3 + 4 = 10




You have to print time in milliseconds for each query. For example if i enter Query 1 on my array then you will first print time in milliseconds after that do your algo and after printing result of query you have to again print time of that moment in milliseconds

use this to print time in milliseconds in C++11
Code:
Only registered users can see contents. Please click here to Register or Login.

and include
Code:
Only registered users can see contents. Please click here to Register or Login.

Languages accepted : Java,PHP,C,C++
« Last Edit: July 15, 2015, 12:33:52 pm by pK12 »

Offline drdrb

  • Super Member
  • *
  • Points: 2688
  • Posts: 1583

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #6 on: July 15, 2015, 11:13:02 am »
Please clear whether input and output streams here are different like in Online judges or we have to maintain same format i.e. first all input then output  :-D

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #7 on: July 15, 2015, 11:16:21 am »
Please clear whether input and output streams here are different like in Online judges or we have to maintain same format i.e. first all input then output  :-D


No there is nothing like first all input then output. Initially user will enter an array elements and will do specific queries in it. You have to give query result after every request. Don't forget to give time before starting algo and after algo on each query.

Offline drdrb

  • Super Member
  • *
  • Points: 2688
  • Posts: 1583

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #8 on: July 15, 2015, 11:35:29 am »
1st challenge solution:
Code:
Only registered users can see contents. Please click here to Register or Login.
Request: since you have added other languages like php too, add c# too :|  And how are you going to do that size comparison lol of source code for different langs?  :O)

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #9 on: July 15, 2015, 11:58:24 am »
1st challenge solution:

Request: since you have added other languages like php too, add c# too :|  And how are you going to do that size comparison lol of source code for different langs?  :O)


Thanks for your submission. Your source code minified version size is 896 Bytes.


It totally participants choice to choose whatever language to make shortest source code. Also i am not in windows so no C# compiler here. I anyone wants to be judge for C#. They can apply here. I will add them as judge for C# for next challenges.


Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #10 on: July 15, 2015, 12:13:59 pm »
@drdrb There is logical error in Query 3. You are printing only changed part of array in Query 3




Offline drdrb

  • Super Member
  • *
  • Points: 2688
  • Posts: 1583

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #11 on: July 15, 2015, 12:22:08 pm »
@drdrb There is logical error in Query 3. You are printing only changed part of array in Query 3




Yep i thought that was what to be printed, you wrote:
Quote/Ask Question
Print array elements operated with space after each operation.
Only operated elements :| Same is with other queries too

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #12 on: July 15, 2015, 12:32:46 pm »
Yep i thought that was what to be printed, you wrote:Only operated elements :| Same is with other queries too


lol it was typo "Separated" => "Operated" :P :-P [Auto Correct ]
« Last Edit: July 15, 2015, 12:34:41 pm by pK12 »

Offline kingofhell

  • DeathStroke
  • College Representatives
  • Full Member
  • *
  • Points: 432
  • Posts: 205

    • BPIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #13 on: July 15, 2015, 12:45:11 pm »
 :clap :clap
« Last Edit: July 15, 2015, 12:53:42 pm by kingofhell »

Offline pK12

  • Super Member
  • *
  • Points: 1172
  • Posts: 578

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #14 on: July 15, 2015, 01:15:56 pm »
Coding Challenge 2

Wap to check rank of number.

Input:


An integer N.


OUTPUT:

Rank of integer N.


For example:

If i enter "245" than the number can be maid from one "2","4","5"
are
245
254
425
452
524
542


so according to this list, rank of "245" will be 1


Example:


Input:
245


Output:
1


Points
For successful output and compilation: 50 Points.


Constraints
0=< N >= 99999





 

Google Code Jam 2011

Started by nanz

Replies: 5
Views: 3247
Last post May 23, 2011, 08:36:31 pm
by CNIOS_PRADA
hauffman code

Started by anki

Replies: 0
Views: 1329
Last post January 19, 2010, 05:54:09 pm
by anki
code requird!!!!!

Started by abhiroop_18

Replies: 0
Views: 990
Last post June 30, 2013, 11:39:14 am
by abhiroop_18
Send SMS using Code

Started by Rsahni47

Replies: 0
Views: 618
Last post July 07, 2015, 02:07:23 pm
by Rsahni47
Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49