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
| # 16進数→2進数 | |
| s/0/0000/g | |
| s/1/0001/g | |
| s/2/0010/g | |
| s/3/0011/g | |
| s/4/0100/g | |
| s/5/0101/g | |
| s/6/0110/g | |
| s/7/0111/g | |
| s/8/1000/g |
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
| javascript:var e,i,p,u,m,k="1e100.link/";e=document.getElementsByTagName("a");for(i=0;i<e.length;i++){u=e[i].getAttribute("href");if(u&&u.indexOf(k)>=0){e[i].setAttribute("href",u.replace(k,""));}if(u&&u.match(/jpg|jpeg|png|gif/i)){e[i].setAttribute("target","_blank");}if(u&&u.indexOf("amazon.jp/")>=0){e[i].firstChild.style.border="dashed 2px red";}}e=document.getElementsByTagName("i");for(i=0;i<e.length;i++){if((e[i].textContent=="DELETED")||(e[i].textContent=="CHECKING")){p=e[i].parentNode;u=p.getAttribute("href");m=document.createElement("img");p.appendChild(m);m.setAttribute("src",u.replace("newpage:",""));m.style.border="solid 1px yellow";}}; |
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
| -module(subpalin). | |
| -compile(export_all). | |
| %% 解く | |
| solve(Data) -> integer_to_list(palinnum(Data)). | |
| %% 回文の最大長を返す | |
| palinnum([]) -> 0; | |
| palinnum(L) -> lists:max([palinnum2(S) || S <- tailcombi(L)]). |
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
| %% トップクラスだけが知る「このアルゴリズムがすごい」 - 「探索」基礎最速マスター | |
| %% http://www.itmedia.co.jp/enterprise/articles/1002/06/news001_3.html | |
| -module(cutsticks). | |
| -compile(export_all). | |
| %% 最大試行回数 | |
| -define(MAXTRIALS, 100). | |
| %% 解く |
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
| -module(sleepmonster). | |
| -compile(export_all). | |
| %% 武器・モンスター対応表 {武器, 倒せるモンスター, 得られる武器} | |
| table() -> [{$a, $B, $c}, {$c, $D, $e}, {$e, $F, $g}, | |
| {$g, $H, $i}, {$i, $J, $k}, {$k, $L, $a}]. | |
| %% 解く | |
| solve(Data) -> | |
| Arms = lists:usort([X || X <- Data, X > $Z]), % 小文字のみ集める |
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
| -module(crosscircle). | |
| -compile(export_all). | |
| %% 解く | |
| solve(Data) -> | |
| integer_to_list(solve([{X, 0} || X <- Data], 0)). | |
| solve([], Total) -> | |
| Total; | |
| solve([{FirstChar, _} | Rest], Total) -> |
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
| -module(blocktub). | |
| -compile(export_all). | |
| %% 問題を解く | |
| solve(Data) -> | |
| integer_to_list(pit_count([Digit - $0 || Digit <- Data])). | |
| %% 窪みの数を計算する | |
| pit_count(Data) -> | |
| Max = lists:max(Data), % 壁の最大高さ |
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
| UPDOWN START TEST ;TESTからスタートする | |
| ;解くルーチン | |
| ;GR1=値, GR2=カウンタ, GR0=戻り値 | |
| SOLVE OR GR1,DC0 ;値が0ならカウンタ値を返す | |
| JNZ NOT0 | |
| LAD GR0,0,GR2 | |
| RET | |
| NOT0 CPL GR1,DC3 ;値が3ならカウンタ値に3を加えて返す | |
| JNZ NOT3 |
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
| -module(updown). | |
| -compile(export_all). | |
| solve(Data) -> | |
| integer_to_list(op_count(list_to_integer(Data), 0)). | |
| %% 結果が1か3になるまで2で割るか1を増減し、その回数を返す | |
| op_count(1, Count) -> Count + 1; | |
| op_count(3, Count) -> Count + 3; | |
| op_count(Num, Count) -> |
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
| @echo off | |
| rem 名前 | |
| rem 自動バックアップ.cmd - BunBackupを使って自動バックアップをする | |
| rem 書式 | |
| rem 自動バックアップ.cmd | |
| rem 説明 | |
| rem BunBackupを使って自動バックアップを実行する。 |