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 <vector> | |
#include <algorithm> | |
using namespace std; | |
vector<int> v, c; | |
vector< vector<int> > DP; | |
void pick(int i, int w) |
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 "csv.h" | |
#include <fstream> | |
#include <sstream> | |
#include <stdexcept> | |
Csv::Csv(const string &dir) | |
{ | |
directory = dir; | |
read(dir); | |
} |
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <climits> | |
#include <string> | |
using namespace std; | |
vector<int> rc; | |
vector< vector<int> > DP, splits; |
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <climits> | |
using namespace std; | |
vector<int> rc; | |
vector< vector<int> > DP; |
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 <vector> | |
#include <climits> | |
#include <algorithm> | |
using namespace std; | |
vector<int> rc; | |
int B(int i, int j) |
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 <functional> | |
#include <deque> | |
#include <vector> | |
using namespace std; | |
template<typename T> | |
deque<T> find_lis(const vector<T> &a, | |
function<bool(const T &, const T &)> comp = [&](const T &a, const T &b)->bool { return a < 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
/* | |
sample run: | |
./measure-run-time < source-input.txt | |
output: | |
2 | |
4 | |
100 | |
** elapsed time: 0.523ms ** |
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
[bruceoutdoors@BruceManjaro bash]$ ./sjf.sh input.txt | |
Process Name: P1 | |
Arrival Time: 2 | |
Burst Time: 6 | |
Priority: 7 | |
Process Name: P2 | |
Arrival Time: 1 | |
Burst Time: 8 | |
Priority: 1 |
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
/** | |
* Signal.hpp | |
* - Simple implementation of the Signal and Slot (Observer pattern) mechanism. | |
* Requires C++11 compatible compiler. | |
* | |
* @author Lee Zhen Yong | |
*/ | |
#pragma once |
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
function Leaf(name) | |
{ | |
this.Name = name; | |
this.ParentBranch = null; | |
} | |
Branch.prototype = new Leaf(); | |
Branch.prototype.constructor = Branch; | |
Branch.prototype.Super = Leaf.prototype; |