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
Global_env = | |
{ | |
'+' => :+, | |
'-' => :-, | |
'*' => :*, | |
'/' => :/, | |
'not' => :not, | |
'>' => :>, | |
'<' => :<, | |
'>=' => :>=, |
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
module Main where | |
import IO | |
type Function = [Atom] -> Atom | |
type Env = [(String, Atom)] | |
data Atom = INT Integer | |
| REAL Double |
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
#ifndef EMATTSAN_TABTOSPACE_H | |
#define EMATTSAN_TABTOSPACE_H | |
namespace emattsan | |
{ | |
template<typename InputIterator, typename OutputIterator> | |
OutputIterator tabToSpace(int tabSize, InputIterator begin, InputIterator end, OutputIterator out) | |
{ | |
int spacingSize = tabSize; |
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 <string> | |
#include <map> | |
#include <algorithm> | |
void removeSuit(std::string::value_type& c) | |
{ | |
switch(c) | |
{ |
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 <string> | |
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <iterator> | |
#include <functional> |
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
module Answer(solve, input_cards) where | |
import Data.List | |
rank '3' = 1 | |
rank '4' = 2 | |
rank '5' = 3 | |
rank '6' = 4 | |
rank '7' = 5 |
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 <fstream> | |
#include <string> | |
#include <vector> | |
// 札の強さ(1〜14)、出せる札の条件を満たしていない場合は0 | |
std::size_t getRank(const std::string& s) | |
{ | |
static const std::string ranks = " 3456789TJQKA2o"; |
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 "answer.hpp" | |
#include <bitset> | |
#include <string> | |
#include <iostream> | |
#include <sstream> | |
#include <algorithm> | |
typedef std::bitset<100> Bitset; |
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
module Answer(solve) where | |
type Pos = (Int, Int) | |
between x1 x2 x = (x1 - x) * (x2 - x) <= 0 | |
inside x1 y1 x2 y2 x y = (between x1 x2 x) && (between y1 y2 y) | |
l_intersect :: (Pos, Pos, Pos) -> (Pos, Pos, Pos) -> String | |
l_intersect ((x11, y11), (x12, y12), (x13, y13)) ((x21, y21), (x22, y22), (x23, y23)) = |
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> | |
template<typename ITEM, typename CONTAINER> | |
int search(const ITEM& item, const CONTAINER& container) | |
{ | |
for(int i = 0; i < container.size() - 2; ++i) | |
{ | |
if((container[i] == item) && (container[i + 1] == item) && (container[i + 2] == item)) | |
{ |
OlderNewer