This file contains hidden or 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
#include <iostream> | |
#include <set> | |
#include <algorithm> | |
#include <iterator> | |
using namespace std; | |
int main() | |
{ | |
/* type of the collection: | |
* - no duplicates |
This file contains hidden or 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
#include <iostream> | |
#include <map> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
/* type of the container: | |
* - map: elements key/value pairs | |
* - string: keys have type string |
This file contains hidden or 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
#include <iostream> | |
#include <map> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
// type of the collection | |
typedef multimap<int,string> IntStringMMap; |
This file contains hidden or 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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int main() | |
{ | |
vector<int> coll; // vector container for integer elements | |
// append elements with values 1 to 6 | |
for (int i=1; i<=6; ++i) { |
This file contains hidden or 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
12-2-8-5 25-22-19-18 22-6 25-22-24-18 14 19-14-5-26 12-2-8-5 15-5-14-22-1 25-22-24-18 6-2-22-25 22-19 12-2-8 3-25-14-1-7 3-2-22-6-2-1-2-8-6 1-22-20-21-7-6-21-14-17-18 7-21-18-1 12-2-8 10-22-25-25 20-5-2-10 1-22-20-21-7-6-21-14-17-18 22-19 12-2-8 3-25-14-1-7 19-5-8-22-7 12-2-8 10-22-25-25 20-5-2-10 19-5-8-22-7 7-21-18 7-21-2-8-20-21-7-6 12-2-8 3-25-14-1-7 22-1 12-2-8-5 26-22-1-17 18-9-18-5-12-17-14-12 15-18-16-2-26-18 7-21-18 16-5-2-3 12-2-8-5 25-22-19-18 12-22-18-25-17-6 |
This file contains hidden or 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
7-21-22-6 22-6 18-1-16-2-17-18-17 10-22-7-21 14 16-14-18-6-14-5 16-22-3-21-18-5 |
This file contains hidden or 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
B0 = Matrix(GF(3), 5, 5) | |
B1 = Matrix(GF(3), 5, 5) | |
B2 = Matrix(GF(3), 5, 5) | |
B0[1,0] = 1 | |
B0[4,1] = 1 | |
B1[0,0] = -1 | |
B1[1,1] = -1 | |
B1[2,2] = 1 | |
B1[3,1] = -1 | |
B1[4,2] = -1 |
This file contains hidden or 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
header = ("01000000" + | |
"81cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000" + | |
"e320b6c2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122b" + | |
"c7f5d74d" + | |
"f2b9441a" + | |
"42a14695") | |
hashlib.sha256(hashlib.sha256(binascii.unhexlify(header)).digest()).digest() |
This file contains hidden or 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
header = ("01000000" + | |
"81cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000" + | |
"e320b6c2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122b" + | |
"c7f5d74d" + | |
"f2b9441a" + | |
"42a14695") | |
print hashlib.sha256(hashlib.sha256(binascii.unhexlify(header)).digest()).digest() |
This file contains hidden or 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
p=11 | |
R.<x>=PolynomialRing(GF(p)) | |
points=[(1,1), (3,3)] | |
f=R.lagrange_polynomial(points) |