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
# python | |
def get_kai(len1): | |
len2 = get_next_box(len1) | |
len2.append(len2[len(len2) - 1]) | |
return len2 | |
def get_kaix(num): | |
len0 = [1] | |
for i in range(num): | |
len0 = get_kai(len0) |
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
MAN = true | |
WOMAN = false | |
def solve | |
row = [] | |
n_men = 20 | |
n_women = 10 | |
add(row, n_men, n_women) | |
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
M_C = 20 # 男20人 | |
F_C = 10 # 女20人 | |
pattern_cnt = 0 | |
((2**M_C - 1)..(2**(M_C + F_C) - 1)).each do |row| | |
# 男女の列をbitで表現 1:M 0:F | |
bit = (0x4000_0000 + row).to_s(2).slice((31 - M_C - F_C)..31) |
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
require 'csv' | |
require 'yaml' | |
class SupponRecord | |
# オープンクラスの同類 | |
# 特定のインスタンスを再オープンして定義を追加します | |
class << self | |
attr_accessor :index_to_attr, :master_data |