CodeChef Logo CodeChef Logo
Courses

Programming and DSA

Learn to think like a programmer. Develop your problem-solving skills with essential data structures and algorithms.

Career Paths

From beginner to job-ready. Explore our curated career paths designed to help you succeed in the tech industry.

Other Courses

Programming and DSA

Explore courses

Catalogue

Programming and DSA

Learn to think like a programmer. Develop your problem-solving skills with essential data structures and algorithms.

Career Paths

From beginner to job-ready. Explore our curated career paths designed to help you succeed in the tech industry.

Other Courses

Explore courses
Practice Compete Compiler
Upgrade to Pro
Courses

Programming and DSA

Learn to think like a programmer. Develop your problem-solving skills with essential data structures and algorithms.

Career Paths

From beginner to job-ready. Explore our curated career paths designed to help you succeed in the tech industry.

Other Courses

Programming and DSA

Explore courses

Catalogue

Programming and DSA

Learn to think like a programmer. Develop your problem-solving skills with essential data structures and algorithms.

Career Paths

From beginner to job-ready. Explore our curated career paths designed to help you succeed in the tech industry.

Other Courses

Explore courses
Practice Compete Compiler
Home » Wiki » December 2011 Contest Problem Editorials

December 2011 Contest Problem Editorials

Problem Tester for the contest was David Stolp.

Birthday Gift (written by Vamsi Kavala). The Editorials can be found here.

Hypertrees (written by Gennady Korotkevich). The Editorials can be found here.

Robot Movings (written by Anh Duong Quang). The Editorials can be found here.

Short II (written by Gennady Korotkevich). The Editorials can be found here.

Spinning Wheels (written by Gennady Korotkevich). The Editorials can be found here.

Ciel and Eggs (written by Hiroto Sekido). The Editorials can be found here.

One of the way to speed up

4★rajneesh2k10 @ 11 Dec 2011 11:44 PM
One of the way to speed up your computation of pascal triangle is to replace '%' operation by a '-' operation, which lead to acceptance of solution of problem MOVES by pre-computing pascal triangle. :)

how we can replace % with

1★dabbcomputers @ 12 Dec 2011 02:57 PM
how we can replace % with '-'....?? i used my own mod function to reduce complxity.... ie (x-(x/n)*n)

All the test cases cannot be

6★javadecoder @ 12 Dec 2011 04:32 PM
All the test cases cannot be worst cases,also K<=N ,so it is in order of 10^8,that is why 8s time limit...

@dabbcomputers: Since the

6★javadecoder @ 12 Dec 2011 04:35 PM
@dabbcomputers: Since the computation of pascal triangle involves only the ADDITION of previously computed results,you can rewrite the expression: C[n][r]=(C[n-1][r]+C[n-1][r-1])%mod -----------> C[n][r]=C[n-1][r]+C[n-1][r-1] ,if(C[n][r]>=mod) C[n][r]-=mod This way the computation will be much faster,as it does not involve modulus operation.
Workden, MNR PRIDE, 14, HAL Old Airport Rd, Domlur I Stage, 1st Stage, DOMLUR, Bengaluru, Karnataka 560071 [email protected] +91 95911 47880
Find us online

ROADMAPS

Learn Python
Learn Java
Learn C
Learn C++
Data structures and Algorithms
Competitive Programming
More Roadmaps

CAREER PATHS

React JS Developer
Full stack Developer
SQL for Data Analysis
Frontend Developer
Java Backend Developer
Data Analysis using Python
Python Backend Developer
C++ Developer
Machine Learning using Python

COMPILERS

HTML online compiler
C++ online compiler
C online compiler
Java online compiler
Python online compiler
SQL online compiler
JavaScript online compiler
React online compiler
More compilers

COMPANY

About us
For colleges
Coding Contests
Blogs
Contact us
Privacy Policy
Frequently Asked Questions

© 2025 CodeChef Inc. All rights reserved.

We use cookies to improve your experience and for analytical purposes. Read our Privacy Policy and Terms to know more. You consent to our cookies if you continue to use our website.