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<vector> | |
#include<iostream> | |
using namespace std; | |
class BinaryCode { | |
private: | |
char decodeChar(const string& message, const string& decoded, int pos){ | |
if(pos == 1) return (getIntFromChar(message[pos-1]) - getIntFromChar(decoded[pos-1]) + '0'); | |
return (getIntFromChar(message[pos-1]) - getIntFromChar(decoded[pos-2]) - getIntFromChar(decoded[pos-1]) + '0'); | |
} |
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<vector> | |
#include<iostream> | |
using namespace std; | |
class BinaryCode { | |
public: | |
vector<string> decode(string message){ |
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 <sstream> | |
#include <cmath> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
unsigned long long factorialDivide(int num, int den){ | |
unsigned long long rValue = 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
#include <sstream> | |
#include <cmath> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <iterator> | |
#include <set> | |
#include <list> | |
#include "graphs.h" |
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
int PenLift::numTimes(vector<string> segments, int n) | |
{ | |
transform(segments.begin(), segments.end(), | |
back_inserter(m_inLines), PenLift::getLine); | |
mergeLines(); | |
intersectLines(); | |
createGraph(); | |
vector< Graph<Point> > g = m_graph.getConnectedGraphs(); | |
if(n % 2 == 0) | |
return (g.size() - 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
#include <iostream> | |
using namespace std; | |
class TheBoredomDivTwo { | |
public: | |
int find(int n, int m, int j, int b); | |
}; | |
int TheBoredomDivTwo::find(int n, int m,int j, int b){ |