Skip to content

Speedrun Competitive Programming Contests with CodeRush Snippets

License

Notifications You must be signed in to change notification settings

101rakibulhasan/coderush-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Thanks for trying out this extension <3. It was designed to help Competitive Programmers to get access to pre-made functions and codes easily for going fast during solving. For more information or adding any issue, Go to the Github page below-

GitHub : https://github.com/101rakibulhasan/coderush-snippets

Marketplace: https://marketplace.visualstudio.com/items?itemName=101rakibulhasan.coderush

GENERAL IDEA

  1. snippets are categorized into 3 parts-

    1. general = has no snippet type brfor keyword. They are just snippets. Example: vec, arr, tw
    2. conv = has "conv_" before keyword. This type converts one type to another type. Example: 'conv_inttobits' coverts int to bits
    3. gen = has "gen_" before keyword. this type generates certain output into another variable. Example: prime numbers etc gen_prime
  2. Some Snippets requires its function to work, for example- Image Description

PREFIXES

FOR START CODE

  1. init -> Initialize C++ Main()
  2. init-cp -> CP-Initialize C++ Main()

FOR TESTCASES

  1. tw -> While-TestCase
  2. tf -> For-TestCase
  3. twsv -> While-TestCase with Special Value
  4. tweof -> While-TestCase with EOF

FOR VECTOR

  1. prnt_vec -> Print Vector
  2. vec -> Initialize Vector

FOR ARRAY

  1. prnt_Farr -> Initialize Function For Printing 1D Array
  2. prnt_arr -> Print Array
  3. arr -> Initialize Array[size] With Input
  4. arr_2d -> Initialize 2D Array
  5. prnt_arr_2d -> Print 2D Array

FOR BASIC I/O

  1. print -> Print COUT
  2. scan -> Get CIN

FOR GENERATING

  1. gen_Fprime -> Generate Prime Numbers Till N

    gen_prime -> (vector) Initialize Prime Numbers Generator

  2. gen_Fprimefactors -> (vector) Generates Prime Factors Function

    gen_primefactors -> (vector) Initialize Prime Factors

FOR CONVERSION

  1. conv_inttobits -> Convert Int To Binary

  2. conv_Fnumtostr -> (string) Convert Number to String Function

    conv_numtostr -> (string) Convert Number to String

  3. conv_Fstrtonum -> (ll) Convert String to Number Function

    conv_strtonum -> (ll) Convert String to Number

FOR ALGORITHMS

  1. Fbs -> (vec,ll) Returns Index using Binary Search Function

    bs -> (vec,ll) Returns Index using Binary Search

  2. Fprime -> (ll) Returns 1 or 0 if Prime or Not

    prime -> Initialize Prime Checker Variable

  3. Fdfs -> DFS Function

    dfs -> Initializes DFS

  4. Fbfs -> BFS Function (bfs_nodes)

    bfs -> (root,edge) BFS Initialize (bfs_nodes)

  5. Fgcd -> GCD Function

    gcd -> (ll) Returns GCD

  6. Flcm -> (ll) LCM Function

    lcm -> (ll) Returns the LCM Number

  7. Fpower -> (base^upper) Power Function

    power -> Do Power (base^powervar)

  8. Flcs -> Longest Common Subsequence Length Function

    lcs -> Longest Common Subsequence Length Between two strings

  9. Fbe -> Binary Exponent Function

    be -> Initialize Binary Exponent Function

  10. Fme -> Modular Exponentiation Function

    me -> Initilaize Modular Exponentiation Function

Data Structures

  1. olist -> Initialize Ordered List