Lagrange polynomial
Problem link: F. The Sum of the k-th Powers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more...
Showing posts with label Number Theory. Show all posts
Showing posts with label Number Theory. Show all posts
Chinese Remainder Theorem
Resources:
Chinese Remainder Theorem
Chinese Remainder Theorem ( E-Maxx)
GeeksForGeeks
forthright48 - Coprime Moduli part1
forthnight48- Non Coprime Moduli part 2
Codeforces article
Problems:
Chinese Remainder Theorem (non-relatively prime moduli)
Cheese and Random Toppings SOLUTION
1319...
FACT0 - Integer Factorization (15 digits)
FACT0 - Integer Factorization (15 digits)
টপিকঃ প্রাইম ফ্যাক্টর
হিন্টঃ সিভ দিয়ে করলে টাইম লিমিট, নরমালি করতে হবে। প্রথমে x = ২ দিয়ে যতবার যায় ভাগ তারপর ৩ দিয়ে , এরপর ৫ দিয়ে...
যখন x*x >N হয়ে যাবে তখন লুপটা ব্রেক হবে।
এরপর শেষে সংখ্যাটি ১ এর চেয়ে বড় থাকলে ওইটা একটা প্রাইম নাম্বার হবে, আর প্রতিবার ভাগ করার সময় একটা কাউন্ট রাখবো...
প্রাইম জেনারেশন সিভ ও প্রাইম ফ্যাক্টরাইজেশন
Resources:
প্রাইম জেনারেশন সিভ ও প্রাইম ফ্যাক্টরাইজেশন
Integer factorization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden...
PON - Prime or Not (Miller Robin)
PON - Prime or Not
Topic: Miller Robin
Resource:
Primality Test | Set 3 (Miller–Rabin)
Miller Robin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below....
Primes Counts 1 to n
Block sieving
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...
Nth Fibonacci Number
Resource
Fibonacci no in O(log N) time
Solving the Fibonacci Sequence with Matrix Exponentiation
An amazing way to calculate 10^18-th fibonacci number using 25 lines of code.
This file contains bidirectional Unicode text that may be interpreted...
Is Fibo
Is Fibo
Topic: Fibonacci
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode...
CEQU - Crucial Equation
CEQU - Crucial Equation
Topic: Linear Diophantine Equation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
...
10104 - Euclid Problem
10104 - Euclid Problem
Resources
Extended Euclidean Algorithm
এক্সটেন্ডেড ইউক্লিডীয়ান অ্যালগোরিদম
Extended Eu
Modular Arithmetic for Beginners
...
GCD and LCM
GCD and LCM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...
Find n-th lexicographically permutation of a string
Find n-th lexicographically permutation of a string
Complexity: O(string length)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
...
11029 - Leading and Trailing
11029 - Leading and Trailing
Topic: Binary Exponentiation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
...
1230 - MODEX
1230 - MODEX
Modular Arithmetic for Beginners
Topic: Binary Exponentiation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode...
1005 - Rooks
1005 - Rooks
Topic: combinatorics + Binomial Coefficient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn...
DCP-23: Another Bigmod Problem
DCP-23: Another Bigmod Problem
Topic: BigMod
solution:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about...
1067 - Combinations
1067 - Combinations
Topic: Counting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode...
Segmented Sieve
Segmented Sieve [ Number Theory ]
Zobayer Blog
Implementation 01:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include<bits/stdc++.h>
using namespace...
Euler’s Phi Function
Euler’s Phi Function:
Concept:
Shoshikkha
প্রোগ্রামিং পাতা
topH
Type 01:
( যখন একসাথে অনেক গুলোর জন্য বের করতে হবে।)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<bits/stdc++.h>
using namespace std;
#define...
1014 - Ifter Party
1014 - Ifter Party
Topic: Divisor
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
set<int>V;
int main()
{
//double start_time = clock();
#ifndef ONLINE_JUDGE
...