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 "Permutation.h" | |
namespace emattsan | |
{ | |
unsigned long long factorial(int n) | |
{ | |
static std::vector<unsigned long long> memo({1}); | |
while(memo.size() <= n) | |
{ |
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 <iomanip> | |
#include <iterator> | |
#include <algorithm> | |
#include <utility> | |
#include <vector> | |
#include <bitset> | |
typedef std::bitset<24 * 60> TimeSlot; |
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 <iomanip> | |
#include <string> | |
#include <map> | |
inline int toMin(int hm) | |
{ | |
return (hm / 100) * 60 + (hm % 100); | |
} |
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 <vector> | |
#include <bitset> | |
#include <algorithm> | |
#include <iterator> | |
class Sanwa | |
{ | |
public: | |
static const int UPPER_LIMIT = 120; |
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 <algorithm> | |
struct Cell | |
{ | |
int value; | |
int 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
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <algorithm> | |
int get_length(const std::string& values, int pos, int lengths[]) | |
{ | |
if(std::isdigit(values[pos]) && (lengths[pos] == 0)) | |
{ | |
int l[] = |
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
def das28_crp(tjc, sjc, crp, pga) | |
# pga は 0〜100 を期待している | |
0.56 * Math.sqrt(tjc) + 0.28 * Math.sqrt(sjc) + 0.36 * Math.log(crp * 10 + 1) + 0.014 * pga + 0.96 | |
end | |
def das28_esr(tjc, sjc, esr, pga) | |
# pga は 0〜100 を期待している | |
0.56 * Math.sqrt(tjc) + 0.28 * Math.sqrt(sjc) + 0.70 * Math.log(esr) + 0.014 * pga | |
end |
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 "simple.h" | |
// {'B' => 456, 'A' => 123} | |
typedef Environment<NamedNumber<'B', 456>>::Merge<NamedNumber<'A', 123>>::environment environment; | |
// B => 456 | |
auto b = Variable<'B'>::Evaluate<environment>::value; | |
// B + A => 579 | |
auto aadd_b_a = Add<Variable<'B'>, Variable<'A'>>::Evaluate<environment>::value; |
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
#!/usr/bin/ruby | |
# coding: utf-8 | |
require 'date' | |
begin | |
raise unless ARGV.size == 3 | |
date_range = ARGV.shift.match(/(\d{1,2}\/\d{1,2})-(\d{1,2}\/\d{1,2})/) { Date.parse($1)..Date.parse($2) } | |
start_time, end_time = ARGV.shift.match(/(\d{1,2}\:\d{1,2})-(\d{1,2}\:\d{1,2})/) { [DateTime.parse($1), DateTime.parse($2)] } | |
step = ARGV.shift.to_f |
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
Gem::Specification.new do |spec| | |
spec.name = "nullpo" | |
spec.version = "0.0.1" | |
spec.authors = ["e.mattsan"] | |
spec.email = ["e.mattsan@gmail.com"] | |
spec.summary = "null pointer" | |
spec.files = ["nullpo.rb"] | |
spec.require_path = "." | |
end |
OlderNewer