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 <stdio.h> | |
| #include <string.h> | |
| #define OPEN_BRACKETS 5 | |
| #define STR_LENGTH 10 | |
| void gen(int length, int opened, int closed, char* str) { | |
| if (opened + closed == 2 * length) { | |
| printf("%s\n", str); | |
| return; |
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
| Выкачиваем pngquant, jpeg-archive и ставим ladon | |
| git clone git://github.com/pornel/pngquant.git | |
| git clone git://github.com/danielgtaylor/jpeg-archive | |
| npm install -g ladon | |
| Ставим зависимости для сборки (возможно есть ещё) | |
| apt-get install nasm mozjpeg | |
| Собираем и ставим в систему(выполнять в папках jpeg-archive и pngquant) |
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 <algorithm> | |
| #include <iostream> | |
| #include <fstream> | |
| #include <vector> | |
| #include <cmath> | |
| #include <bitset> | |
| using namespace std; | |
| std::vector<char> readFile(char* filename) { |
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 <stdint.h> | |
| #include <bitset> | |
| #include <cmath> | |
| #include <vector> | |
| #include <fstream> | |
| #include <sstream> | |
| #include <string> | |
| #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) |
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 <functional> // 1.1.7.28 | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <utility> | |
| #include <string> | |
| #include <vector> | |
| #include <cmath> | |
| typedef struct { | |
| int ground, has_motor, four_wheel, electric; |
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 <functional> // 1.1.7.28 | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <utility> | |
| #include <string> | |
| #include <vector> | |
| #include <cmath> | |
| typedef struct { | |
| int wheels, passengers, size, power; |
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 <functional> | |
| #include <algorithm> | |
| #include <iostream> | |
| #include <utility> | |
| #include <float.h> | |
| #include <string> | |
| #include <vector> | |
| #include <cmath> | |
| typedef struct { |
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
| class expression | |
| { | |
| private: | |
| static double OREXPR(std::vector<std::string> exp) { | |
| std::vector<std::string>::iterator op; | |
| if ((op = std::find(exp.begin(), exp.end(), "or")) != exp.end()) { | |
| double first = ANDEXPR(std::vector <std::string>(exp.begin(), op)); | |
| double second = OREXPR(std::vector <std::string>(op + 1, exp.end())); | |
| return first || second; | |
| } |
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
| token tryFloat(std::string str) | |
| { | |
| token result("INVALID", ""); | |
| int state = 0; | |
| for(auto x : str) | |
| { | |
| switch(state) | |
| { | |
| case 0: |
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
| token tryInt(std::string str) | |
| { | |
| token result("INVALID", ""); | |
| int state = 0; | |
| for(auto x : str) | |
| { | |
| switch(state) | |
| { | |
| case 0: |