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 <set> | |
#include <map> | |
#include <list> | |
#inlucde <queue> | |
#include <stack> | |
#include <cmath> | |
#include <ctime> | |
#include <cstdio> | |
#include <vector> | |
#include <string> |
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 func(n); (1..n).inject(:*); end | |
p func(40) / func(20) / func(20) | |
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
import Data.Char | |
fact :: Integer -> Integer | |
fact 0 = 1 | |
fact n = n * fact (n - 1) | |
main = putStrLn $ show $ sum $ map digitToInt $ show $ fact 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
/* | |
AOJ 0500 'Card Game' | |
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0500 | |
*/ | |
import std.stdio; | |
import std.array; | |
import std.range; | |
import std.conv; | |
import std.string; |
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
/* | |
AOJ 0501 'Data Conversion' | |
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0501 | |
*/ | |
import std.stdio; | |
import std.array; | |
import std.range; | |
import std.conv; | |
import std.string; |
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
{- 以下の関数を定義しなさい | |
* null | |
* sum | |
* product | |
* elem | |
* Pythonのスライス ex) slice 2 5 [1..7] # => [3, 4, 5] | |
* フィボナッチ数列のn番目の数を返す関数 | |
* FizzBuzzのn項目からm項目までを返す関数 | |
-} |
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
{- 以下の関数を定義しなさい | |
* 与えられた文字列を大文字に変換する関数 | |
* 与えられた文字列から空白を除去する関数 | |
* リスト lst1 が lst2 を含んでいるかどうかを判定する関数 | |
* 配列から重複する要素を削除する関数 | |
* 与えられた正数から二進表記の文字列を得る関数 | |
-} | |
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
/* | |
* 以下の要件を満たしバケットソートをする関数を作れ | |
* ・値の範囲は0~9の整数 | |
* ・関数の引数は配列のポインタと配列サイズ | |
* ・カウンタ変数を用いてはならない | |
*/ | |
#include <stdio.h> | |
#define MIN_VALUE (0) |
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
# -*- coding: utf-8 -*- | |
class Node | |
attr_accessor :message, :yes, :no | |
def initialize(message) | |
@message = message | |
@yes = nil | |
@no = nil | |
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 <map> | |
#include <stack> | |
#include <cmath> | |
#include <queue> | |
#include <bitset> | |
#include <string> | |
#include <vector> | |
#include <cassert> | |
#include <iterator> | |
#include <numeric> |
OlderNewer