Monday, August 18, 2014

Online Compiler
Try Compilone
An online compiler that supports more than 15 programming languages.

Features like :
1) Allows you to create/save/delete Programs or Folders on server (Directory structure provided /username/SPOJ/ ..... or /username/CODECHEF/..).
2) Allows you to rename/cut/copy/paste Programs or Folders.
3) Allows you save your default template , that can be easily loaded for any program in any language.
4) Allows you to import and export your programs (Zipped format).
5) Allows you to share your codes links (secret mode).
6) Allows you change editor theme (more than 10 themes).
7) Allows you change editor Font Size.(as per requirement).
8) Allows you change editor type. (like vim,emacs)
9) Allows you to work in fullscreen editor mode.
10) Allows you to use Keyboard Shortcuts.
fb link https://www.facebook.com/compileone

Friday, January 24, 2014

For more spoj codechef codeforces topcoder solution and some interesting Tutorails please visit my site

http://www.codeshare.in 

Sunday, September 29, 2013

15567. Playing With Balls

IITKWPCN

   There are W white balls and B black balls in a bag. A magician is performing tricks by drawing balls from the bag.

    In each step, the magician randomly removes any two balls from the bag. If the drawn balls are of the same color, he will put one white ball in the bag, otherwise he will put a black ball in it. The two drawn balls from the bag from the ball are discarded.
    He keeps on doing the above tricks until there is only one ball remaining in the bag.
    Given W and B, you have to determine the probability that the color of last ball remaining in the bag is black. You should print the answer with accuracy of upto 6 decimal digits.

CODE

 

t=input()
for i in range(t):
    s=raw_input()
    str=s.split(' ')
    w=int(str[0])
    b=int(str[1])
    c=b%10
    if(b%2==0):
        print("0.000000")
    else:
        print("1.000000")
 


 



7430. Tower Of Hanoi - Revisited

Given 3 three pegs: leftmost peg A, middle peg B and rightmost peg C.Find the shortest sequence of moves that transfers a tower of n disks from the left peg A to the right peg C, if direct moves between A and C are disallowed. (Each move must be to or from the middle peg B.)

Constraints:
1. Initially the left peg A in stacked by n disks in the order of decreasing size.
2. Only one move cand be done at a time and never moving a larger one onto a smaller.
3. Number of moves will always be less than 2^64.
4. 1 <= n <= 35


CODE

t=input()
for i in range(t):
    a=input()
    print (3**a-1)

Sunday, September 15, 2013

<data:blog.pageName/> |<data:blog.title/>ubuntu proxy setting linux proxy setting "proxy-setter" ubuntu ubuntu 13.04 ubuntu 12.10 ubuntu 12.04 ubuntu 11.10 linux python proxy apt-get http https ftp gtk tool <data:blog.pageTitle/>ubuntu proxy setting linux proxy setting "proxy-setter" ubuntu ubuntu 13.04 ubuntu 12.10 ubuntu 12.04 ubuntu 11.10 linux python proxy apt-get http https ftp gtk tool "ubuntu proxy setting"
"linux proxy setting"
"proxy-setter"
"ubuntu" "ubuntu 13.04" "ubuntu 12.10" "ubuntu 12.04" "ubuntu 11.10"
"linux"
"python" "proxy apt-get"
"http" "https" "ftp" "gtk tool"


#!/usr/bin/python
#
#   "Super Proxy Setter"
#   with GTK Interface
#
#   Ubuntu proxy setting tool.
#   This sets the apt,bash and profile config-files.
#   Network proxy-settings with user-name and password can only be configured with this tool .
#  
#   Supports Ubuntu 8.04 - Ubuntu 13.04 (Latest as of Sep 2013)

#   A tool to configure proxy-settings in universities and office environmment.
#   It Eliminates the need of doint editing again and again of system files that is prone to frequent manual errors. 
#   Atleast 3 different configuration files needs to be modified to configure proxy settings,
#   especially the network proxy-settings with username and password.
#   This can be used in an environment where ("http","https" and the "ftp") proxies have the same or different settings.
#  
#
#
#
#   Author:  Abdul Qadir Faridi , Pankaj Chaudhary
#
#   E-mail:  aqfaridi[@]gmail[.]com , pankaj9310[@]gmail[.]com
#
#   Date:    16/9/2013
#   Meta:  
#            Abdul Qadir Faridi , Pankaj Chaudhary
#            Linux Community
#            ABV - Indian Institute of Information Technology and Management - Gwalior
#
#   Powered By:
#               Ubuntu 11.10 & Vi IMproved 7.3
#  
#
#   Ver.- 1.0.0
#
#   ReadMe -  1) chmod 777 spsetter
#          2) sudo ./spsetter   
#
https://github.com/pankaj9310/proxy-setter
https://github.com/aqfaridi/super-proxy-setter/blob/master/spsetter.py
https://www.dropbox.com/sh/uv6ig21btedm1kb/ppXbABcSHJ
https://www.dropbox.com/sh/uv6ig21btedm1kb/DkskxPzBIt/spsetter.zip
https://www.dropbox.com/home/proxy-setter?select=spsetter.tar.gz

Sunday, August 25, 2013

The last digit

LASTDIG
Nestor was doing the work of his math class about three days but he is tired of make operations a lot and he should deliver his task tomorrow. His math’s teacher gives two numbers a and b. The problem consist in find the last digit of the potency of base a and index b. Help Nestor with his problem. You are given two integer numbers: the base a (0 <= a <= 20) and the index b (0 <= b <= 2,147,483,000), a and b both are not 0. You have to find the last digit of a^b.


CODE



import math
t=input()
for i in range(t):
    s=raw_input()
    str=s.split(' ')
    a=int(str[0])
    b=int(str[1])
    if(b==0):
        print 1
    else:
        a=a%10
        b=b%4
        if(b==0):
            b=4
        print pow(a,b)%10
 

Kamil

KAMIL
Some kids cannot pronounce all letters, some of them they sometimes pronounce correctly and sometimes incorrectly. Kamil sometimes says T instead of K, but he never says K instead of T. Similarly he sometimes says D instead of G. Instead of R he sometimes says L and sometimes F. Of course it happens that he pronounces the letter correctly. Kamil's father always thinks how many words can mean the word spoken by his son (it doesn't matter if they are real English words).


code


for i in range(10):
    t=raw_input();
    print 2**sum(t.count(i)for i in'DFLT')