CodeChef is a non-commercial competitive programming community
Login
Username (New User? Signup) Password (Forgot Password?)
Signup
Login or
Signup with
Connect
Note
  • Publicize your achievements on your Facebook Wall.
  • Challenge your friends or ask them for help.

Site Navigation

  • PRACTICE
    • Easy
    • Medium
    • Hard
    • Challenge
    • Peer
  • COMPETE
    • All Contests
    • June Long 2012
    • May Cook-Off
    • May Long 2012
  • DISCUSS
    • Forums
    • Blog
    • Wiki
    • Facebook
    • Twitter
  • COMMUNITY
    • CodeChef Meetups
    • Campus Chapters
    • Host your Contest
    • User Groups
    • CodeChef TechTalks
    • All Educational Initiatives
  • HELP
    • Frequently Asked Questions
    • FAQ for problem setters
    • Problem Setting
    • Tutorials
    • Long Contest Ranks
    • Short Contest Ranks
    • Event Calendar
  • ABOUT
    • About CodeChef
    • Team CodeChef
    • Press Room
    • CodeChef Financials
    • CodeChef Sponsorships
    • CEO's Corner
    • Contact Us
    • About Directi
Home » Practice(EASY)
Try your hand at one of the practice
         problems, and submit your solution in the language of your choice
         (our judge accepts solutions in over 35+ languages). Receive points,
         and move up through the CodeChef ranks. Get better, and better prepare
         yourself for the competitions
  • Easy
  • Medium
  • Hard
  • Challenge
  • Peer
Name Code Successful Submissions Accuracy
Life, the Universe, and Everything TEST 15818 31.33
ATM HS08TEST 9730 23.46
Factorial FCTRL 6450 32.35
Enormous Input Test INTEST 6127 38.17
Small factorials FCTRL2 3834 20.42
Odd DCE05 3473 30.15
Turbo Sort TSORT 2204 22.19
Transform the Expression ONP 1888 40.62
Sums in a Triangle SUMTRIAN 1880 32.69
Ambiguous Permutations PERMUT2 1579 41.28
The Lead Game TLG 1399 23.6
Stone Game RESN04 1252 45.62
Paying up MARCHA1 1197 33.37
Holes in the text HOLES 1192 40.57
Yet Another Number Game NUMGAME 1023 39.5
A Very Easy Problem! EASYPROB 873 47.62
Nuclear Reactors NUKES 794 28.31
Prime Palindromes PRPALIN 741 26.55
Cooling Pies COOLING 734 42.47
Cleaning Up CLEANUP 604 48.55
Permutation Cycles PCYCLE 598 38.42
The Way to a Friends House Is Never Too Long POINTS 553 20.26
Discrepancies in the Voters List VOTERS 541 26.39
Birthday Candles CANDLE 519 22.66
GCD2 GCD2 468 20.14
Johnny and the Beanstalk MARCHA2 464 23.76
Cutting Recipes RECIPE 436 51.63
Decreasing String DECSTR 363 29.99
Not a Triangle NOTATRI 341 20.27
The Best Box J7 333 58.89
Poker POKER 303 29.77
Parenthesis DCE03 269 25.15
Open the Dragon Scroll DRAGNXOR 255 52.48
Ciel and A-B Problem CIELAB 253 50.61
Arranging the Appetizers ARRANGE 238 47.3
Three Way Communications COMM3 236 54.1
Hotel Bytelandia HOTEL 210 46.22
The White Knight E1 209 20.83
A Simple Equation EQUATION 207 20.82
Correctness of Knight Move KNIGHTMV 203 22.87
Popular Rice Recipe TIDRICE 181 51.75
Number Game Revisited NUMGAME2 176 59.51
Summing Subsets RESN05 174 28.02
The Morning Commute COMMUTE 169 53.79
Internet Media Types MIME2 153 28.26
Product of divisors D1 148 6.7
Primality Testing INSOMB1 139 21.1
Money Transformation MONTRANS 131 27.72
Top Batsmen BESTBATS 127 41.77
Distribute idlis Equally EQIDLIS 127 31.93
Rescue DCE04 124 30.24
Ciel and New Menu CIEL8STR 121 20.62
Ciel Numbers II CIELNUM2 121 19.34
Resistance RESIST 117 51.3
Misinterpretation MISINTER 113 54.12
Chef team CHEFTEAM 107 12.16
Pairing Chefs PAIRING 104 50.39
Subanagrams SUBANAGR 103 39.21
Garden Squares GARDENSQ 100 38.77
Count of Maximum MAXCOUNT 99 38.46
Sums in a cuboid CUBESUM 96 39.27
Last Digit Sum LASTDIG 96 17.28
A New Number System ACMKANPD 95 24.6
A Prime Conjecture PRIMES2 89 29.78
Count the squares D6 87 23.85
Daily Train DAILY 87 44.94
Palindromic Numbers K2 80 8.93
Collision in Space COLLIDE 79 22.38
Digit Rotation DIGROT 79 19.07
Rational Numbers SNCK04 77 23.08
Vote for the Noodle Soup NDLVOTE 76 24.4
Double Strings DOUBLE 73 61.02
Lucky Long LUCKY5 72 45.7
Sum of pairs PAIRSUM 70 12.26
Tree Product TPRODUCT 67 17.42
Little Elephant and Strings LUCKYSTR 66 48.37
Fit to Play PLAYFIT 65 33.44
Exploding Search INSOMA2 65 25.21
Make A Square MKSQR 63 43.6
Ciel Numbers I CIELNUM1 62 29.74
Spoon in Matrix SPOON 61 32.29
Count palindromes COUNTPAL 60 37.87
Generalized Arithmetic Progression Free Sequence GENARSEQ 58 22.69
Moving Coins MVCOIN 55 41.07
Lucky lucky number CHEFLUCK 54 56.25
Painting Racing Lanes RACELANE 53 39.77
Dish Distribution DISHDIS 50 23.99
Greatest Dumpling Fight DUMPLING 49 29.23
Lost Primes L3 49 25.56
One Dimensional Game of Life LIFE 47 58.43
Socializing Game around Pizza BIGPIZA 47 37.66
Jewels and Stones STONES 46 54.39
Most Popular Friend LOKBIL 45 27.12
Younger Brother CHEFBRO 42 26.77
Nikhils Dungeon NDUNGEON 42 20.74
BIT Magazine TRMAG 42 35.33
Gravel SPREAD 41 18.94
CEO Ride INSOMB6 41 17.41
Chef Travel Routes TRAVELER 41 34.81
Maximal crosses MAXCROSS 40 28.51
Little Elephant and Balance LUCKYBAL 40 44.2
Home Delivery HDELIVER 39 32.66
Word Couting WCOUNT 39 23.08
Snake Snaky SNAKY 37 15.93
Healthy dinner party C4 36 24.4
Longest Weird Subsequence LWS 35 50
The Black and White Knights BWKNIGHT 35 17.31
Packing the Golden Triangles PACKBAND 34 22.55
Remember the recipe TWSTR 32 26.35
Randomly Testing Circuits CIRCUITS 32 40.66
Lucky Count LUCKY1 32 54.17
Stacking Pancakes PANSTACK 32 35.9
Weight of Numbers WEIGHT 31 46.88
A String Game ASTRGAME 31 13.13
Infinite Grid Game IGAME 30 32.82
Breaking Into Atoms ATOMS 30 50
Chef Teams CTEAMS 29 30.13
A puzzle game H1 29 24.85
Makx Sum KSUBSUM 28 22.95
Free Shuttle Service SHUTTLE 28 59.65
Golf course F1 28 17.47
Robot Movings MOVES 27 24.48
Plant Location K1 26 27.91
Whole submatrix WINDOW2 26 17.28
Stepping Up STEPUP 26 25.34
Trip TRIP 25 8.77
Super-plane SUPERPLN 25 24.08
A-E Hash Function AEHASH 24 29.63
Brush Fire FIRE 24 23.48
Nice Quadrangles NICEQUAD 24 22.3
Rectangles Counting RECTCNT 24 20.31
Chefs new Pet HAREJUMP 24 35.77
Flu Shot Lineup FLUSHOT 23 32.76
Central Point CPOINT 22 17.37
Treasure Hunting N1 22 21.21
Tri-Hexagonal Puzzle N4 21 35.79
The Great Wall of Byteland BWALL 21 52.86
Count Relations COUNTREL 21 42.42
Rendezvous TR1 20 21.89
Obstacle Course COURSE 20 6.5
Houses and Restaurants RHOUSE 18 23.36
Byteknights and Byteknaves BYTEISLE 17 15.08
Maximal Score Path RG_01 17 18.52
Omax OMAX 17 23
Lucky Palin LUCKPAL 17 18.66
Lucky Number LUCKY2 17 15.9
Prime Pattern PRIMPATT 17 21.01
Bogosort BOGOSORT 15 27.85

SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:

Programming Competition Fetching successful submissions
Directi Go for Gold

HELP

Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:

 

  • Accepted Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark.
  • Time Limit Exceeded Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach.
  • Wrong Answer Your program compiled and ran succesfully but the output did not match the expected output.
  • Runtime Error Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section.
  • Compilation Error Your code was unable to compile. When you see this icon, click on it for more information.
  • If you are still having problems, see a sample solution here.

CodeChef is a global programming communityCodeChef hosts online programming competitions
CodeChef is a non-commercial competitive programming community
  • About CodeChef
  • About Directi
  • CEO's Corner
  • C-Programming
  • Programming Languages
  • Contact Us
© 2009 Directi Group. All Rights Reserved. CodeChef uses SPOJ © by Sphere Research Labs
In order to report copyright violations of any kind, send in an email to copyright@codechef.com
CodeChef a product of Directi
The time now is:
CodeChef - A Platform for Aspiring Programmers

CodeChef was created as a platform to help programmers make it big in the world of algorithms, computer programming and programming contests. At CodeChef we work hard to revive the geek in you by hosting a programming contest at the start of the month and another smaller programming challenge in the middle of the month. We also aim to have training sessions and discussions related to algorithms, binary search, technicalities like array size and the likes. Apart from providing a platform for programming competitions, CodeChef also has various algorithm tutorials and forum discussions to help those who are new to the world of computer programming.

Practice Section - A Place to hone your 'Computer Programming Skills'

Try your hand at one of our many practice problems and submit your solution in a language of your choice. Our programming contest judge accepts solutions in over 35+ programming languages. Preparing for coding contests were never this much fun! Receive points, and move up through the CodeChef ranks. Use our practice section to better prepare yourself for the multiple programming challenges that take place through-out the month on CodeChef.

Compete - Monthly Programming Contests and Cook-offs

Here is where you can show off your computer programming skills. Take part in our 10 day long monthly coding contest and the shorter format Cook-off coding contest. Put yourself up for recognition and win great prizes. Our programming contests have prizes worth up to Rs.20,000 and $700lots more CodeChef goodies up for grabs.

Discuss

Are you new to computer programming? Do you need help with algorithms? Then be a part of CodeChef's Forums and interact with all our programmers - they love helping out other programmers and sharing their ideas. Have discussions around binary search, array size, branch-and-bound, Dijkstra's algorithm, Encryption algorithm and more by visiting the CodeChef Forums and Wiki section.

CodeChef Community

As part of our Educational initiative, we give institutes the opportunity to associate with CodeChef in the form of Campus Chapters. Hosting online programming competitions is not the only feature on CodeChef. You can also host a coding contest for your institute on CodeChef, organize an algorithm event and be a guest author on our blog.

Go For Gold

The Go for Gold Initiative was launched about a year after CodeChef was incepted, to help prepare Indian students for the ACM ICPC World Finals competition. In the run up to the ACM ICPC competition, the Go for Gold initiative uses CodeChef as a platform to train students for the ACM ICPC competition via multiple warm up contests. As an added incentive the Go for Gold initiative is also offering over Rs.8 lacs to the Indian team that beats the 29th position at the ACM ICPC world finals. Find out more about the Go for Gold and the ACM ICPC competition here.

Domain Name Registration, Web hosting, and Website Design provided by BigRock.com