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

0 Members and 1 Guest are viewing this topic.

Offline drdrb

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

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #15 on: July 15, 2015, 01:19:29 pm »

lol it was typo "Separated" => "Operated" :P :-P [Auto Correct ]
Okay in that case, updated:
Code:
Only registered users can see contents. Please click here to Register or Login.

Offline drdrb

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

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #16 on: July 15, 2015, 01:22:33 pm »
The minifier you are using also renames variable names?  8-)

Offline pK12

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

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #17 on: July 15, 2015, 01:24:05 pm »
The minifier you are using also renames variable names?  8-)


No just removed new lines and tabs and more than one space


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

Offline drdrb

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

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #18 on: July 15, 2015, 02:17:48 pm »
Solution for 2nd:
Code:
Only registered users can see contents. Please click here to Register or Login.
- I have used algorithm.h for swap function because it is too mainstream to write one  /:)  Yeah could have also used other library functions for permutations too but that would kill the idea of writing code so wrote that myself, though don't know about its efficiency
- Sorting function is messed up in the sense of running time. I don't remember which was the best method to sort  :V
- If possible use some minifier that also renames variables  :O)

Offline pK12

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

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #19 on: July 15, 2015, 03:10:57 pm »
 o_O  Looking for more participants....

Offline pK12

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

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #20 on: July 15, 2015, 04:50:50 pm »
Solution for 2nd:
sed algorithm.h for swap function because it is too mainstream to write one  /:)  Yeah could have also used other library functions for permutations too but that would kill the idea of writing code so wrote that myself, though don't know about its efficiency
- Sorting function is messed up in the sense of running time. I don't remember which was the best method to sort  :V
- If possible use some minifier that also renames variables  :O)


You forget to include math.h

Offline pK12

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

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #21 on: July 15, 2015, 04:53:46 pm »
@drdrb see this
Quote/Ask Question



98723
Abort trap: 6


[Process completed]


AND

drdrb ; exit;
999
123456logout

[Process completed]





lol 999 has 123456 rank  :P :O)
« Last Edit: July 15, 2015, 04:59:47 pm by pK12 »

Offline drdrb

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

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #22 on: July 15, 2015, 05:01:03 pm »

You forget to include math.h
Not required :| It works fine. Algorithm i think includes that pow function

@drdrb see this
:| Damn i thought the max no was 9999, increased value now
Code:
Only registered users can see contents. Please click here to Register or Login.

Offline drdrb

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

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #23 on: July 15, 2015, 05:01:51 pm »
@drdrb see this



lol 999 has 123456 rank  :P :O)
:|
Lol it generated 6 no's, so its outputting 1 2 3 4 5 6 as different  :forever_alone [size=78%] and i forgot to do break[/size]

Offline pK12

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

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #24 on: July 15, 2015, 05:02:23 pm »
:|


There is more


Quote/Ask Question
9090
18192021logout

Rahul Baba Style :O)

Offline drdrb

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

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #25 on: July 15, 2015, 05:03:26 pm »

There is more


Should be fixed now
Code:
Only registered users can see contents. Please click here to Register or Login.
:D

Offline pK12

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

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #26 on: July 15, 2015, 05:04:22 pm »
Should be fixed now
Code:
Only registered users can see contents. Please click here to Register or Login.
 :D


add cmath in header

Offline drdrb

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

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #27 on: July 15, 2015, 05:04:57 pm »

add cmath in header
Why :| Its running without it too  :O)

Offline pK12

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

    • BVP
    • _
      IT
    • View Profile
Re: Code Champ Season 1
« Reply #28 on: July 15, 2015, 05:07:17 pm »
Why :| Its running without it too  :O)


You have added pow which is in math or math.h (depends upon compiler it may already inherited in algorithm).


Here is more


Quote/Ask Question
999
2logout

:O) :O)


Offline drdrb

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

    • USIT
    • _
      CSE
    • View Profile
Re: Code Champ Season 1
« Reply #29 on: July 15, 2015, 05:09:28 pm »

You have added pow which is in math or math.h (depends upon compiler it may already inherited in algorithm).


Here is more



But its compiling without it right too? :P I think alogirthm is including that function too :|

As for second its fixed in updated version:

 

Google Code Jam 2011

Started by nanz

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

Started by anki

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

Started by abhiroop_18

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

Started by Rsahni47

Replies: 0
Views: 643
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