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 <vector> | |
#include <string> | |
#include <numeric> | |
#include <iostream> | |
#include <algorithm> | |
constexpr size_t CHAIR_COUNTS = 8; | |
constexpr size_t OCCUPIED_STATE = 3; | |
void wait(std::vector<int>& chairs, size_t customer) |
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
using System; | |
using System.Linq; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
namespace ESM | |
{ | |
public interface IHand | |
{ |
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 <vector> | |
#include <string> | |
#include <cstdlib> | |
#include <iostream> | |
#include <algorithm> | |
#include <unordered_map> | |
std::string nextRoot(const std::string & root, int sideway) | |
{ | |
static const std::unordered_map<std::string, std::string> um = { |
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
START_POS = %w(a b c) | |
MAP = [ | |
[ 'ab', 'ac', 'ac', 'a', 'a', 'ab', 'a', '', 'a' ], | |
[ 'bc', 'b', 'ab', 'ab', 'bc', 'b', '', 'b', 'b' ], | |
[ 'c', 'bc', 'c', 'bc', 'ac', 'ac', 'c', 'c', '' ], | |
] | |
def can_goal(str, path) | |
return !str.empty? if (path.empty?) or (str.empty?) |
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
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Text.RegularExpressions; | |
namespace Problem | |
{ | |
public interface IType | |
{ | |
bool IsStrongerThan (IType other); |
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 <set> | |
#include <regex> | |
#include <queue> | |
#include <vector> | |
#include <string> | |
#include <iostream> | |
#include <algorithm> | |
const std::size_t base = 16; |
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 <queue> | |
#include <regex> | |
#include <string> | |
#include <bitset> | |
#include <sstream> | |
#include <iostream> | |
#include <algorithm> | |
const int width = 8; | |
const int height = 8; |
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
const flatten = (ary) => { | |
return [].concat(...ary); | |
}; | |
const parse = (src) => { | |
return flatten(flatten(src.split('/').map((rect) => { | |
return rect.split('-'); | |
})).map((pt) => { | |
return pt.split(','); | |
})).map((s) => { |
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 <vector> | |
#include <string> | |
#include <memory> | |
#include <iostream> | |
#include <algorithm> | |
#include <unordered_map> | |
struct is_tetromino | |
{ | |
bool operator()(char chr) |
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 <regex> | |
#include <string> | |
#include <vector> | |
#include <numeric> | |
#include <iostream> | |
#include "boost/algorithm/string.hpp" | |
class Triomino | |
{ | |
public: |