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 <sstream> | |
#include <stack> | |
#include <string> | |
using namespace std; | |
int main(int argc, const char * argv[]) { | |
string line; |
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
#define DEBUG 0 | |
#include <iostream> | |
#include <sstream> | |
#include <fstream> | |
#include <stdlib.h> | |
#if DEBUG | |
#include <bitset> | |
#endif |
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 <sstream> | |
#include <fstream> | |
#include <stdlib.h> | |
#include <iterator> | |
#include <vector> | |
#include <set> | |
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 <sstream> | |
#include <fstream> | |
#include <queue> | |
using namespace std; | |
struct OrderByLength { | |
bool operator() (string const &a, string const &b) { | |
return a.length() < b.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.
Learn more about bidirectional Unicode characters
.PHONY: clean app | |
app: | |
g++ \ | |
-pedantic \ | |
-Wall \ | |
-Wextra \ | |
-Wcast-align \ | |
-Wcast-qual \ | |
-Wctor-dtor-privacy \ | |
-Wdisabled-optimization \ |
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 <sstream> | |
#include <fstream> | |
#include <vector> | |
#include <numeric> | |
#ifndef __APPLE__ | |
#include <algorithm> | |
#endif |
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 <sstream> | |
#include <fstream> | |
#include <vector> | |
#include <set> | |
#include <iterator> | |
#ifndef __APPLE__ | |
#include <algorithm> | |
#endif |
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 <sstream> | |
#include <fstream> | |
#include <stack> | |
using namespace std; | |
int main(int argc, char *argv[]) { | |
ifstream datafile(argv[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> | |
#include <string> | |
#include <vector> | |
template<typename T> | |
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) | |
{ | |
for (auto& el : vec) | |
{ | |
os << el << ' '; |
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
#define _A 7 | |
#define _B 6 | |
#define _C 4 | |
#define _D 2 | |
#define _E 1 | |
#define _F 9 | |
#define _G 10 | |
#define _DP 5 | |
#define LED_OFF 1 | |
#define LED_ON 0 |