saumyasrivastava08 / Important_Coding_Problems

10 stars 41 forks source link

important-code-snippets #32

Open navjotdadwal opened 2 years ago

navjotdadwal commented 2 years ago

Ma'am do you want code snippets or some cool problems or both please specify

saumyasrivastava08 commented 2 years ago

Ma'am do you want code snippets or some cool problems or both please specify

Example?

navjotdadwal commented 2 years ago

const int N = 3e5 + 5; const int MOD = 998244353; int fact[N], invfact[N]; int pow(int a, int b, int m) { int ans=1; while(b) { if(b&1) ans=(ansa)%m; b/=2; a=(aa)%m; } return ans; } int modinv(int k) { return pow(k, MOD-2, MOD); } void precompute() { fact[0]=fact[1]=1; for(int i=2;i<N;i++) { fact[i]=fact[i-1]i; fact[i]%=MOD; } invfact[N-1]=modinv(fact[N-1]); for(int i=N-2;i>=0;i--) { invfact[i]=invfact[i+1](i+1); invfact[i]%=MOD; } } int nCr(int x, int y) { if(y>x) return 0; int num=fact[x]; num=invfact[y]; num%=MOD; num=invfact[x-y]; num%=MOD; return num; }

navjotdadwal commented 2 years ago

code snippet for problems related to combinatorics.

navjotdadwal commented 2 years ago

Maam i am also having a small doubt that if i do the required things today and make PR tomorrow then will it be counted in hacktoberfest can you please clarify?

navjotdadwal commented 2 years ago

I also have a very cool problem set which contains problems from platforms such as codeforces, codechef, atcoder, spoj, UVA , hackerearth, hackerrank and problems which are made by me.

navjotdadwal commented 2 years ago

I also have many resources if you allow i can create 4 different issues (i) important-code-snippets (ii) best resources for competitive programming (iii) best resources for DSA preparation (iv) some really good bunch of problems topic wise in CP

navjotdadwal commented 2 years ago

i am current rated 5 star at codechef with rating of 2153 and rated expert at codeforces with rating of 1776 https://codeforces.com/profile/navjotdadwal https://www.codechef.com/users/navjot1234

saumyasrivastava08 commented 2 years ago

Maam i am also having a small doubt that if i do the required things today and make PR tomorrow then will it be counted in hacktoberfest can you please clarify?

Yes it will be counted

saumyasrivastava08 commented 2 years ago

I also have many resources if you allow i can create 4 different issues (i) important-code-snippets (ii) best resources for competitive programming (iii) best resources for DSA preparation (iv) some really good bunch of problems topic wise in CP

Yeah that sounds cool go a head with these and add your questions over there . Dont create a lot of issues for similar things