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
// Input: N, Y ---> Output Several Numbers' Sum == Y | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
#include <functional> | |
#include <cstring> | |
#include <cstdlib> | |
using namespace std; |
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
#include<iostream> | |
#include<cstdlib> | |
namespace Test | |
{ | |
class TB; | |
class TA | |
{ | |
public: | |
TB *b; |
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
//Big Number Calculation | |
//You can Add, Subtract or Multiply a BigNumber. | |
//What's more, all the calculations are done in base 10000 system. SPEED UP!!! | |
//You can adjust base system by changing NUM_PER_BIT and NUM_PER_BIT_BIT. | |
#include<iostream> | |
#include<sstream> | |
#include<iomanip> | |
#include<string> | |
#include<cstring> |
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
//Splay Tree | |
//An array mainly used to do "Flip" action | |
//You can build Splay Tree by running 'SplayTree::Create(TreeSize)', and then you'll have an array with numbers '1 2 3 ... n' | |
//You can flip a block of numbers by running 'Tree->Flip(L,R)'. Notice, L and R are counted from 0. | |
//You can print all the numbers in Tree by running 'Tree->TryPrint()'. Also you can get the Nth number by running 'Tree->FindNth(pos)' | |
//This is an incomplete example. | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> |
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
//Prim - Minimum spanning tree | |
#include<iostream> | |
#include<algorithm> | |
#include<functional> | |
#include<set> | |
#include<vector> | |
#include<queue> | |
#include<cstring> |
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
//Modular Arithmetic Calculator(According to Fermat's little theorem) | |
//So some of the calculations can not be done. | |
//Also can be used as Expression Calculator if change "ModNumber" to INT_MAX in CalculationElement Class | |
#include <algorithm> | |
#include <stack> | |
#include <list> | |
#include <vector> | |
#include <map> |
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
//Drag your file on the excutive file | |
//C++ | |
#include <algorithm> | |
#include <map> | |
#include <functional> | |
#include <vector> | |
#include <list> | |
#include <queue> | |
#include <stack> | |
#include <bitset> |
NewerOlder