Skip to content

Instantly share code, notes, and snippets.

View mizuhara's full-sized avatar

Masaya Mizuhara mizuhara

View GitHub Profile
#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)
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace ESM
{
public interface IHand
{
#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 = {
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?)
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Problem
{
public interface IType
{
bool IsStrongerThan (IType other);
#include <set>
#include <regex>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
const std::size_t base = 16;
#include <queue>
#include <regex>
#include <string>
#include <bitset>
#include <sstream>
#include <iostream>
#include <algorithm>
const int width = 8;
const int height = 8;
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) => {
#include <vector>
#include <string>
#include <memory>
#include <iostream>
#include <algorithm>
#include <unordered_map>
struct is_tetromino
{
bool operator()(char chr)
#include <regex>
#include <string>
#include <vector>
#include <numeric>
#include <iostream>
#include "boost/algorithm/string.hpp"
class Triomino
{
public: