Skip to main content

Basic CP Resources

Getting Started:
  1. Getting started with the sport of competitive programming
  2. প্রোগ্রামিং কনটেস্ট এবং অনলাইন জাজে হাতেখড়ি
  3. অ্যালগোরিদম কমপ্লেক্সিটি(বিগ “O” নোটেশন)

Programming Language:
To get start with competitive programming you must be comfortable with at least one programming language. We prefer C++ because it’s more beginner’s friendly and also more useful for programming contests. Here are few topics you must learn before you start programming contest.
  1. Input/Output
  2. Data types
  3. Loop/Nested Loop
  4. If else
  5. Functions
  6. Structure
  7. String processing

Checkout this websites for resource on C++:
  1. cplusplus
  2. tutorialspoint
  3. cprogramming
  4. top coder stl C++

Create an account in vjudge:
  1. https://vjudge.net/

Try this easy problems to get used to problem solving:
  1. Greetings from LightOJ
  2. Opposite Task
  3. Second Largest
  4. Relational Operator
  5. Find Remainder
  6. Word
  7. Pangram
  8. Odd Sum
  9. Finding Square Roots
  10. Celebrity jeopardy

Comments

Popular posts from this blog

Game Theory with examples

Game Theory with examples Introduction In this article I will be covering problems related to two players game in which it is assumed that both players play optimally and we have to find out the winner of the game. First we will look at the  basic   division of positions to winning and losing . Then we will see the  Game of Nim  and then see how it will be used to solve the  Composite games . Basic Division of positions to winning and losing Problem Statement:  Consider a simple game played by two players A and B . There are n stones on the table. Each player can pick 1 , 2 or 5 stones in each turn. Both players pick the stones alternately until the total number of stones left on the table is 0. The player unable to make the move will lose. Assuming that both the players play optimally, output the winner of the game. Solution:  As you can see positions 1 , 2 and 5 are winning positions since the player can pick up all the stones and other player will n...

Breaking The Summation Formula (Part 1)

 Q. f ( n ) =  - 1 + 2 - 3 + .. + ( - 1) n n .  Given n, find out f(n) Approach(1)- Bruteforce: 1. Calculation sum=n*(n+1)/2 2. loop[i=1,i=n : i+=2] odd+=i 3.ans=sum-2*odd Code: #include < bits / stdc ++. h > using namespace std ; int main (){   long long x ; cin >> x ; long long p =( x *( x + 1 ))/ 2 ; long long bad = 0 ; for ( long long i = 1 ; i <= x ; i += 2 ) bad += i ; cout << p - 2 * bad << endl ; } Approach(2)-Greedy: Basic: s=1+2+3+4+....+n Formula: sum=n*(n+1)/2= (n/2) + (n+1).2 ...

NT Part 2: Generating Primes, Prime Test, Prime Factorization

  Generating primes fast is very important in some problems. Let's cut to the chase and introduce Eratosthenes's Sieve. The main idea is the following. Suppose we want to find all primes between 2 and 50. Iterate from 2 to 50. We start with 2. Since it is not checked, it is a prime number. Now check all numbers that are multiple of    except  2. Now we move on, to number 3. It's not checked, so it is a prime number. Now check all numbers that are multiple of  ,   except  3. Now move on to 4. We see that this is checked - this is a multiple of 2! So 4 is not a prime. We continue doing this. Here's the implementation. #include <stdio.h> int primechk [ 21000 ] ;   void preprocess ( void ) { int i, j ; for ( i = 2 ; i <= 20000 ; i ++ ) { primechk [ i ] = 1 ; } for ( i = 2 ; i <= 20000 ; i ++ ) { if ( primechk [ i ] == 1 ) { for ( j = 2 ; i * j <= 20000...