├── .editorconfig ├── .gitignore ├── AOJ ├── ALDS1 │ ├── 01A.md │ ├── 01A_c_01.c │ ├── 01A_cp_01.cpp │ ├── 01A_fs_00.fsx │ ├── 01A_hs_01.hs │ ├── 01A_hs_02_mutable.hs │ ├── 01A_hs_03.hs │ ├── 01A_hs_04.hs │ ├── 01A_hs_05.hs │ ├── 01A_js_01.js │ ├── 01A_ml_01.ml │ ├── 01A_ml_02.ml │ ├── 01A_ml_03.ml │ ├── 01A_ml_04.ml │ ├── 01A_rs_01.rs │ ├── 01B.md │ ├── 01B_c_01.c │ ├── 01B_cp_01.cpp │ ├── 01B_fs_00.fsx │ ├── 01B_hs_01.hs │ ├── 01B_hs_02.hs │ ├── 01B_js_01.js │ ├── 01B_ml_01.ml │ ├── 01B_ml_02.ml │ ├── 01B_rs_01.rs │ ├── 01C.md │ ├── 01C_c_01.c │ ├── 01C_cp_01.cpp │ ├── 01C_cp_02.cpp │ ├── 01C_fs_00.fsx │ ├── 01C_hs_01.hs │ ├── 01C_hs_02.hs │ ├── 01C_hs_03.hs │ ├── 01C_js_01.js │ ├── 01C_js_02.js │ ├── 01C_js_03.js │ ├── 01C_ml_01.ml │ ├── 01C_ml_02.ml │ ├── 01C_rs_01.rs │ ├── 01D.md │ ├── 01D_c_01.c │ ├── 01D_c_02.c │ ├── 01D_cp_01.cpp │ ├── 01D_fs_00.fsx │ ├── 01D_fs_01_mutable.fsx │ ├── 01D_hs_01.hs │ ├── 01D_hs_02.hs │ ├── 01D_hs_03.hs │ ├── 01D_js_01.js │ ├── 01D_js_02.js │ ├── 01D_js_03.js │ ├── 01D_ml_01.ml │ ├── 01D_rs_01.rs │ ├── 02A.md │ ├── 02A_c_01.c │ ├── 02A_c_02.c │ ├── 02A_cp_01.cpp │ ├── 02A_cp_02.cpp │ ├── 02A_fs_00.fsx │ ├── 02A_fs_01.fsx │ ├── 02A_hs_01.hs │ ├── 02A_hs_02.hs │ ├── 02A_hs_03.hs │ ├── 02A_hs_04.hs │ ├── 02A_hs_05_mutable.hs │ ├── 02A_js_01.js │ ├── 02A_js_02.js │ ├── 02A_js_03.js │ ├── 02A_ml_01.ml │ ├── 02A_ml_02.ml │ ├── 02A_ml_03.ml │ ├── 02A_rs_01.rs │ ├── 02B.md │ ├── 02B_c_01.c │ ├── 02B_cp_01.cpp │ ├── 02B_fs_00.fsx │ ├── 02B_hs_01.hs │ ├── 02B_hs_02.hs │ ├── 02B_hs_03.hs │ ├── 02B_hs_04.hs │ ├── 02B_js_01.js │ ├── 02B_js_02.js │ ├── 02B_js_03.js │ ├── 02B_ml_01.ml │ ├── 02B_ml_02.ml │ ├── 02B_rs_01.rs │ ├── 02C.md │ ├── 02C_c_01.c │ ├── 02C_cp_01.cpp │ ├── 02C_fs_00.fsx │ ├── 02C_fs_01_mutable.fsx │ ├── 02C_hs_01.hs │ ├── 02C_hs_02.hs │ ├── 02C_hs_03.hs │ ├── 02C_hs_04.hs │ ├── 02C_js_01.js │ ├── 02C_js_02.js │ ├── 02C_ml_01.ml │ ├── 02C_ml_02.ml │ ├── 02C_rs_01.rs │ ├── 02D.md │ ├── 02D_c_01.c │ ├── 02D_c_02.c │ ├── 02D_cp_01.cpp │ ├── 02D_fs_00.fsx │ ├── 02D_hs_01.hs │ ├── 02D_js_01.js │ ├── 02D_js_02.js │ ├── 02D_ml_01.ml │ ├── 02D_ml_02.ml │ ├── 02D_py_01.py │ ├── 02D_rs_01.rs │ ├── 03A.md │ ├── 03A_c_01.c │ ├── 03A_cp_01.cpp │ ├── 03A_fs_00.fsx │ ├── 03A_hs_01.hs │ ├── 03A_hs_02.hs │ ├── 03A_hs_03.hs │ ├── 03A_hs_04.hs │ ├── 03A_hs_05.hs │ ├── 03A_js_01.js │ ├── 03A_ml_01.ml │ ├── 03A_ml_02.ml │ ├── 03A_rs_01.rs │ ├── 03B.md │ ├── 03B_c_01.c │ ├── 03B_cp_01.cpp │ ├── 03B_cp_02.cpp │ ├── 03B_fs_00.fsx │ ├── 03B_hs_01.hs │ ├── 03B_hs_02.hs │ ├── 03B_hs_03.hs │ ├── 03B_js_01.js │ ├── 03B_ml_01.ml │ ├── 03B_ml_02.ml │ ├── 03B_rs_01.rs │ ├── 03B_rs_02.rs │ ├── 03C.md │ ├── 03C_c_01.c │ ├── 03C_cp_01.cpp │ ├── 03C_cp_02.cpp │ ├── 03C_fs_00.fsx │ ├── 03C_hs_01.hs │ ├── 03C_hs_02.hs │ ├── 03C_js_01.js │ ├── 03C_js_02.js │ ├── 03C_ml_01.ml │ ├── 03C_ml_02.ml │ ├── 03C_rs_01.rs │ ├── 03C_rs_02.rs │ ├── 03C_rs_03.rs │ ├── 03D.md │ ├── 03D_c_01.c │ ├── 03D_cp_01.cpp │ ├── 03D_cp_02.cpp │ ├── 03D_fs_00.fsx │ ├── 03D_hs_01.hs │ ├── 03D_hs_02.hs │ ├── 03D_hs_03.hs │ ├── 03D_js_01.js │ ├── 03D_js_02.js │ ├── 03D_ml_01.ml │ ├── 03D_ml_02.ml │ ├── 03D_rs_01.rs │ ├── 04A.md │ ├── 04A_c_01.c │ ├── 04A_cp_01.cpp │ ├── 04A_fs_00.fsx │ ├── 04A_hs_01.hs │ ├── 04A_hs_02.hs │ ├── 04A_hs_03.hs │ ├── 04A_js_01.js │ ├── 04A_ml_01.ml │ ├── 04A_rs_01.rs │ ├── 04B.md │ ├── 04B_c_01.c │ ├── 04B_cp_01.cpp │ ├── 04B_fs_00.fsx │ ├── 04B_hs_01.hs │ ├── 04B_js_01.js │ ├── 04B_ml_01.ml │ ├── 04B_ml_02.ml │ ├── 04B_ml_03.ml │ ├── 04B_rs_01.rs │ ├── 04C.md │ ├── 04C_c_01.c │ ├── 04C_cp_01.cpp │ ├── 04C_fs_00.fsx │ ├── 04C_hs_01.hs │ ├── 04C_hs_02.hs │ ├── 04C_hs_03.hs │ ├── 04C_hs_04.hs │ ├── 04C_js_01.js │ ├── 04C_js_02.js │ ├── 04C_ml_01.ml │ ├── 04C_ml_02.ml │ ├── 04C_ml_03.ml │ ├── 04C_rs_01.rs │ ├── 04D.md │ ├── 04D_c_01.c │ ├── 04D_c_02.c │ ├── 04D_cp_01.cpp │ ├── 04D_fs_00.fsx │ ├── 04D_hs_01.hs │ ├── 04D_hs_02.hs │ ├── 04D_hs_03.hs │ ├── 04D_js_01.js │ ├── 04D_js_02.js │ ├── 04D_ml_01.ml │ ├── 04D_ml_02.ml │ ├── 04D_py_01.py │ ├── 05A.md │ ├── 05A_cp_01.cpp │ ├── 05A_cp_02.cpp │ ├── 05A_fs_00.fsx │ ├── 05A_fs_01.fsx │ ├── 05A_hs_01.hs │ ├── 05A_hs_02.hs │ ├── 05A_hs_03.hs │ ├── 05A_js_01.js │ ├── 05A_js_02.js │ ├── 05A_js_03.js │ ├── 05A_ml_01.ml │ ├── 05A_ml_02.ml │ ├── 05A_py_01.py │ ├── 05A_py_02.py │ ├── 05A_rs_01.rs │ ├── 05A_rs_02.rs │ ├── 05B.md │ ├── 05B_c_01.c │ ├── 05B_c_02.c │ ├── 05B_cp_01.cpp │ ├── 05B_cp_02.cpp │ ├── 05B_fs_00.fsx │ ├── 05B_hs_01.hs │ ├── 05B_hs_02.hs │ ├── 05B_hs_03.hs │ ├── 05B_js_01.js │ ├── 05B_js_02.js │ ├── 05B_js_03.js │ ├── 05B_ml_01.ml │ ├── 05B_ml_02.ml │ ├── 05B_py_01.py │ ├── 05B_py_02.py │ ├── 05B_py_03.py │ ├── 05C.md │ ├── 05C_c_01.c │ ├── 05C_c_02.c │ ├── 05C_cp_01.cpp │ ├── 05C_cp_02.cpp │ ├── 05C_fs_00.fsx │ ├── 05C_hs_01.hs │ ├── 05C_hs_02.hs │ ├── 05C_hs_03.hs │ ├── 05C_hs_04.hs │ ├── 05C_js_01.js │ ├── 05C_js_02.js │ ├── 05C_js_03.js │ ├── 05C_ml_01.ml │ ├── 05C_ml_02.ml │ ├── 05C_py_01.py │ ├── 05C_py_02.py │ ├── 05C_py_03.py │ ├── 05C_rs_01.rs │ ├── 05D.md │ ├── 05D_c_01.c │ ├── 05D_cp_01.cpp │ ├── 05D_cp_02.cpp │ ├── 05D_cp_03.cpp │ ├── 05D_fs_00.fsx │ ├── 05D_hs_01.hs │ ├── 05D_hs_02.hs │ ├── 05D_js_01.js │ ├── 05D_js_02.js │ ├── 05D_js_03.js │ ├── 05D_js_04.js │ ├── 05D_ml_01.ml │ ├── 05D_py_01.py │ ├── 05D_py_02.py │ ├── 05D_py_03.py │ ├── 05D_rs_01.rs │ ├── 06A.md │ ├── 06A_c_01.c │ ├── 06A_c_02.c │ ├── 06A_cp_01.cpp │ ├── 06A_fs_00.fsx │ ├── 06A_hs_01.cpp │ ├── 06A_hs_01_arr.hs │ ├── 06A_hs_02_intmap.hs │ ├── 06A_hs_03_vec_MLE.hs │ ├── 06A_js_01.js │ ├── 06A_js_02.js │ ├── 06A_ml_01.ml │ ├── 06A_ml_02.ml │ ├── 06A_ml_03.ml │ ├── 06A_py_01.py │ ├── 06A_rs_01.rs │ ├── 06B.md │ ├── 06B_c_01.c │ ├── 06B_cp_01.cpp │ ├── 06B_cs_01.cs │ ├── 06B_fs_00.fsx │ ├── 06B_hs_01_ioarr.hs │ ├── 06B_hs_02_iovec.hs │ ├── 06B_hs_03_marr.hs │ ├── 06B_hs_04_mvec.hs │ ├── 06B_js_01.js │ ├── 06B_js_02.js │ ├── 06B_js_03.js │ ├── 06B_ml_01.ml │ ├── 06B_ml_02.ml │ ├── 06B_ml_03.ml │ ├── 06B_py_01.py │ ├── 06B_rs_01.rs │ ├── 06C.md │ ├── 06C_cp_01.cpp │ ├── 06C_cp_02.cpp │ ├── 06C_cp_03.cpp │ ├── 06C_cs_01.cs │ ├── 06C_fs_00.fsx │ ├── 06C_hs_01_marr.hs │ ├── 06C_hs_02_mvec.hs │ ├── 06C_hs_03_mvec2.hs │ ├── 06C_js_01.js │ ├── 06C_ml_01.ml │ ├── 06C_ml_02.ml │ ├── 06C_py_01.py │ ├── 06C_py_02.py │ ├── 06C_py_03.py │ ├── 06C_rs_01.rs │ ├── 06D.md │ ├── 06D_c_01.c │ ├── 06D_cp_01.cpp │ ├── 06D_cs_01.cs │ ├── 06D_fs_00.fsx │ ├── 06D_hs_00.hs │ ├── 06D_hs_01.hs │ ├── 06D_hs_02.hs │ ├── 06D_js_01.js │ ├── 06D_ml_01.ml │ ├── 06D_ml_02.ml │ ├── 06D_py_01.py │ ├── 06D_rs_01.rs │ ├── 07A.md │ ├── 07A_c_01.c │ ├── 07A_c_02.c │ ├── 07A_cp_01.cpp │ ├── 07A_cs_01.cs │ ├── 07A_fs_00.fsx │ ├── 07A_hs_01.hs │ ├── 07A_hs_02.hs │ ├── 07A_js_01.js │ ├── 07A_ml_01.ml │ ├── 07A_ml_02.ml │ ├── 07A_ml_03.ml │ ├── 07A_py_01.py │ ├── 07A_py_02.py │ ├── 07A_rs_01.rs │ ├── 07B.md │ ├── 07B_c_01.c │ ├── 07B_cp_01.cpp │ ├── 07B_cp_02.cpp │ ├── 07B_fs_00.fsx │ ├── 07B_hs_01.hs │ ├── 07B_hs_02.hs │ ├── 07B_js_01.js │ ├── 07B_ml_01.ml │ ├── 07B_ml_02.ml │ ├── 07B_ml_03.ml │ ├── 07B_ml_04.ml │ ├── 07B_py_01.py │ ├── 07B_py_02.py │ ├── 07B_py_03.py │ ├── 07B_rs_01.rs │ ├── 07C.md │ ├── 07C_c_01.c │ ├── 07C_cp_01.cpp │ ├── 07C_cp_02.cpp │ ├── 07C_fs_00.fsx │ ├── 07C_hs_01.hs │ ├── 07C_hs_02.hs │ ├── 07C_js_01.js │ ├── 07C_ml_01.ml │ ├── 07C_ml_02.ml │ ├── 07C_py_01.py │ ├── 07C_rs_01.rs │ ├── 07D.md │ ├── 07D_c_01.c │ ├── 07D_c_02.c │ ├── 07D_cp_01.cpp │ ├── 07D_cp_02.cpp │ ├── 07D_fs_00.fsx │ ├── 07D_hs_00.hs │ ├── 07D_hs_01.hs │ ├── 07D_hs_02.hs │ ├── 07D_hs_03.hs │ ├── 07D_js_01.js │ ├── 07D_js_02.js │ ├── 07D_ml_01.ml │ ├── 07D_ml_02.ml │ ├── 07D_ml_03.ml │ ├── 07D_py_01.py │ ├── 07D_py_02.py │ ├── 07D_rs_01.rs │ ├── 08A.md │ ├── 08A_c_01.c │ ├── 08A_cp_01.cpp │ ├── 08A_fs_00.fsx │ ├── 08A_hs_00.hs │ ├── 08A_hs_01.hs │ ├── 08A_hs_02.hs │ ├── 08A_hs_03.hs │ ├── 08A_js_01.js │ ├── 08A_js_02.js │ ├── 08A_ml_01.ml │ ├── 08A_ml_02.ml │ ├── 08A_ml_03.ml │ ├── 08A_ml_04.ml │ ├── 08A_py_01.py │ ├── 08A_py_02.py │ ├── 08A_rs_01.rs │ ├── 08B.md │ ├── 08B_c_01.c │ ├── 08B_cp_01.cpp │ ├── 08B_fs_00.fsx │ ├── 08B_hs_01.hs │ ├── 08B_js_01.js │ ├── 08B_ml_00.ml │ ├── 08B_ml_01.ml │ ├── 08B_ml_02.ml │ ├── 08B_ml_03.ml │ ├── 08B_py_01.py │ ├── 08B_rs_01.rs │ ├── 08C.md │ ├── 08C_c_01.c │ ├── 08C_cp_01.cpp │ ├── 08C_fs_00.fsx │ ├── 08C_hs_01.hs │ ├── 08C_js_01.js │ ├── 08C_ml_00.ml │ ├── 08C_ml_01.ml │ ├── 08C_ml_02.ml │ ├── 08C_py_01.py │ ├── 08C_rs_01.rs │ ├── 08D.md │ ├── 08D_c_01.c │ ├── 08D_cp_01.cpp │ ├── 08D_fs_00.fsx │ ├── 08D_hs_00.hs │ ├── 08D_hs_01.hs │ ├── 08D_js_01.js │ ├── 08D_ml_01.ml │ ├── 08D_py_01.py │ ├── 08D_rs_01.rs │ ├── 09A.md │ ├── 09A_c_01.c │ ├── 09A_cp_01.cpp │ ├── 09A_fs_00.fsx │ ├── 09A_go_01.go │ ├── 09A_hs00.hs │ ├── 09A_hs01.hs │ ├── 09A_js_01.js │ ├── 09A_ml_01.ml │ ├── 09A_ml_02.ml │ ├── 09A_ml_03.ml │ ├── 09A_py_01.py │ ├── 09A_rs_01.rs │ ├── 09B.md │ ├── 09B_c_01.c │ ├── 09B_cp_01.cpp │ ├── 09B_cp_02.cpp │ ├── 09B_fs_00.fsx │ ├── 09B_go_01.go │ ├── 09B_hs_00.hs │ ├── 09B_hs_01.hs │ ├── 09B_hs_02.hs │ ├── 09B_hs_03.hs │ ├── 09B_js_01.js │ ├── 09B_js_02.js │ ├── 09B_ml_01.ml │ ├── 09B_ml_02.ml │ ├── 09B_ml_03.ml │ ├── 09B_ml_04.ml │ ├── 09B_py_00.py │ ├── 09B_py_01.py │ ├── 09B_py_02.py │ ├── 09B_rs_01.rs │ ├── 09B_rs_02.rs │ ├── 09C.md │ ├── 09C_c_01.c │ ├── 09C_c_02.c │ ├── 09C_cp_01.cpp │ ├── 09C_cp_02.cpp │ ├── 09C_fs_00.fsx │ ├── 09C_go_01.go │ ├── 09C_go_02.go │ ├── 09C_js_01.js │ ├── 09C_js_02.js │ ├── 09C_ml_00.ml │ ├── 09C_ml_01.ml │ ├── 09C_ml_02.ml │ ├── 09C_ml_03.ml │ ├── 09C_py_01.py │ ├── 09C_rs_01.rs │ ├── 09C_rs_02.rs │ ├── 09D.md │ ├── 09D_c_01.c │ ├── 09D_cp_01.cpp │ ├── 09D_go_01.go │ ├── 09D_hs_00.hs │ ├── 09D_js_01.js │ ├── 09D_ml_01.ml │ ├── 09D_py_00.py │ ├── 09D_py_01.py │ ├── 09D_rs_01.rs │ ├── 10A.md │ ├── 10A_c_01.c │ ├── 10A_cp_01.cpp │ ├── 10A_fs_00.fsx │ ├── 10A_go_01.go │ ├── 10A_hs_00.hs │ ├── 10A_hs_01.hs │ ├── 10A_hs_02.hs │ ├── 10A_js_01.js │ ├── 10A_ml_00.ml │ ├── 10A_ml_01.ml │ ├── 10A_py_01.py │ ├── 10A_py_02.py │ ├── 10A_py_03.py │ ├── 10A_rs_01.rs │ ├── 10A_rs_02.rs │ ├── 10B.md │ ├── 10B_c_01.c │ ├── 10B_cp_01.cpp │ ├── 10B_fs_00.fsx │ ├── 10B_go_01.go │ ├── 10B_hs_00.hs │ ├── 10B_hs_01.hs │ ├── 10B_hs_02.hs │ ├── 10B_js_00.js │ ├── 10B_js_01.js │ ├── 10B_js_02.js │ ├── 10B_ml_01.ml │ ├── 10B_ml_02.ml │ ├── 10B_py_01.py │ ├── 10B_rs_01.rs │ ├── 10C.md │ ├── 10C_c_01.c │ ├── 10C_cp_01.cpp │ ├── 10C_fs_00.fsx │ ├── 10C_go_01.go │ ├── 10C_hs_01.hs │ ├── 10C_js_00.js │ ├── 10C_js_01.js │ ├── 10C_js_02.js │ ├── 10C_ml_01.ml │ ├── 10C_ml_02.ml │ ├── 10C_py_01.py │ ├── 10C_py_02.py │ ├── 10C_rs_01.rs │ ├── 10D.md │ ├── 10D_c_01.c │ ├── 10D_cp_01.cpp │ ├── 10D_fs_00.fsx │ ├── 10D_go_01.go │ ├── 10D_js_00.js │ ├── 10D_ml_01.ml │ ├── 10D_py_00.py │ ├── 10D_py_01.py │ ├── 10D_py_02.py │ ├── 10D_rs_01.rs │ ├── 11A.md │ ├── 11A_c_01.c │ ├── 11A_cp_01.cpp │ ├── 11A_fs_00.fsx │ ├── 11A_fs_01.fsx │ ├── 11A_go_01.go │ ├── 11A_hs_01.hs │ ├── 11A_hs_02.hs │ ├── 11A_hs_03.hs │ ├── 11A_js_00.js │ ├── 11A_js_01.js │ ├── 11A_js_02.js │ ├── 11A_ml_01.ml │ ├── 11A_ml_02.ml │ ├── 11A_py_01.py │ ├── 11A_rs_01.rs │ ├── 11A_rs_02.rs │ ├── 11B.md │ ├── 11B_c_01.c │ ├── 11B_cp_01.cpp │ ├── 11B_cp_02.cpp │ ├── 11B_fs_00.fsx │ ├── 11B_go_01.go │ ├── 11B_hs_01.hs │ ├── 11B_js_00.js │ ├── 11B_js_01.js │ ├── 11B_js_02.js │ ├── 11B_js_03.js │ ├── 11B_js_04.js │ ├── 11B_ml_01.ml │ ├── 11B_ml_02.ml │ ├── 11B_py_01.py │ ├── 11B_rs_01.rs │ ├── 11C.md │ ├── 11C_c_01.c │ ├── 11C_cp_01.cpp │ ├── 11C_fs_00.fsx │ ├── 11C_go_01.go │ ├── 11C_hs_01.hs │ ├── 11C_hs_02.hs │ ├── 11C_js_00.js │ ├── 11C_js_01.js │ ├── 11C_js_02.js │ ├── 11C_js_03.js │ ├── 11C_js_04.js │ ├── 11C_js_05.js │ ├── 11C_ml_01.ml │ ├── 11C_ml_02.ml │ ├── 11C_py_01.py │ ├── 11C_py_02.py │ ├── 11C_rs_01.rs │ ├── 11D.md │ ├── 11D_c_01.c │ ├── 11D_cp_01.cpp │ ├── 11D_fs_00.fsx │ ├── 11D_go_01.go │ ├── 11D_hs_01.hs │ ├── 11D_hs_02.hs │ ├── 11D_js_00.js │ ├── 11D_js_01.js │ ├── 11D_js_02.js │ ├── 11D_js_03.js │ ├── 11D_js_04.js │ ├── 11D_js_05.js │ ├── 11D_js_06.js │ ├── 11D_ml_01.ml │ ├── 11D_ml_02.ml │ ├── 11D_py_01.py │ ├── 11D_rs_01.rs │ ├── 12A.md │ ├── 12A_c_01.c │ ├── 12A_c_02.c │ ├── 12A_cp_01.cpp │ ├── 12A_cp_02.cpp │ ├── 12A_fs_00.fsx │ ├── 12A_go_01.go │ ├── 12A_hs_01.hs │ ├── 12A_hs_02.hs │ ├── 12A_hs_03.hs │ ├── 12A_js_00.js │ ├── 12A_js_01.js │ ├── 12A_js_02.js │ ├── 12A_js_03.js │ ├── 12A_js_04.js │ ├── 12A_ml_01.ml │ ├── 12A_py_01.py │ ├── 12A_rs_01.rs │ ├── 12B.md │ ├── 12B_c_01.c │ ├── 12B_cp_01.cpp │ ├── 12B_cp_02.cpp │ ├── 12B_fs_00.fsx │ ├── 12B_go_01.go │ ├── 12B_go_02.go │ ├── 12B_go_03.go │ ├── 12B_hs_01.hs │ ├── 12B_hs_02.hs │ ├── 12B_hs_03.hs │ ├── 12B_js_00.js │ ├── 12B_js_01.js │ ├── 12B_js_02.js │ ├── 12B_js_03.js │ ├── 12B_js_04.js │ ├── 12B_ml_01.ml │ ├── 12B_py_01.py │ ├── 12B_rs_01.rs │ ├── 12C.md │ ├── 12C_c_01.c │ ├── 12C_cp_01.cpp │ ├── 12C_fs_00.fsx │ ├── 12C_go_01.go │ ├── 12C_hs_01.hs │ ├── 12C_hs_02.hs │ ├── 12C_js_00.js │ ├── 12C_js_01.js │ ├── 12C_js_02.js │ ├── 12C_ml_01.ml │ ├── 12C_ml_02.ml │ ├── 12C_py_01.py │ ├── 12C_rs_01.rs │ ├── 13A.md │ ├── 13A_c_01.c │ ├── 13A_c_02.c │ ├── 13A_cp_01.cpp │ ├── 13A_cp_02.cpp │ ├── 13A_fs_00.fsx │ ├── 13A_go_01.go │ ├── 13A_hs_01.hs │ ├── 13A_js_01.js │ ├── 13A_js_02.js │ ├── 13A_ml_00.ml │ ├── 13A_ml_01.ml │ ├── 13A_ml_02.ml │ ├── 13A_py_01.py │ ├── 13A_rs_01.rs │ ├── 13B.md │ ├── 13B_c_01.c │ ├── 13B_cp_01.cpp │ ├── 13B_fs_00.fsx │ ├── 13B_go_01.go │ ├── 13B_hs_01.hs │ ├── 13B_js_01.js │ ├── 13B_js_02.js │ ├── 13B_ml_01.ml │ ├── 13B_py_00.py │ ├── 13B_py_01.py │ ├── 13B_py_02.py │ ├── 13B_rs_01.rs │ ├── 13C.md │ ├── 13C_c_01.c │ ├── 13C_cp_01.cpp │ ├── 13C_fs_00.fsx │ ├── 13C_go_01.go │ ├── 13C_js_01.js │ ├── 13C_js_02.js │ ├── 13C_ml_01.ml │ ├── 13C_ml_02.ml │ ├── 13C_py_00.py │ ├── 13C_py_01.py │ ├── 13C_rs_01.rs │ ├── 14A.md │ ├── 14A_c_01.c │ ├── 14A_cp_01.cpp │ ├── 14A_cs_01.cs │ ├── 14A_fs_00.fsx │ ├── 14A_fs_01.fsx │ ├── 14A_go_01.go │ ├── 14A_hs_01.hs │ ├── 14A_js_01.js │ ├── 14A_ml_01.ml │ ├── 14A_ml_02.ml │ ├── 14A_py_00.py │ ├── 14A_py_01.py │ ├── 14A_rs_01.rs │ ├── 14B.md │ ├── 14B_fs_00.fsx │ ├── 14B_hs_01.hs │ ├── 14B_js_01.js │ ├── 14B_js_02.js │ ├── 14B_ml_01.ml │ ├── 14B_ml_02.ml │ ├── 14B_py_01.py │ ├── 14B_py_02.py │ ├── 14B_rs_00.rs │ ├── 14B_rs_01.rs │ ├── 14B_rs_02.rs │ ├── 14C.md │ ├── 14C_c_01.c │ ├── 14C_c_02.c │ ├── 14C_cp_01.cpp │ ├── 14C_cp_02.cpp │ ├── 14C_fs_00.fsx │ ├── 14C_go_01.go │ ├── 14C_js_01.js │ ├── 14C_ml_00.ml │ ├── 14C_ml_01.ml │ ├── 14C_ml_02.ml │ ├── 14C_py_01.py │ ├── 14C_py_02.py │ ├── 14C_rs_01.rs │ ├── 14C_rs_02.rs │ ├── 14D.md │ ├── 14D_cp_01.cpp │ ├── 14D_go_01.go │ ├── 14D_js_01.js │ ├── 14D_ml_01.ml │ ├── 14D_ml_02.ml │ ├── 14D_py_01.py │ ├── 14D_py_02.py │ └── 14D_rs_01.rs ├── DSL │ ├── 01A.md │ ├── 01A_cp_01.cpp │ ├── 01A_cp_02.cpp │ ├── 01A_cs_01.cs │ ├── 01A_go_01.go │ ├── 01A_go_02.go │ ├── 01A_hs_01.hs │ ├── 01A_hs_02.hs │ ├── 01A_js_01.js │ ├── 01A_ml_01.ml │ ├── 01A_ml_02.ml │ ├── 01A_ml_03.ml │ ├── 01A_py_01.py │ └── 01A_rs_01.rs ├── GRL1 │ ├── 01A.md │ ├── 01A_cp_01.cpp │ ├── 01A_cs_01.cs │ ├── 01A_go_01.go │ ├── 01A_hs_01.hs │ ├── 01A_hs_02.hs │ ├── 01A_js_01.js │ ├── 01A_ml_01.ml │ ├── 01A_py_01.py │ └── 01A_rs_01.rs ├── ITP1 │ ├── 01A_00_helloworld.md │ ├── 01A_fs_00.fsx │ ├── 01A_hs_00.hs │ ├── 01A_js_00.js │ ├── 01A_ml_00.ml │ ├── 01B_00_x-cubic.md │ ├── 01B_fs_00.fsx │ ├── 01B_hs_01.hs │ ├── 01B_hs_02.hs │ ├── 01B_ml_00.ml │ ├── 01B_ml_01.ml │ ├── 01C_00_area-surface.md │ ├── 01C_fs_00.fsx │ ├── 01C_ml_00.ml │ ├── 01C_ml_01.hs │ ├── 01C_ml_02.hs │ ├── 01C_ml_03.hs │ ├── 01C_ml_04.hs │ ├── 01D_00_watch.md │ ├── 01D_fs_00.fsx │ ├── 01D_hs_01.hs │ ├── 01D_hs_02.hs │ ├── 01D_hs_03.hs │ ├── 01D_ml_00.ml │ ├── 01D_ml_01.ml │ ├── 02A_00_cmp.md │ ├── 02A_fs_00.fsx │ ├── 02A_hs_01.hs │ ├── 02A_hs_02.hs │ ├── 02A_hs_03.hs │ ├── 02A_hs_04.hs │ ├── 02A_ml_00.ml │ ├── 02A_ml_01.ml │ ├── 02A_ml_02.ml │ ├── 02B_00_range.md │ ├── 02B_fs_00.fsx │ ├── 02B_hs_01.hs │ ├── 02B_ml_00.ml │ ├── 02B_ml_01.ml │ ├── 02C_00_sort.md │ ├── 02C_fs_00.fsx │ ├── 02C_hs_01.hs │ ├── 02C_ml_00.ml │ ├── 02C_ml_01.ml │ ├── 02C_ml_02.ml │ ├── 02C_ml_03.ml │ ├── 02C_ml_04.ml │ ├── 02C_ml_05.ml │ ├── 02D.md │ ├── 02D_fs_00.fsx │ ├── 02D_hs_01.hs │ ├── 02D_ml_00.ml │ ├── 03A.md │ ├── 03A_fs_00.fsx │ ├── 03A_hs_01.hs │ ├── 03A_hs_02.hs │ ├── 03A_hs_03.hs │ ├── 03A_ml_00.ml │ ├── 03B.md │ ├── 03B_cpp.sh │ ├── 03B_cpp.txt │ ├── 03B_cpp_01.cpp │ ├── 03B_fs_00.fsx │ ├── 03B_hs_01.hs │ ├── 03B_hs_02.hs │ ├── 03B_ml_00.ml │ ├── 03B_ml_01.ml │ ├── 03B_ml_02.ml │ ├── 03B_ml_03.ml │ ├── 03C.md │ ├── 03C_fs_00.fsx │ ├── 03C_hs_01.hs │ ├── 03C_hs_02.hs │ ├── 03C_ml_00.ml │ ├── 03C_ml_01.ml │ ├── 03C_ml_02.ml │ ├── 03D.md │ ├── 03D_fs_00.fsx │ ├── 03D_hs_01.hs │ ├── 03D_hs_02.hs │ ├── 03D_ml_00.ml │ ├── 03D_ml_01.ml │ ├── 04A.md │ ├── 04A_fs_00.fsx │ ├── 04A_hs_01.hs │ ├── 04A_ml_00.ml │ ├── 04B.md │ ├── 04B_fs_00.fsx │ ├── 04B_hl_01.hs │ ├── 04B_ml_00.ml │ ├── 04B_ml_01.ml │ ├── 04B_ml_02.ml │ ├── 04C.md │ ├── 04C_fs_00.fsx │ ├── 04C_hs_01.hs │ ├── 04C_ml_00.ml │ ├── 04D.md │ ├── 04D_fs_00.fsx │ ├── 04D_fs_01.fsx │ ├── 04D_hs_01.hs │ ├── 04D_ml_00.ml │ ├── 04D_ml_01.ml │ ├── 04D_ml_02.ml │ ├── 04D_ml_03.ml │ ├── 05A.md │ ├── 05A_fs_00.fsx │ ├── 05A_hs_01.hs │ ├── 05A_ml_00.ml │ ├── 05A_ml_01.ml │ ├── 05A_ml_02.ml │ ├── 05A_ml_03.ml │ ├── 05B.md │ ├── 05B_fs_00.fsx │ ├── 05B_hs_01.hs │ ├── 05B_ml_00.ml │ ├── 05C_00_chessboard.md │ ├── 05C_fs_00.fsx │ ├── 05C_hs_01.hs │ ├── 05C_hs_02.hs │ ├── 05C_hs_03.hs │ ├── 05C_hs_04.hs │ ├── 05C_hs_05.hs │ ├── 05C_ml_00.ml │ ├── 05C_ml_01.ml │ ├── 05D.md │ ├── 05D_fs_00.fsx │ ├── 05D_hs_01.hs │ ├── 05D_hs_02.hs │ ├── 05D_hs_03.hs │ ├── 05D_ml_00.ml │ ├── 05D_ml_01.ml │ ├── 05D_ml_02.ml │ ├── 06A.md │ ├── 06A_fs_00.fsx │ ├── 06A_hs_01.hs │ ├── 06A_ml_00.ml │ ├── 06A_ml_01.ml │ ├── 06A_ml_02.ml │ ├── 06A_ml_03.ml │ ├── 06A_ml_04.ml │ ├── 06A_ml_05.ml │ ├── 06B.md │ ├── 06B_fs_00.fsx │ ├── 06B_hs_01.hs │ ├── 06B_hs_02.hs │ ├── 06B_ml_00.ml │ ├── 06B_ml_01.ml │ ├── 06B_ml_02.ml │ ├── 06B_ml_03.ml │ ├── 06C.md │ ├── 06C_cp_01.cpp │ ├── 06C_fs_00.fsx │ ├── 06C_hs_01.hs │ ├── 06C_hs_02.hs │ ├── 06C_hs_03.hs │ ├── 06C_hs_04.hs │ ├── 06C_ml_01.ml │ ├── 06C_ml_02.ml │ ├── 06D.md │ ├── 06D_cp_01.cpp │ ├── 06D_fs_00.fsx │ ├── 06D_hs_01.hs │ ├── 06D_hs_02.hs │ ├── 06D_hs_03.hs │ ├── 06D_hs_04.hs │ ├── 06D_ml_01.ml │ ├── 07A.md │ ├── 07A_cp_01.cpp │ ├── 07A_fs_00.fsx │ ├── 07A_hs_01.hs │ ├── 07A_hs_02.hs │ ├── 07A_hs_03.hs │ ├── 07A_ml_01.ml │ ├── 07B.md │ ├── 07B_c_01.c │ ├── 07B_c_02.c │ ├── 07B_cp_01.cpp │ ├── 07B_fs_00.fsx │ ├── 07B_hs_01.hs │ ├── 07B_hs_02.hs │ ├── 07B_hs_03.hs │ ├── 07B_ml_01.ml │ ├── 07C.md │ ├── 07C_c_01.c │ ├── 07C_cp_01.cpp │ ├── 07C_fs_00.fsx │ ├── 07C_hs_01.hs │ ├── 07C_hs_02.hs │ ├── 07C_hs_03.hs │ ├── 07C_ml_01.ml │ ├── 07C_rs_01.rs │ ├── 07C_rs_02.rs │ ├── 07D.md │ ├── 07D_c_01.c │ ├── 07D_cp_01.cpp │ ├── 07D_fs_00.fsx │ ├── 07D_hs_01.hs │ ├── 07D_hs_02.hs │ ├── 07D_hs_03.hs │ ├── 07D_hs_04.hs │ ├── 07D_ml_01.ml │ ├── 07D_ml_02.ml │ ├── 07D_rs_01.rs │ ├── 08A.md │ ├── 08A_c_01.c │ ├── 08A_cp_01.cpp │ ├── 08A_cp_02.cpp │ ├── 08A_fs_00.fsx │ ├── 08A_hs_01.hs │ ├── 08A_hs_02.hs │ ├── 08A_hs_03.hs │ ├── 08A_ml_01.ml │ ├── 08A_ml_02.ml │ ├── 08B.md │ ├── 08B_c_01.c │ ├── 08B_cp_01.cpp │ ├── 08B_cp_02.cpp │ ├── 08B_fs_00.fsx │ ├── 08B_hs_01.hs │ ├── 08B_hs_02.hs │ ├── 08B_hs_03.hs │ ├── 08B_ml_01.ml │ ├── 08B_ml_02.ml │ ├── 08B_rs_01.rs │ ├── 08C.md │ ├── 08C_c_01.c │ ├── 08C_cp_01.cpp │ ├── 08C_cp_02.cpp │ ├── 08C_fs_00.fsx │ ├── 08C_hs_01.hs │ ├── 08C_hs_02.hs │ ├── 08C_hs_03.hs │ ├── 08C_hs_04.hs │ ├── 08C_hs_05.hs │ ├── 08C_ml_01.ml │ ├── 08C_ml_02.ml │ ├── 08D.md │ ├── 08D_c_01.c │ ├── 08D_c_02.c │ ├── 08D_cp_01.cpp │ ├── 08D_fs_00.fsx │ ├── 08D_hs_01.hs │ ├── 08D_hs_02.hs │ ├── 08D_hs_03.hs │ ├── 08D_hs_04.hs │ ├── 08D_js_01.js │ ├── 08D_js_02.js │ ├── 08D_ml_01.ml │ ├── 08D_ml_02.ml │ ├── 08D_rs_01.rs │ ├── 09A.md │ ├── 09A_c_01.c │ ├── 09A_c_02.c │ ├── 09A_cp_01.cpp │ ├── 09A_fs_00.fsx │ ├── 09A_hs_01.hs │ ├── 09A_hs_02.hs │ ├── 09A_hs_03.hs │ ├── 09A_hs_04.hs │ ├── 09A_js_01.js │ ├── 09A_js_02.js │ ├── 09A_js_03.js │ ├── 09A_ml_01.ml │ ├── 09A_ml_02.ml │ ├── 09A_rs_01.rs │ ├── 09A_rs_02.rs │ ├── 09A_rs_03.rs │ ├── 09B.md │ ├── 09B_c_01.c │ ├── 09B_c_02.c │ ├── 09B_cp_01.cpp │ ├── 09B_fs_00.fsx │ ├── 09B_hs_01.hs │ ├── 09B_hs_02.hs │ ├── 09B_hs_03.hs │ ├── 09B_hs_04.hs │ ├── 09B_js_01.js │ ├── 09B_js_02.js │ ├── 09B_ml_01.ml │ ├── 09B_rs_01.rs │ ├── 09C.md │ ├── 09C_c_01.c │ ├── 09C_cp_01.cpp │ ├── 09C_fs_00.fsx │ ├── 09C_hs_01.hs │ ├── 09C_hs_02.hs │ ├── 09C_hs_03.hs │ ├── 09C_hs_04.hs │ ├── 09C_hs_05.hs │ ├── 09C_hs_06.hs │ ├── 09C_hs_07.hs │ ├── 09C_js_01.js │ ├── 09C_ml_01.ml │ ├── 09C_ml_02.ml │ ├── 09C_rs_01.rs │ ├── 09C_rs_02.rs │ ├── 09D.md │ ├── 09D_c_01.c │ ├── 09D_c_02.c │ ├── 09D_cp_01.cpp │ ├── 09D_fs_00.fsx │ ├── 09D_hs_01.hs │ ├── 09D_hs_02.hs │ ├── 09D_hs_03.hs │ ├── 09D_hs_04.hs │ ├── 09D_hs_05.hs │ ├── 09D_js_01.js │ ├── 09D_ml_01.ml │ ├── 09D_rs_01.rs │ ├── 10A.md │ ├── 10A_c_01.c │ ├── 10A_cp_01.cpp │ ├── 10A_fs_00.fsx │ ├── 10A_hs_01.hs │ ├── 10A_hs_02.hs │ ├── 10A_js_01.js │ ├── 10A_ml_01.ml │ ├── 10A_ml_02.ml │ ├── 10A_ml_03.ml │ ├── 10A_rs_01.rs │ ├── 10B.md │ ├── 10B_c_01.c │ ├── 10B_cp_01.cpp │ ├── 10B_fs_00.fsx │ ├── 10B_hs_01.hs │ ├── 10B_hs_02.hs │ ├── 10B_js_01.js │ ├── 10B_js_02.js │ ├── 10B_ml_01.ml │ ├── 10B_rs_01.rs │ ├── 10B_rs_02.rs │ ├── 10C.md │ ├── 10C_c_01.c │ ├── 10C_c_02.c │ ├── 10C_c_03.c │ ├── 10C_c_04.c │ ├── 10C_cp_01.cpp │ ├── 10C_cp_02.cpp │ ├── 10C_fs_00.fsx │ ├── 10C_hs_01.hs │ ├── 10C_hs_02.hs │ ├── 10C_hs_03.hs │ ├── 10C_hs_04.hs │ ├── 10C_js_01.js │ ├── 10C_ml_01.ml │ ├── 10C_rs_01.rs │ ├── 10C_rs_02.rs │ ├── 10D.md │ ├── 10D_c_01.c │ ├── 10D_cp_01.cpp │ ├── 10D_cp_02.cpp │ ├── 10D_fs_00.fsx │ ├── 10D_hs_01.hs │ ├── 10D_hs_02.hs │ ├── 10D_js_01.js │ ├── 10D_ml_01.ml │ ├── 10D_ml_02.ml │ ├── 10D_rs_01.rs │ ├── 11A.md │ ├── 11A_c_01.c │ ├── 11A_cp_01.cpp │ ├── 11A_fs_00.fsx │ ├── 11A_hs_01.hs │ ├── 11A_hs_02.hs │ ├── 11A_hs_03.hs │ ├── 11A_js_01.js │ ├── 11A_ml_01.ml │ ├── 11A_rs_01.rs │ ├── 11B.md │ ├── 11B_c_01.c │ ├── 11B_cp_01.cpp │ ├── 11B_fs_00.fsx │ ├── 11B_hs_01.hs │ ├── 11B_hs_02.hs │ ├── 11B_hs_03.hs │ ├── 11B_js_01.js │ ├── 11B_ml_01.ml │ ├── 11B_rs_01.rs │ ├── 11C.md │ ├── 11C_c_01.c │ ├── 11C_cp_01.cpp │ ├── 11C_fs_00.fsx │ ├── 11C_hs_01.hs │ ├── 11C_hs_02.hs │ ├── 11C_hs_03.hs │ ├── 11C_js_01.js │ ├── 11C_ml_01.ml │ ├── 11C_ml_02.ml │ ├── 11C_ml_03.ml │ ├── 11C_rs_01.rs │ ├── 11D.md │ ├── 11D_c_01.c │ ├── 11D_cp_01.cpp │ ├── 11D_fs_00.fsx │ ├── 11D_hs_01.hs │ ├── 11D_hs_02.hs │ ├── 11D_hs_03.hs │ ├── 11D_js_01.js │ ├── 11D_ml_01.ml │ ├── 11D_ml_02.ml │ ├── 11D_ml_03.ml │ ├── 11D_ml_04.ml │ ├── 11D_ml_05.ml │ └── 11D_rs_01.rs ├── ITP2 │ ├── 01A.md │ ├── 01A_c_01.c │ ├── 01A_c_02.c │ ├── 01A_cp_01.cpp │ ├── 01A_cp_02.cpp │ ├── 01A_fs_00.fsx │ ├── 01A_go_01.go │ ├── 01A_go_02.go │ ├── 01A_go_03.go │ ├── 01A_hs_01.hs │ ├── 01A_hs_02.hs │ ├── 01A_js_01.js │ ├── 01A_ml_00.ml │ ├── 01A_py_00.py │ ├── 01A_py_01.py │ ├── 01A_rs_01.rs │ ├── 01B.md │ ├── 01B_cp_01.cpp │ ├── 01B_cp_02.cpp │ ├── 01B_go_01.go │ ├── 01B_hs_01.hs │ ├── 01B_hs_02.hs │ ├── 01B_js_01.js │ ├── 01B_py_01.py │ └── 01B_rs_01.rs └── NTL1 │ ├── 01A.md │ ├── 01A_c_01.c │ ├── 01A_cp_01.cpp │ ├── 01A_fs_00.fsx │ ├── 01A_go_01.go │ ├── 01A_go_02.go │ ├── 01A_hs_01.hs │ ├── 01A_hs_02.hs │ ├── 01A_js_00.js │ ├── 01A_js_01.js │ ├── 01A_js_02.js │ ├── 01A_ml_00.ml │ ├── 01A_ml_01.ml │ ├── 01A_py_00.py │ ├── 01A_py_01.py │ ├── 01A_rs_01.rs │ ├── 01B.md │ ├── 01B_c_01.c │ ├── 01B_cp_01.cpp │ ├── 01B_fs_00.fsx │ ├── 01B_go_01.go │ ├── 01B_hs_01.hs │ ├── 01B_hs_02.hs │ ├── 01B_js_01.js │ ├── 01B_ml_00.ml │ ├── 01B_ml_01.ml │ ├── 01B_ml_02.ml │ ├── 01B_ml_03.ml │ ├── 01B_ml_04.ml │ ├── 01B_py_01.py │ ├── 01B_py_02.py │ ├── 01B_rs_01.rs │ ├── 01C.md │ ├── 01C_c_01.c │ ├── 01C_cp_01.cpp │ ├── 01C_fs_00.fsx │ ├── 01C_go_01.go │ ├── 01C_go_02.go │ ├── 01C_hs_01.hs │ ├── 01C_hs_02.hs │ ├── 01C_hs_03.hs │ ├── 01C_hs_04.hs │ ├── 01C_js_01.js │ ├── 01C_ml_00.ml │ ├── 01C_ml_01.ml │ ├── 01C_py_01.py │ ├── 01C_py_02.py │ ├── 01C_py_03.py │ ├── 01C_rs_01.rs │ ├── 01D.md │ ├── 01D_c_01.c │ ├── 01D_cp_01.cpp │ ├── 01D_fs_00.fsx │ ├── 01D_go_01.go │ ├── 01D_go_02.go │ ├── 01D_hs_01.hs │ ├── 01D_hs_02.hs │ ├── 01D_js_01.js │ ├── 01D_ml_01.ml │ ├── 01D_py_00.py │ ├── 01D_py_01.py │ ├── 01D_py_02.py │ ├── 01D_rs_01.rs │ ├── 01E.md │ ├── 01E_c_01.c │ ├── 01E_c_02.c │ ├── 01E_cp_01.cpp │ ├── 01E_fs_00.fsx │ ├── 01E_go_01.go │ ├── 01E_go_02.go │ ├── 01E_hs_01.hs │ ├── 01E_hs_02.hs │ ├── 01E_js_01.js │ ├── 01E_ml_00.ml │ ├── 01E_ml_01.ml │ ├── 01E_py_01.py │ ├── 01E_py_02.py │ ├── 01E_rs_01.rs │ ├── 01E_rs_02.rs │ ├── 02A.md │ ├── 02A_c_01.c │ ├── 02A_cp_01.cpp │ ├── 02A_fs_00.fsx │ ├── 02A_go_01.go │ ├── 02A_hs_01.hs │ ├── 02A_ml_00.ml │ ├── 02A_py_01.py │ ├── 02A_rs_01.rs │ ├── 02B.md │ ├── 02B_c_01.c │ ├── 02B_cp_01.cpp │ ├── 02B_go_01.go │ ├── 02B_hs_01.hs │ ├── 02B_ml_00.ml │ ├── 02B_py_01.py │ ├── 02B_rs_01.rs │ ├── 02C.md │ ├── 02C_ml_00.ml │ ├── 02D.md │ ├── 02D_ml_00.ml │ ├── 02D_py_00.py │ ├── 02D_py_01.py │ ├── 02E.md │ ├── 02E_ml_00.ml │ ├── 02F.md │ ├── 02F_ml_00.ml │ └── 02F_py_00.py ├── Algo-Method ├── 01-std-output │ ├── 001-001.hs │ ├── 001-001.js │ ├── 001-001.py │ ├── 001-001.rs │ ├── 001-002.hs │ ├── 001-002.js │ ├── 001-002.py │ ├── 001-002.rs │ ├── 001-003.hs │ ├── 001-003.js │ ├── 001-003.py │ ├── 001-003.rs │ ├── 001-004.hs │ ├── 001-004.js │ ├── 001-004.py │ ├── 001-004.rs │ ├── 001-005.hs │ ├── 001-005.js │ ├── 001-005.py │ └── 001-005.rs ├── 02-std-input │ ├── 001-001.hs │ ├── 001-001.js │ ├── 001-001.py │ ├── 001-001.rs │ ├── 001-002.hs │ ├── 001-002.py │ ├── 001-002.rs │ ├── 001-003.hs │ ├── 001-003.py │ ├── 001-003.rs │ ├── 001-004.hs │ ├── 001-004.py │ ├── 001-004.rs │ ├── 001-005.hs │ ├── 001-005.py │ ├── 001-005.rs │ ├── 002-001.hs │ ├── 002-001.py │ ├── 002-001.rs │ ├── 002-002.hs │ ├── 002-002.py │ ├── 002-003.hs │ ├── 002-003.py │ ├── 002-004.hs │ ├── 002-004.py │ ├── 002-005.hs │ ├── 002-005.py │ ├── 002-006.hs │ ├── 002-006.py │ ├── 002-006.rs │ ├── 002-007.hs │ ├── 002-007.py │ ├── 002-007.rs │ ├── 002-008.hs │ ├── 002-008.py │ ├── 002-009.hs │ ├── 002-009.py │ ├── 002-010.hs │ ├── 002-010.py │ ├── 003-001.hs │ ├── 003-001.py │ ├── 003-001.rs │ ├── 003-002.hs │ ├── 003-002.py │ ├── 003-003.hs │ ├── 003-003.py │ ├── 003-004.hs │ ├── 003-004.py │ ├── 003-005.hs │ ├── 003-005.py │ ├── 003-006.hs │ ├── 003-006.py │ ├── 003-007.hs │ ├── 003-007.py │ ├── 003-008.hs │ ├── 003-008.py │ ├── 003-008_01.rs │ ├── 003-008_02.rs │ ├── 003-009.hs │ ├── 003-009.py │ ├── 003-009_00_01.rs │ ├── 003-009_01.rs │ ├── 003-009_02.rs │ ├── 003-010.hs │ └── 003-010.py ├── 08-knapsack-dp │ ├── 307-01-py.py │ ├── 307-01-rs.rs │ ├── 308-01-py.py │ ├── 309-01-csx.csx │ ├── 309-01-py.py │ ├── 309-02-csx.csx │ ├── 310-01-csx.csx │ ├── 310-01-py.py │ ├── 311-01-csx.csx │ ├── 311-01-py.py │ ├── 312-01-py.py │ ├── 314-01-csx.csx │ └── 316-01-csx.csx ├── 13-math-for-pg │ ├── 566-01-csx.csx │ ├── 567-01-csx.csx │ ├── 568-01-csx.csx │ └── 6569-01-csx.csx ├── Arithmetics │ ├── tasks-00108.py │ └── tasks-00109.py ├── FullSearch │ ├── 01_cpp_0069.cpp │ ├── 02_cpp_0070.cpp │ ├── 03_cpp_0071.cpp │ └── README.md └── computation-complexity │ ├── 003-001.py │ ├── 003-002.py │ ├── 003-003.py │ ├── 003-004.py │ ├── 003-005.py │ ├── 004-001.py │ ├── 004-002.py │ ├── 004-003.py │ ├── 004-004.py │ └── 004-005.py ├── AtCoder ├── ABC042 │ ├── B.md │ ├── B_fs_01.fsx │ ├── B_ml_00.ml │ ├── B_ml_01.ml │ ├── B_ml_02.ml │ └── B_ml_03.ml ├── ABC043 │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_ml_00.ml │ ├── B_ml_01.ml │ ├── B_ml_02.ml │ ├── B_ml_03.ml │ ├── B_ml_04.ml │ └── B_ml_05.ml ├── ABC044 │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_ml_01.ml │ ├── B_ml_02.ml │ ├── B_ml_03.ml │ ├── B_ml_04.ml │ └── B_ml_05.ml ├── ABC045 │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_hs_03.hs │ ├── B_ml_00.ml │ ├── B_ml_01.ml │ ├── B_ml_02.ml │ └── B_ml_03.ml ├── ABC046 │ └── B1.fsx ├── ABC047 │ ├── B1.fsx │ └── B2.hs ├── ABC048 │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_ml_01.ml │ ├── B_ml_02.ml │ ├── B_ml_03.ml │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ └── C_rs_01.rs ├── ABC049 │ ├── B1.fsx │ ├── B2.fsx │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ ├── C_ml_01.ml │ ├── C_ml_02.ml │ ├── C_ml_03.ml │ └── C_ml_04.ml ├── ABC050 │ ├── B1.fsx │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_rs_01.rs │ └── C_rs_02.rs ├── ABC051 │ ├── B01.fsx │ ├── B02.hs │ ├── B03.hs │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ └── C_ml_01.ml ├── ABC052 │ └── B1.fsx ├── ABC053 │ └── B1.fsx ├── ABC054 │ ├── B.md │ ├── B_fs_00_00.fsx │ ├── B_fs_00_01.fsx │ ├── B_fs_01.fsx │ ├── B_fs_02.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_hs_03.hs │ ├── B_hs_04.hs │ ├── B_hs_05.hs │ ├── B_ml_01.ml │ └── B_ml_02.ml ├── ABC055 │ └── B1.fsx ├── ABC057 │ ├── B1.fsx │ ├── B_lisp_01.lisp │ ├── C.md │ ├── C_cp_01.cpp │ ├── C_fs_00_00.fsx │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_00_03.fsx │ ├── C_fs_00_04.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_ml_01.ml │ └── C_ml_02.ml ├── ABC058 │ ├── B1.fsx │ ├── B2.fsx │ ├── B3.fsx │ └── B_lisp_01.lisp ├── ABC059 │ ├── B1.fsx │ ├── B2.fsx │ └── B_lisp_01.lisp ├── ABC060 │ └── B1.fsx ├── ABC061 │ ├── B1.fsx │ ├── C01.fsx │ ├── C02.hs │ ├── C03.hs │ ├── C04.hs │ ├── C05.hs │ ├── C06.hs │ ├── C07.hs │ └── C08.hs ├── ABC062 │ └── B1.fsx ├── ABC063 │ ├── B1.fsx │ └── B2.fsx ├── ABC064 │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_hs_05.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── ABC065 │ ├── B1.fsx │ ├── B2.fsx │ └── B3.fsx ├── ABC066 │ └── B1.fsx ├── ABC068 │ ├── B.fsx │ ├── B.hs │ ├── B1.fsx │ ├── B1.hs │ ├── B2.fsx │ └── B3.fsx ├── ABC070 │ ├── C1.fsx │ ├── C2.hs │ ├── C3.hs │ ├── D.md │ ├── D_fs_00_00.fsx │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_00_03.fsx │ ├── D_fs_00_04.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_fs_03.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_ml_01.ml │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── ABC071 │ ├── B1.fsx │ ├── B2.fsx │ ├── D.md │ ├── D_fs_00_00.fsx │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_00_03.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ └── D_rs_01.rs ├── ABC073 │ ├── C1.fsx │ └── C2.fsx ├── ABC074 │ └── B.fsx ├── ABC075 │ ├── B1.fsx │ ├── C.md │ ├── C_c_01.c │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_ml_01.ml │ └── C_py_01.py ├── ABC076 │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_01_conv.hs │ ├── C_hs_02.hs │ ├── C_ml_01.ml │ ├── C_ml_02.ml │ ├── C_ml_03.ml │ ├── C_ml_04.ml │ ├── C_ml_05.ml │ ├── C_ml_06.ml │ ├── C_ml_07.ml │ └── C_ml_08.ml ├── ABC079 │ ├── B1.fsx │ ├── B2.fsx │ ├── B3.fsx │ ├── C1.fsx │ ├── C2.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ └── D_rs_01.rs ├── ABC080 │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_00_03.fsx │ ├── C_fs_00_04.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ └── C_rs_01.rs ├── ABC081 │ ├── A.fsx │ ├── A.py │ ├── B.fsx │ ├── B.py │ └── B1.fsx ├── ABC082 │ └── B1.fsx ├── ABC083 │ ├── A.fsx │ └── B.fsx ├── ABC084 │ ├── B1.fsx │ ├── B2.fsx │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ ├── C_hs_05.hs │ ├── C_ml_01.ml │ ├── C_ml_02.ml │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ └── D_rs_01.rs ├── ABC085 │ ├── B.fsx │ ├── C.fsx │ ├── C2.fsx │ ├── C3.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_hs_05.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── ABC086 │ ├── A.cpp │ ├── A.fsx │ ├── A.py │ ├── B.fsx │ ├── B1.fsx │ ├── B2.fsx │ ├── C.fsx │ └── C.py ├── ABC087 │ └── B.fsx ├── ABC088 │ ├── B.fsx │ ├── B1.fsx │ ├── B2.fsx │ ├── B3.fsx │ ├── C1.fsx │ ├── C2.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_hs_05.hs │ └── D_rs_01.rs ├── ABC089 │ ├── C1.fsx │ ├── C2.hs │ ├── C3.hs │ └── C4.hs ├── ABC090 │ ├── B1.fsx │ └── B2.fsx ├── ABC091 │ └── B1.fsx ├── ABC092 │ └── B1.fsx ├── ABC093 │ └── B1.fsx ├── ABC096 │ ├── B1.fsx │ ├── B2.fsx │ └── B_lisp_01.lisp ├── ABC097 │ ├── B1.fsx │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ └── C_rs_01.rs ├── ABC098 │ └── B1.fsx ├── ABC099 │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_00_03.fsx │ ├── C_fs_00_04.fsx │ ├── C_fs_00_05.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_fs_03.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ └── C_rs_01.rs ├── ABC100 │ ├── B1.fsx │ └── C1.fsx ├── ABC102 │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ └── C_rs_01.rs ├── ABC103 │ ├── B1.fsx │ └── C1.fsx ├── ABC104 │ ├── B1.fsx │ ├── B2.fsx │ ├── B3.fsx │ └── B4.fsx ├── ABC105 │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_fs_03.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ └── C_rs_01.rs ├── ABC106 │ └── C1.fsx ├── ABC107 │ ├── B1.fsx │ ├── B2.fsx │ ├── B_lisp_01.lisp │ ├── B_lisp_02.lisp │ ├── B_lisp_03.lisp │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_fs_03.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ ├── C_hs_05.hs │ ├── C_hs_06.hs │ ├── C_ml_01.ml │ ├── C_rs_01.rs │ ├── C_rs_02.rs │ ├── C_rs_03.rs │ └── C_rs_04.rs ├── ABC108 │ ├── B1.fsx │ └── B2.fsx ├── ABC109 │ ├── B1.fsx │ ├── C1.fsx │ ├── C1.hs │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_00_03.fsx │ ├── D_hs_01.hs │ └── D_rs_01.rs ├── ABC110 │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_ml_01.ml │ └── C_ml_02.ml ├── ABC112 │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_hs_01.hs │ ├── C_rs_01.rs │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_rs_01.rs │ ├── D_rs_02.rs │ └── D_rs_03.rs ├── ABC113 │ ├── B_fs_00.fsx │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_fs_03.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ ├── C_hs_05.hs │ ├── C_hs_06.hs │ ├── C_hs_07.hs │ ├── C_ml_01.ml │ ├── C_ml_02.ml │ ├── C_ml_03.ml │ ├── C_ml_04.ml │ └── C_ml_05.ml ├── ABC114 │ ├── B1.fsx │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ └── C_rs_01.rs ├── ABC115 │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_hs_05.hs │ ├── D_hs_06.hs │ └── D_rs_01.rs ├── ABC116 │ ├── C1.fsx │ ├── C1.hs │ ├── C2.fsx │ ├── C2.hs │ ├── C3.hs │ └── C4.hs ├── ABC117 │ ├── C1.fsx │ └── C1.hs ├── ABC118 │ ├── B1.fsx │ ├── C1.fsx │ ├── C2.hs │ ├── C3.hs │ └── C4.hs ├── ABC120 │ └── C1.fsx ├── ABC121 │ ├── B.fsx │ ├── B1.fsx │ ├── B2.fsx │ ├── B3.fsx │ ├── B4.fsx │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_hs_01.hs │ └── D_rs_01.rs ├── ABC122 │ ├── C01.fsx │ ├── C02.hs │ └── C03.hs ├── ABC123 │ ├── B1.fsx │ ├── B2.fsx │ ├── C1.fsx │ ├── C2.hs │ └── C3.hs ├── ABC124 │ ├── C1.fsx │ ├── C2.fsx │ ├── C3.fsx │ ├── C4.fsx │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_ml_01.ml │ ├── D_py_01.py │ └── D_rs_01.rs ├── ABC125 │ ├── D.md │ ├── D_fs_00.fs │ ├── D_fs_00.fsi │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_hs_05.hs │ ├── D_hs_06.hs │ ├── D_ml_01.ml │ ├── D_ml_02.ml │ ├── D_ml_03.ml │ └── D_ml_04.ml ├── ABC126 │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_00_03.fsx │ ├── D_fs_00_04.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── ABC127 │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_hs_05.hs │ ├── D_hs_06.hs │ ├── D_ml_01.ml │ └── D_ml_02.ml ├── ABC128 │ ├── B1.fsx │ ├── B2.fsx │ ├── C01.fsx │ ├── C02.hs │ ├── C03.hs │ └── C04.hs ├── ABC129 │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── D.md │ ├── D_c_01.c │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_rs_01.rs │ ├── D_rs_02.rs │ └── D_rs_03.rs ├── ABC130 │ ├── C1.fsx │ ├── C2.hs │ ├── C3.hs │ ├── D.md │ ├── D_fs_00_00.fsx │ ├── D_fs_00_01.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_fs_03.fsx │ ├── D_fs_04.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_ml_01.ml │ ├── D_ml_02.ml │ └── D_ml_03.ml ├── ABC131 │ ├── C1.fsx │ ├── C2.fsx │ ├── D1.fsx │ ├── D2.hs │ ├── D3.hs │ └── D4.hs ├── ABC132 │ ├── C.fsx │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ └── D_hs_03.hs ├── ABC133 │ ├── B1.fsx │ ├── C1.fsx │ ├── C2.fsx │ ├── C3.hs │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_fs_03.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ └── D_rs_01.rs ├── ABC134 │ ├── C1.fsx │ ├── C2.fsx │ ├── D.md │ ├── D_fs_00_00.fsx │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_ml_01.ml │ ├── D_ml_02.ml │ ├── D_ml_03.ml │ └── D_rs_01.rs ├── ABC135 │ └── C1.fsx ├── ABC136 │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_ml_01.ml │ ├── D_ml_02.ml │ └── D_ml_03.ml ├── ABC137 │ ├── C1.fsx │ ├── C2.hs │ └── C3.hs ├── ABC138 │ ├── C.fsx │ ├── D.md │ ├── D_fs_00_00.fsx │ ├── D_fs_00_01.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_fs_03.fsx │ ├── D_hs_00.hs │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_ml_01.ml │ ├── D_ml_02.ml │ ├── D_ml_03.ml │ └── D_ml_04.ml ├── ABC139 │ ├── B0.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── B_fs_02.fsx │ ├── B_hs_01.hs │ ├── B_js_01.js │ ├── B_lisp_01.lisp │ ├── B_ml_01.ml │ ├── B_ml_02.ml │ ├── B_ml_03.ml │ ├── C1.fsx │ ├── C2.fsx │ ├── C_lisp_01.lisp │ └── D1.fsx ├── ABC140 │ ├── C1.fsx │ ├── C_lisp_01.lisp │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ └── D_rs_01.rs ├── ABC141 │ ├── C1.fsx │ ├── C2.fsx │ ├── D.md │ ├── D_fs_00_00.fsx │ ├── D_fs_00_01.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_hs_05.hs │ ├── D_ml_01.ml │ └── D_ml_02.ml ├── ABC142 │ ├── C.fsx │ ├── C_lisp_01.lisp │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_fs_03.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_ml_01.ml │ ├── D_ml_02.ml │ └── D_ml_03.ml ├── ABC143 │ ├── D01.fsx │ ├── D02.fsx │ ├── D03.fsx │ ├── D04.hs │ ├── D05.hs │ ├── D06.hs │ ├── D07.hs │ └── D08.hs ├── ABC144 │ ├── C1.fsx │ ├── D01.fsx │ ├── D02.hs │ ├── D03.hs │ └── D04.hs ├── ABC145 │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── ABC146 │ ├── C01.fsx │ ├── C02.fsx │ ├── C03.hs │ ├── C04.hs │ ├── C05.hs │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_00_03.fsx │ ├── D_fs_01.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ └── D_rs_01.rs ├── ABC147 │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_00_03.fsx │ ├── C_fs_01.fsx │ ├── C_fs_02.fsx │ ├── C_fs_03.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ ├── C_rs_01.rs │ ├── C_rs_02.rs │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── ABC148 │ ├── D1.fsx │ ├── D_lisp_01.lisp │ ├── E.md │ ├── E_fs_00.fsx │ ├── E_fs_01.fsx │ ├── E_fs_02.fsx │ ├── E_hs_01.hs │ ├── E_hs_02.hs │ ├── E_hs_03.hs │ ├── E_ml_01.ml │ ├── E_ml_02.ml │ └── E_ml_03.ml ├── ABC149 │ ├── C.fsx │ ├── C2.fsx │ ├── C3.fsx │ ├── C4.fsx │ ├── C5.fsx │ ├── C6.fsx │ ├── C7.fsx │ ├── C8.fsx │ ├── D1.fsx │ └── D2.hs ├── ABC150 │ ├── C1.fsx │ └── C2.fsx ├── ABC151 │ ├── C1.fsx │ ├── C2.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_ml_01.ml │ └── D_rs_01.rs ├── ABC152 │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── ABC153 │ ├── D1.fsx │ ├── D2.fsx │ ├── E.md │ ├── E_fs_00_01.fsx │ ├── E_fs_00_02.fsx │ ├── E_fs_01.fsx │ ├── E_hs_01.hs │ ├── E_hs_02.hs │ └── E_rs_01.rs ├── ABC154 │ └── D1.fsx ├── ABC155 │ └── C1.fsx ├── ABC156 │ ├── C0.md │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_js_01.js │ ├── C_lisp_01.lisp │ ├── C_ml_01.ml │ ├── C_ml_02.ml │ ├── C_ml_03.ml │ ├── C_ml_04.ml │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ └── D_rs_01.rs ├── ABC157 │ ├── B.fsx │ ├── C1.fsx │ ├── D.md │ ├── D_c_01.c │ ├── D_fs_00_00.fsx │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_ml_01.ml │ └── D_rs_01.rs ├── ABC158 │ ├── B1.fsx │ ├── C1.fsx │ ├── C2.fsx │ ├── D1.fsx │ ├── D2.hs │ ├── D3.hs │ └── D4.hs ├── ABC159 │ └── D1.fsx ├── ABC160 │ ├── C.fsx │ ├── C.hs │ ├── C1.fsx │ ├── C_lisp_01.lisp │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_fs_03.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_ml_01.ml │ ├── D_ml_02.ml │ ├── E.md │ ├── E_fs_00.fsx │ ├── E_hs_01.hs │ ├── E_hs_02.hs │ ├── E_hs_03.hs │ └── E_rs_04.rs ├── ABC161 │ ├── C.fsx │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_hs_05.hs │ ├── D_hs_06.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── ABC169 │ ├── A.fsx │ ├── B.fsx │ ├── C.fsx │ ├── D.fsx │ ├── D1.fsx │ ├── D2-1.fsx │ ├── D2.fsx │ ├── E.fsx │ ├── E1.fsx │ ├── F.cpp │ ├── F.fsx │ ├── F.hs │ ├── F1.hs │ ├── F1.txt │ ├── F2.txt │ ├── F3.txt │ └── Fcpp.sh ├── ABC170 │ ├── A.fsx │ ├── B.fsx │ └── C.fsx ├── ABC171 │ ├── A.fsx │ ├── B.fsx │ ├── C.fsx │ ├── C.hs │ └── C1.fsx ├── ABC172 │ ├── A.fsx │ ├── B.fsx │ ├── C.fsx │ ├── C1.fsx │ ├── CSample1.txt │ ├── CSample2.txt │ └── CSample3.txt ├── ABC173 │ ├── A.fsx │ └── B.fsx ├── ABC285 │ ├── A.md │ ├── A_fs_00.fsx │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── C.md │ └── C_fs_00.fsx ├── AGC002 │ ├── A1.fsx │ ├── B01.fsx │ └── B02.hs ├── AGC003 │ ├── A1.fsx │ ├── A2.fsx │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_hs_03.hs │ └── B_rs_01.rs ├── AGC004 │ └── A1.fsx ├── AGC005 │ ├── A.md │ ├── A_fs_00.fsx │ ├── A_fs_01.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ ├── A_hs_03.hs │ ├── A_hs_04.hs │ ├── A_rs_01.rs │ └── A_rs_02.rs ├── AGC006 │ └── A1.fsx ├── AGC007 │ ├── A1.fsx │ ├── A2.fsx │ ├── A3.hs │ └── A4.hs ├── AGC008 │ ├── A1.fsx │ ├── A2.hs │ ├── A3.hs │ ├── A4.hs │ └── A5.hs ├── AGC009 │ ├── A1.fsx │ ├── A2.hs │ └── A3.hs ├── AGC011 │ ├── A1.fsx │ ├── A2.hs │ ├── A3.hs │ ├── A4.hs │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_hs_03.hs │ ├── B_hs_04.hs │ ├── B_hs_05.hs │ └── B_rs_01.rs ├── AGC012 │ └── A1.fsx ├── AGC013 │ └── A1.fsx ├── AGC014 │ ├── A.fsx │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_ml_01.ml │ └── B_rs_01.rs ├── AGC015 │ ├── A1.fsx │ ├── B1.fsx │ ├── B1.hs │ ├── B2.hs │ ├── B3.hs │ └── B4.hs ├── AGC016 │ ├── A1.fsx │ ├── A1.hs │ ├── A2.hs │ └── A3.hs ├── AGC017 │ ├── A1.fsx │ ├── A2.fsx │ ├── A3.hs │ ├── A4.hs │ └── A5.hs ├── AGC018 │ ├── A.md │ ├── A_fs_00.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ ├── A_hs_03.hs │ └── A_rs_01.rs ├── AGC019 │ └── A1.fsx ├── AGC021 │ ├── A1.fsx │ └── A2.fsx ├── AGC022 │ ├── A01.fsx │ ├── A02.hs │ ├── A03.hs │ ├── A04.hs │ └── A05.hs ├── AGC023 │ ├── A.md │ ├── A_fs_00_01.fsx │ ├── A_fs_00_02.fsx │ ├── A_fs_01.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ └── A_rs_01.rs ├── AGC024 │ └── A1.fsx ├── AGC027 │ ├── A1.fsx │ └── A2.fsx ├── AGC028 │ ├── A1.fsx │ ├── A2.fsx │ ├── A3.hs │ ├── A4.hs │ └── A5.hs ├── AGC029 │ ├── A1.fsx │ └── A2.fsx ├── AGC031 │ ├── A01.fsx │ ├── A02.hs │ ├── A03.hs │ └── A04.hs ├── AGC032 │ ├── A01.fsx │ ├── A02.hs │ ├── A03.hs │ ├── A04.hs │ ├── A05.hs │ └── A06.hs ├── AGC033 │ ├── A.md │ ├── A_fs_00_01.fsx │ ├── A_fs_00_02.fsx │ ├── A_fs_01.fsx │ ├── A_hs_01.hs │ ├── A_ml_01.ml │ └── A_rs_01.rs ├── AGC034 │ ├── A1.fsx │ ├── A2.hs │ ├── A3.hs │ ├── A4.hs │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_rs_01.rs │ └── B_rs_02.rs ├── AGC035 │ ├── A01.fsx │ ├── A02.hs │ └── A03.hs ├── AGC036 │ ├── A.md │ ├── A_fs_00.fsx │ ├── A_hs_01.hs │ └── A_rs_01.rs ├── AGC037 │ ├── A1.fsx │ └── A2.fsx ├── AGC039 │ ├── A01.fsx │ ├── A02.hs │ ├── A03.hs │ └── A04.hs ├── AGC040 │ └── A1.fsx ├── AGC041 │ └── A1.fsx ├── AGC043 │ ├── A.md │ ├── A_fs_00.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ ├── A_hs_03.hs │ ├── A_ml_01.ml │ ├── A_ml_02.ml │ └── A_rs_01.rs ├── AGC045 │ └── B.fsx ├── AGC046 │ ├── A.fsx │ └── B.fsx ├── AGC048 │ ├── A.md │ ├── A_fs_00.fsx │ ├── A_fs_01.fsx │ ├── A_fs_02.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ ├── A_rs_01.rs │ └── A_rs_02.rs ├── AISING2020 │ ├── A.fsx │ ├── B.fsx │ └── C1.fsx ├── APC001 │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_rs_01.rs │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_hs_01.hs │ ├── C_ml_01.ml │ ├── C_ml_02.ml │ └── C_rs_01.rs ├── ARC017 │ ├── A.cpp │ └── A.fsx ├── ARC058 │ ├── A.md │ ├── A_fs_00.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ └── A_rs_01.rs ├── ARC059 │ ├── A01.fsx │ ├── A02.hs │ └── A03.hs ├── ARC061 │ ├── A.md │ ├── A_fs_00.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ ├── A_hs_03.hs │ ├── A_hs_04.hs │ ├── A_hs_05.hs │ ├── A_hs_06.hs │ └── A_rs_01.rs ├── ARC063 │ ├── A01.fsx │ ├── A02.fsx │ ├── A03.hs │ ├── A04.hs │ └── A05.hs ├── ARC067 │ ├── A.md │ ├── A_fs_00_01.fsx │ ├── A_fs_00_02.fsx │ ├── A_fs_00_03.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ ├── A_hs_03.hs │ ├── A_hs_04.hs │ ├── A_hs_05.hs │ ├── A_ml_01.ml │ ├── A_rs_01.rs │ ├── A_rs_02.rs │ ├── A_rs_03.rs │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ └── B_rs_01.rs ├── ARC068 │ ├── A01.fsx │ ├── A02.hs │ ├── A03.hs │ ├── A04.hs │ ├── A05.hs │ ├── A_fs_00.fsx │ └── B.md ├── ARC069 │ ├── A1.fsx │ └── A1.hs ├── ARC070 │ ├── A1.fsx │ ├── A1.hs │ ├── A2.fsx │ ├── A2.hs │ └── A3.hs ├── ARC071 │ ├── A1.fsx │ ├── A2.fsx │ ├── A3.hs │ ├── A4.hs │ └── A5.hs ├── ARC073 │ └── A1.fsx ├── ARC075 │ └── A1.fsx ├── ARC076 │ ├── A01.fsx │ ├── A02.hs │ └── A03.hs ├── ARC077 │ ├── A1.fsx │ ├── A1.hs │ ├── A2.hs │ ├── A3.hs │ ├── A4.hs │ └── A5.hs ├── ARC078 │ ├── A1.fsx │ ├── A2.hs │ ├── A3.hs │ ├── A4.hs │ └── A5.hs ├── ARC079 │ ├── A1.fsx │ ├── A2.hs │ ├── A3.hs │ ├── A4.hs │ └── A5.hs ├── ARC080 │ ├── A1.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_hs_01.hs │ ├── D_ml_01.ml │ └── D_ml_02.ml ├── ARC081 │ ├── A1.fsx │ └── A2.hs ├── ARC082 │ ├── A1.fsx │ ├── A_lips_01.lisp │ ├── B1.fsx │ ├── B2.fsx │ ├── B3.hs │ ├── B4.hs │ ├── B5.hs │ ├── B6.hs │ └── B7.hs ├── ARC084 │ ├── A.md │ ├── A_c_01.c │ ├── A_c_02.c │ ├── A_fs_00_01.fsx │ ├── A_fs_00_02.fsx │ ├── A_fs_01.fsx │ ├── A_fs_02.fsx │ ├── A_hs_01.hs │ ├── A_rs_01.rs │ └── A_rs_02.rs ├── ARC085 │ └── A01.fsx ├── ARC086 │ └── A1.fsx ├── ARC087 │ ├── A1.fsx │ ├── A2.hs │ ├── A3.hs │ └── A4.hs ├── ARC088 │ ├── A1.fsx │ └── A2.fsx ├── ARC090 │ └── A1.fsx ├── ARC091 │ ├── A1.fsx │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ └── B_rs_01.rs ├── ARC093 │ ├── A1.fsx │ ├── A2.hs │ └── A3.hs ├── ARC094 │ └── A1.fsx ├── ARC095 │ ├── A1.fsx │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── B_fs_02.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_hs_03.hs │ ├── B_ml_01.ml │ ├── B_ml_02.ml │ └── B_ml_03.ml ├── ARC096 │ └── A1.fsx ├── ARC098 │ ├── A01.fsx │ ├── A02.hs │ ├── A03.hs │ ├── A04.hs │ ├── A05.hs │ └── A06.hs ├── ARC099 │ └── A1.fsx ├── ARC102 │ ├── A.md │ ├── A_fs_00_01.fsx │ ├── A_fs_00_02.fsx │ ├── A_hs_01.hs │ ├── A_hs_02.hs │ ├── A_hs_03.hs │ ├── A_rs_01.rs │ ├── A_rs_02.rs │ └── A_rs_03.rs ├── ARC103 │ ├── A01.fsx │ ├── A03.hs │ └── A04.hs ├── CADDI2018 │ ├── C01.fsx │ ├── C02.fsx │ ├── C03.hs │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ └── D_hs_01.hs ├── CODEFESTIVAL2016final │ ├── B01.fsx │ ├── B02.fsx │ └── B03.hs ├── CODEFESTIVAL2016qualA │ ├── B1.fsx │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ └── C_hs_03.hs ├── CODEFESTIVAL2016qualB │ ├── B.fsx │ ├── B1.fsx │ ├── B1.hs │ ├── B2.hs │ └── B3.hs ├── CODEFESTIVAL2016qualC │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_hs_01.hs │ └── B_ml_01.ml ├── CODEFESTIVAL2017final │ ├── B1.fsx │ ├── B1.hs │ ├── B2.hs │ ├── B3.hs │ └── B4.hs ├── CODEFESTIVAL2017qualA │ ├── B01.fsx │ ├── B02.fsx │ ├── B03.hs │ ├── B04.hs │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_hs_04.hs │ ├── C_hs_05.hs │ ├── C_rs_01.rs │ └── C_rs_02.rs ├── CODEFESTIVAL2017qualB │ ├── B1.fsx │ ├── B1.hs │ ├── B2.fsx │ └── B2.hs ├── CODEFESTIVAL2017qualC │ ├── B1.fsx │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ └── C_rs_01.rs ├── DDCC2020 │ ├── B1.fsx │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_ml_01.ml │ ├── C_ml_02.ml │ └── C_rs_01.rs ├── DIVERTA2019-2 │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── B_fs_02.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ └── B_rs_01.rs ├── DIVERTA2019 │ ├── B1.fsx │ ├── B2.fsx │ ├── B3.fsx │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_ml_01.ml │ ├── C_ml_02.ml │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── DP │ ├── A00.fsx │ ├── A000.md │ ├── A00_fold.fsx │ ├── A00_mrec.fsx │ ├── A00_rec.fsx │ ├── A02.fsx │ ├── A03.fsx │ ├── A04.hs │ ├── A05.hs │ ├── A06.hs │ ├── A07.hs │ ├── A08.hs │ ├── A09.hs │ ├── A10.hs │ ├── A11_mvector.hs │ ├── A12.py │ ├── A14.ml │ ├── A15.ml │ ├── A16.ml │ ├── A17.ml │ ├── B00.fsx │ ├── B000.md │ ├── B00_fold.fsx │ ├── B00_mrec_arr.fsx │ ├── B00_mrec_seq.fsx │ ├── B03.hs │ ├── B04.hs │ ├── B05.hs │ ├── B06.hs │ ├── C00.fsx │ ├── C000.md │ ├── C00_fold.fsx │ ├── C00_mrec.fsx │ ├── C00_reduce_arr.fsx │ ├── C00_reduce_tuple.fsx │ ├── C02.hs │ ├── C03.hs │ ├── C04.hs │ ├── C05.hs │ ├── C06.hs │ ├── C07.hs │ ├── C08_mrec.py │ ├── C09_marray.hs │ ├── D00.fsx │ ├── D000.md │ ├── D00_fold.fsx │ ├── D00_mrec.fsx │ ├── D00_mutable.fsx │ ├── D03.hs │ ├── D04.hs │ ├── D05.hs │ ├── D06.hs │ ├── D07.hs │ ├── D08.hs │ ├── D09.fsx │ ├── D10.py │ ├── E00.fsx │ ├── E000.md │ ├── E00_fold.fsx │ ├── E00_mrec.fsx │ ├── E00_mutable.fsx │ ├── E01.fsx │ ├── E03.hs │ ├── E04.hs │ ├── E05.hs │ ├── E06.hs │ ├── E07.hs │ ├── F000.md │ ├── F00_fold.fsx │ ├── F00_mut.fsx │ ├── F02.hs │ ├── F03.hs │ ├── F04.fsx │ ├── F05.fsx │ ├── F06.py │ ├── G000.md │ ├── G00_fold.fsx │ ├── G00_mrec.fsx │ ├── G00_mutable.fsx │ ├── G02.hs │ ├── G03.hs │ ├── G04.hs │ ├── G05.hs │ ├── G06.hs │ ├── G07.py │ ├── G08.ml │ ├── G09.ml │ ├── G10.ml │ ├── G11.hs │ ├── G12.ml │ ├── G13.hs │ ├── H00.md │ ├── H01_fold.fsx │ ├── H01_mrec.fsx │ ├── H01_mutable.fsx │ ├── H02.ml │ ├── H03.hs │ ├── H04.hs │ ├── H05.hs │ ├── H06.py │ ├── H07.py │ ├── I00.md │ ├── I01_fold.fsx │ ├── I01_mrec.fsx │ ├── I01_mut.fsx │ ├── I02.ml │ ├── I03.ml │ ├── I04.hs │ ├── I05.hs │ ├── I06.hs │ ├── I07.hs │ ├── I08.py │ ├── I09.ml │ ├── J00.md │ ├── J01_mrec.fsx │ ├── J02.ml │ ├── J03.hs │ ├── K00.md │ ├── K01_fold.fsx │ ├── K02.ml │ ├── K03.ml │ ├── K04.hs │ ├── K05.hs │ ├── K06.hs │ ├── K07.hs │ ├── K08.hs │ ├── L00.md │ ├── L01_fold.fsx │ ├── L02.ml │ ├── L03.hs │ ├── L04.hs │ ├── M00.md │ ├── M01_fold.fsx │ ├── M01_mut.fsx │ ├── M02.ml │ ├── M03.hs │ ├── N00.md │ ├── N01_fold.fsx │ ├── N01_mut.fsx │ ├── N02.ml │ ├── N03.ml │ ├── N04.hs │ ├── N05.hs │ ├── O00.md │ ├── O01_fold.fsx │ ├── O01_mut.fsx │ ├── O02.ml │ ├── O03.hs │ ├── O04.csx │ ├── O05.py │ ├── P00.md │ ├── P01_mrec_arr.fsx │ ├── P01_mrec_dict.fsx │ ├── P02.ml │ ├── P03.hs │ ├── P04.hs │ ├── P05.py │ ├── P06.py │ ├── P07.ml │ ├── Q00.md │ ├── Q01_TODO.fsx │ ├── Q02.ml │ ├── Q03.hs │ ├── Q04.py │ ├── R00.md │ ├── R01_fold.fsx │ ├── R01_mut.fsx │ ├── R02.hs │ ├── R03.py │ ├── R04.py │ ├── S00.md │ ├── S01_fold.fsx │ ├── S02_mut.fsx │ ├── S03.hs │ ├── S04.js │ ├── S05.py │ ├── S06.py │ ├── T00.md │ ├── T01_fold.fsx │ ├── T01_mut.fsx │ ├── T03.hs │ ├── T04.py │ ├── T05.py │ ├── T06.py │ ├── U00.md │ ├── U01_fold.fsx │ ├── U01_mut.fsx │ ├── U03.hs │ ├── U04.py │ ├── U05.py │ ├── U06.py │ ├── U07.py │ ├── V00.md │ ├── V01_TODO.fsx │ ├── V03.hs │ ├── V04.py │ ├── V05.py │ ├── V06.py │ ├── V07.cpp │ ├── V08.py │ ├── W00_TODO.fsx │ ├── X00.md │ ├── X01_mut.fsx │ ├── X02.py │ ├── Y01_mut.fsx │ ├── Y02.py │ ├── Z01_mut_TODO.fsx │ ├── Z02.py │ ├── Z03.rb │ └── readme.md ├── HITACHI2020 │ └── B1.fsx ├── KEYENCE2019 │ ├── B1.fsx │ ├── C01.fsx │ ├── C02.hs │ ├── C03.hs │ ├── C04.hs │ ├── C05.hs │ └── C06.hs ├── KEYENCE2020 │ ├── B.md │ ├── B_fs_00_01.fsx │ ├── B_fs_00_02.fsx │ ├── B_fs_00_03.fsx │ ├── B_fs_00_04.fsx │ ├── B_fs_01.fsx │ ├── B_fs_02.fsx │ ├── B_fs_03.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_hs_03.hs │ ├── B_ml_01.ml │ ├── B_ml_02.ml │ ├── B_ml_03.ml │ ├── C1.fsx │ ├── C2.hs │ └── C3.hs ├── Nikkei2019-2Qual │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── B_fs_02.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_ml_01.ml │ └── B_ml_02.ml ├── Nikkei2019-Qual │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_hs_01.hs │ └── C_rs_01.rs ├── PANASONIC2020 │ ├── B.fsx │ ├── C1.fsx │ ├── C2.hs │ ├── D.md │ ├── D_fs_00_01.fsx │ ├── D_fs_00_02.fsx │ ├── D_fs_00_03.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_rs_01.rs │ └── D_rs_02.rs ├── Practice1A │ ├── A.cpp │ └── A.fsx ├── SC2019qualB │ ├── B.md │ ├── B_fs_00.fsx │ ├── B_fs_01.fsx │ ├── B_hs_01.hs │ ├── B_hs_02.hs │ ├── B_hs_03.hs │ ├── B_hs_04.hs │ ├── B_ml_01.ml │ └── B_ml_02.ml ├── SUMITRUST2019 │ ├── B.fsx │ ├── C1.fsx │ ├── D.md │ ├── D_fs_00.fsx │ ├── D_fs_01.fsx │ ├── D_fs_02.fsx │ ├── D_hs_01.hs │ ├── D_hs_02.hs │ ├── D_hs_03.hs │ ├── D_hs_04.hs │ ├── D_ml_01.ml │ ├── D_ml_02.ml │ ├── D_ml_03.ml │ ├── E.md │ ├── E_fs_00.fsx │ ├── E_hs_01.hs │ ├── E_hs_02.hs │ ├── E_hs_03.hs │ └── E_rs_01.rs ├── TENKA1-2017 │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_fs_01.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ └── C_rs_01.rs ├── TENKA1-2018 │ ├── C.md │ ├── C_fs_00_01.fsx │ ├── C_fs_00_02.fsx │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ ├── C_hs_03.hs │ ├── C_py_00.py │ ├── C_py_01.py │ ├── C_py_02.py │ ├── C_py_03.py │ └── C_rs_01.rs ├── TENKA1-2019 │ ├── C.md │ ├── C_fs_00.fsx │ ├── C_fs_01.fsx │ ├── C_hs_00.hs │ ├── C_hs_01.hs │ ├── C_hs_02.hs │ └── C_rs_01.rs ├── TOKIOMARINE202006 │ └── A.fsx ├── YAHOOPROCON2019 │ ├── C1.fsx │ └── C1.hs ├── readme.md └── tessoku-book │ ├── A01 │ ├── A01.md │ ├── A01_fs_01.fsx │ └── A01_rs_00_01.rs │ ├── A02 │ ├── A02.md │ ├── A02_fs_00_01.fsx │ ├── A02_fs_00_02.fsx │ ├── A02_rs_00_01.rs │ └── A02_rs_01.rs │ ├── A03 │ ├── A03.md │ ├── A03_fs_00_01.fsx │ ├── A03_fs_00_02.fsx │ ├── A03_hs_01.hs │ ├── A03_rs_00_01.rs │ └── A03_rs_01.rs │ ├── A04 │ ├── A04.md │ ├── A04_fs_00_01.fsx │ ├── A04_fs_00_02.fsx │ ├── A04_rs_00_01.rs │ └── A04_rs_01.rs │ ├── A05 │ ├── A05.md │ ├── A05_fs_00_01.fsx │ ├── A05_fs_00_02.fsx │ ├── A05_hs_01.hs │ ├── A05_hs_02.hs │ ├── A05_rs_00_01.rs │ ├── A05_rs_00_02.rs │ └── A05_rs_01.rs │ ├── A06 │ ├── A06.md │ ├── A06_fs_00_01.fsx │ ├── A06_hs_01.hs │ ├── A06_hs_02.hs │ ├── A06_rs_00_01.rs │ └── A06_rs_01.rs │ ├── A07 │ ├── A07.md │ ├── A07_fs_00_01.fsx │ ├── A07_fs_00_02.fsx │ ├── A07_hs_01.hs │ ├── A07_rs_00_01.rs │ ├── A07_rs_00_02.rs │ ├── A07_rs_01.rs │ └── A07_rs_02.rs │ ├── A08 │ ├── A08.md │ ├── A08_fs_00_01.fsx │ ├── A08_fs_00_02.fsx │ ├── A08_hs_01.hs │ ├── A08_hs_02.hs │ ├── A08_rs_00_01.rs │ ├── A08_rs_00_02.rs │ └── A08_rs_01.rs │ ├── A09 │ ├── A09.md │ ├── A09_fs_00_01.fsx │ ├── A09_hs_01.hs │ ├── A09_hs_02.hs │ ├── A09_hs_03.hs │ ├── A09_rs_00_01.rs │ └── A09_rs_01.rs │ ├── A10 │ ├── A10.md │ ├── A10_fs_00_01.fsx │ ├── A10_hs_01.hs │ ├── A10_hs_02.hs │ ├── A10_rs_00_01.rs │ ├── A10_rs_01.rs │ ├── A10_rs_02.rs │ └── A10_rs_03.rs │ ├── A11 │ ├── A11.md │ ├── A11_fs_00_01.fsx │ ├── A11_hs_01.hs │ ├── A11_hs_02.hs │ ├── A11_hs_03.hs │ ├── A11_rs_00_01.rs │ ├── A11_rs_01.rs │ └── A11_rs_02.rs │ ├── A12 │ ├── A12.md │ ├── A12_fs_00_01.fsx │ ├── A12_hs_01.hs │ ├── A12_hs_02.hs │ ├── A12_hs_03.hs │ ├── A12_rs_00_01.rs │ ├── A12_rs_01.rs │ └── A12_rs_02.rs │ ├── A13 │ ├── A13.md │ ├── A13_fs_00_01.fsx │ ├── A13_fs_00_02.fsx │ ├── A13_hs_01.hs │ ├── A13_hs_02.hs │ ├── A13_hs_03.hs │ ├── A13_hs_04.hs │ ├── A13_rs_00_01.rs │ ├── A13_rs_01.rs │ ├── A13_rs_02.rs │ ├── A13_rs_03.rs │ └── A13_rs_04.rs │ ├── A14 │ ├── A14.md │ ├── A14_fs_00_01.fsx │ ├── A14_fs_00_02.fsx │ ├── A14_fs_00_03.fsx │ ├── A14_fs_00_04.fsx │ ├── A14_hs_01.hs │ ├── A14_rs_01.rs │ ├── A14_rs_02.rs │ └── A14_rs_03.rs │ ├── A15 │ ├── A15.md │ ├── A15_cs_01.cs │ ├── A15_fs_00_01.fsx │ ├── A15_fs_00_02.fsx │ ├── A15_fs_01.fsx │ ├── A15_hs_01.hs │ ├── A15_rs_00_01.rs │ ├── A15_rs_01.rs │ └── A15_rs_02.rs │ ├── A16 │ ├── A16.md │ ├── A16_fs_00_01.fsx │ ├── A16_fs_00_02.fsx │ ├── A16_hs_01.hs │ ├── A16_rs_00_01.rs │ ├── A16_rs_01.rs │ └── A16_rs_02.rs │ ├── A17 │ ├── A17.md │ ├── A17_fs_00_01.fsx │ ├── A17_fs_00_02.fsx │ ├── A17_fs_00_03.fsx │ ├── A17_hs_01.hs │ ├── A17_rs_00_01.rs │ ├── A17_rs_01.rs │ └── A17_rs_02.rs │ ├── A18 │ ├── A18.md │ ├── A18_fs_00_01.fsx │ ├── A18_fs_00_02.fsx │ ├── A18_fs_00_03.fsx │ ├── A18_hs_01.hs │ ├── A18_rs_00_01.rs │ ├── A18_rs_01.rs │ └── A18_rs_02.rs │ ├── A19 │ ├── A19.md │ ├── A19_fs_00_01.fsx │ ├── A19_hs_01.hs │ ├── A19_hs_02.hs │ ├── A19_rs_00_01.rs │ └── A19_rs_01.rs │ ├── A20 │ ├── A20.md │ ├── A20_fs_00_01.fsx │ ├── A20_fs_00_02.fsx │ ├── A20_hs_01.hs │ ├── A20_hs_02.hs │ ├── A20_hs_03.hs │ ├── A20_hs_04.hs │ └── A20_rs_01.rs │ ├── A21 │ ├── A21.md │ ├── A21_fs_00_01.fsx │ ├── A21_fs_00_02.fsx │ ├── A21_hs_01.hs │ ├── A21_py_00_01.py │ ├── A21_py_00_02.py │ ├── A21_py_00_03.py │ ├── A21_py_01.py │ ├── A21_py_02.py │ ├── A21_py_03.py │ ├── A21_rs_01.rs │ ├── A21_rs_02.rs │ └── A21_rs_03.rs │ ├── A22 │ ├── A22.md │ ├── A22_fs_00_01.fsx │ ├── A22_hs_01.hs │ ├── A22_hs_02.hs │ ├── A22_py_00.py │ ├── A22_py_01.py │ └── A22_rs_01.rs │ ├── A23 │ ├── A23.md │ ├── A23_fs_00_01.fsx │ ├── A23_hs_01.hs │ ├── A23_py_00.py │ ├── A23_py_01.py │ └── A23_rs_01.rs │ ├── A24 │ ├── A24.md │ ├── A24_fs_00_01.fsx │ ├── A24_hs_01.hs │ ├── A24_py_00.py │ ├── A24_py_01.py │ └── A24_rs_01.rs │ ├── A25 │ ├── A25.md │ ├── A25_fs_00_01.fsx │ ├── A25_hs_01.hs │ ├── A25_hs_02.hs │ └── A25_rs_01.rs │ ├── A26 │ ├── A26.md │ ├── A26_fs_00_01.fsx │ ├── A26_hs_01.hs │ ├── A26_hs_02.hs │ └── A26_rs_01.rs │ ├── A27 │ ├── A27.md │ └── A27_fs_00_01.fsx │ ├── A28 │ ├── A28.md │ ├── A28_fs_00_01.fsx │ ├── A28_hs_01.hs │ └── A28_rs_01.rs │ ├── A29 │ ├── A29.md │ ├── A29_fs_00_01.fsx │ ├── A29_hs_01.hs │ └── A29_rs_01.rs │ ├── A30 │ ├── A30.md │ ├── A30_fs_00_01.fsx │ ├── A30_hs_01.hs │ ├── A30_hs_02.hs │ └── A30_rs_01.rs │ ├── A31 │ ├── A31.md │ ├── A31_fs_00_01.fsx │ ├── A31_hs_01.hs │ └── A31_rs_01.rs │ ├── A32 │ ├── A32.md │ ├── A32_fs_00_01.fsx │ ├── A32_fs_00_02.fsx │ ├── A32_hs_01.hs │ ├── A32_hs_02.hs │ └── A32_rs_01.rs │ ├── A33 │ ├── A33.md │ ├── A33_fs_00_01.fsx │ ├── A33_hs_01.hs │ └── A33_rs_01.rs │ ├── A34 │ ├── A34.md │ ├── A34_fs_00_01.fsx │ ├── A34_fs_00_02.fsx │ ├── A34_hs_01.hs │ └── A34_rs_01.rs │ ├── A35 │ ├── A35.md │ ├── A35_fs_00_01.fsx │ ├── A35_hs_01.hs │ ├── A35_hs_02.hs │ └── A35_rs_01.rs │ ├── A36 │ ├── A36.md │ ├── A36_fs_00_01.fsx │ ├── A36_hs_01.hs │ └── A36_rs_01.rs │ ├── A37 │ ├── A37.md │ ├── A37_fs_00_01.fsx │ ├── A37_hs_01.hs │ ├── A37_rs_01.rs │ └── A37_rs_02.rs │ ├── A38 │ ├── A38.md │ ├── A38_fs_00_01.fsx │ ├── A38_hs_01.hs │ └── A38_rs_01.rs │ ├── A39 │ ├── A39.md │ ├── A39_fs_00_01.fsx │ ├── A39_hs_01.hs │ ├── A39_hs_02.hs │ └── A39_rs_01.rs │ ├── A40 │ ├── A40.md │ ├── A40_fs_00_01.fsx │ ├── A40_hs_01.hs │ └── A40_rs_01.rs │ ├── A41 │ ├── A41.md │ ├── A41_fs_00_01.fsx │ ├── A41_hs_01.hs │ └── A41_rs_01.rs │ ├── A42 │ ├── A42.md │ ├── A42_fs_00_01.fsx │ ├── A42_hs_01.hs │ ├── A42_rs_01.rs │ └── A42_rs_02.rs │ ├── A43 │ ├── A43.md │ ├── A43_fs_00_01.fsx │ ├── A43_hs_01.hs │ └── A43_rs_01.rs │ ├── A44 │ ├── A44.md │ ├── A44_fs_00_01.fsx │ ├── A44_fs_00_02.fsx │ ├── A44_hs_01.hs │ └── A44_rs_01.rs │ ├── A45 │ ├── A45.md │ ├── A45_fs_00_01.fsx │ ├── A45_hs_01.hs │ ├── A45_hs_02.hs │ └── A45_rs_01.rs │ ├── A46 │ ├── A46.md │ ├── A46_fs_00_01.fsx │ ├── A46_fs_00_02.fsx │ ├── A46_fs_00_03.fsx │ ├── A46_ml_01.ml │ ├── A46_rs_01.rs │ ├── A46_rs_02.rs │ └── A46_rs_03.rs │ ├── A49 │ ├── A49.md │ ├── A49_fs_00_01.fsx │ └── A49_rs_01.rs │ ├── A50 │ ├── A50.md │ ├── A50_cs_01.cs │ ├── A50_fs_00_01.fsx │ ├── A50_rs_01.rs │ ├── example_01.txt │ └── example_01_out.txt │ ├── A51 │ ├── A51.md │ ├── A51_cs_01.cs │ ├── A51_fs_00_01.fsx │ ├── A51_hs_01.hs │ └── A51_rs_01.rs │ ├── A52 │ ├── A52.md │ ├── A52_cs_01.cs │ ├── A52_fs_00_01.fsx │ ├── A52_fs_00_02.fsx │ ├── A52_hs_01.hs │ └── A52_rs_01.rs │ ├── A53 │ ├── A53.md │ ├── A53_cs_01.cs │ ├── A53_fs_00_01.fsx │ ├── A53_fs_00_02.fsx │ ├── A53_hs_01.hs │ ├── A53_rs_01.rs │ └── A53_rs_02.rs │ ├── A54 │ ├── A54.md │ ├── A54_cs_01.cs │ ├── A54_fs_00_01.fsx │ ├── A54_hs_01.hs │ └── A54_rs_01.rs │ ├── A55 │ ├── A55.md │ ├── A55_cs_00_01.cs │ ├── A55_cs_01.cs │ ├── A55_fs_00_01.fsx │ ├── A55_fs_00_02.fsx │ ├── A55_hs_01.hs │ └── A55_rs_01.rs │ ├── A56 │ ├── A56.md │ ├── A56_cs_01.cs │ ├── A56_cs_02.cs │ ├── A56_fs_00_01.fsx │ ├── A56_hs_01.hs │ └── A56_rs_01.rs │ ├── A57 │ ├── A57.md │ ├── A57_cs_01.cs │ ├── A57_fs_00_01.fsx │ ├── A57_hs_01.hs │ └── A57_rs_01.rs │ ├── A58 │ ├── A58.md │ ├── A58_cs_01.cs │ ├── A58_fs_00_01.fsx │ ├── A58_hs_01.hs │ └── A58_rs_01.rs │ ├── A59 │ ├── A59.md │ ├── A59_cs_01.cs │ ├── A59_fs_00_01.fsx │ ├── A59_hs_01.hs │ └── A59_rs_01.rs │ ├── A60 │ ├── A60.md │ ├── A60_cs_01.cs │ ├── A60_fs_00_01.fsx │ ├── A60_hs_01.hs │ ├── A60_rs_01.rs │ └── A60_rs_02.rs │ ├── A61 │ ├── A61.md │ ├── A61_cs_01.cs │ ├── A61_fs_00_01.fsx │ ├── A61_hs_01.hs │ └── A61_rs_01.rs │ ├── A62 │ ├── A62.md │ ├── A62_cs_01.cs │ ├── A62_fs_00_01.fsx │ ├── A62_hs_01.hs │ └── A62_rs_01.rs │ ├── A63 │ ├── A63.md │ ├── A63_cs_01.cs │ ├── A63_fs_00_01.fsx │ ├── A63_fs_00_02.fsx │ ├── A63_hs_01.hs │ ├── A63_hs_02.hs │ └── A63_rs_01.rs │ ├── A64 │ ├── A64.md │ ├── A64_cs_01.cs │ ├── A64_fs_00_01.fsx │ ├── A64_hs_01.hs │ └── A64_rs_01.rs │ ├── A65 │ ├── A65.md │ ├── A65_cs_01.cs │ ├── A65_fs_00_01.fsx │ ├── A65_fs_00_02.fsx │ ├── A65_hs_01.hs │ ├── A65_py_01.py │ ├── A65_rs_01.rs │ └── A65_rs_02.rs │ ├── A66 │ ├── A66.md │ ├── A66_cs_01.cs │ ├── A66_fs_00_01.fsx │ ├── A66_hs_01.hs │ └── A66_rs_01.rs │ ├── A67 │ ├── A67.md │ ├── A67_cs_01.cs │ ├── A67_fs_00_01.fsx │ ├── A67_hs_01.hs │ └── A67_rs_01.rs │ ├── A68 │ ├── A68.md │ ├── A68_cs_01.cs │ ├── A68_fs_00_01.fsx │ ├── A68_fs_00_02.fsx │ ├── A68_hs_01.hs │ ├── A68_py_00_01.py │ ├── A68_py_00_02.py │ ├── A68_py_01.py │ └── A68_rs_01.rs │ ├── A69 │ ├── A69.md │ ├── A69_cs_01.cs │ ├── A69_fs_00_01.fsx │ ├── A69_fs_00_02.fsx │ ├── A69_hs_01.hs │ ├── A69_py_00.py │ ├── A69_py_01.py │ └── A69_rs_01.rs │ ├── A70 │ ├── A70.md │ ├── A70_cs_01.cs │ ├── A70_fs_00_01.fsx │ ├── A70_fs_00_02.fsx │ ├── A70_hs_01.hs │ ├── A70_py_00.py │ ├── A70_py_01.py │ └── A70_rs_01.rs │ ├── A71 │ ├── A71.md │ ├── A71_cs_01.cs │ ├── A71_fs_00_01.fsx │ ├── A71_hs_01.hs │ └── A71_rs_01.rs │ ├── A72 │ ├── A72.md │ ├── A72_cs_01.cs │ ├── A72_fs_00_01.fsx │ ├── A72_hs_01.hs │ └── A72_rs_01.rs │ ├── A73 │ ├── A73.md │ ├── A73_cs_01.cs │ ├── A73_fs_00_01.fsx │ ├── A73_fs_00_02.fsx │ ├── A73_fs_00_03.fsx │ ├── A73_hs_01.hs │ └── A73_rs_01.rs │ ├── A74 │ ├── A74.md │ ├── A74_cs_01.cs │ ├── A74_fs_00_01.fsx │ └── A74_rs_01.rs │ ├── A75 │ ├── A75.md │ ├── A75_cs_01.cs │ ├── A75_fs_00_01.fsx │ ├── A75_fs_00_02.fsx │ ├── A75_py_00_01.py │ ├── A75_py_00_02.py │ ├── A75_py_01.py │ ├── A75_py_02.py │ └── A75_rs_01.rs │ ├── A76 │ ├── A76.md │ ├── A76_cs_01.cs │ ├── A76_fs_00_01.fsx │ ├── A76_hs_01.hs │ ├── A76_rs_01.rs │ └── A76_rs_02.rs │ ├── A77 │ ├── A77.md │ ├── A77_cs_01.cs │ ├── A77_fs_00_01.fsx │ ├── A77_hs_01.hs │ └── A77_rs_01.rs │ ├── B01 │ ├── B01.md │ ├── B01_cs_01.cs │ ├── B01_fs_00.fsx │ ├── B01_hs_01.hs │ └── B01_rs_01.rs │ ├── B02 │ ├── B02.md │ ├── B02_cs_01.cs │ ├── B02_fs_00.fsx │ ├── B02_hs_01.hs │ └── B02_rs_01.rs │ ├── B03 │ ├── B03.md │ ├── B03_cs_01.cs │ ├── B03_fs_00.fsx │ ├── B03_hs_01.hs │ └── B03_rs_01.rs │ ├── B04 │ ├── B04.md │ ├── B04_cs_01.cs │ ├── B04_fs_00.fsx │ ├── B04_hs_01.hs │ └── B04_rs_01.rs │ ├── B06 │ ├── B06.md │ ├── B06_cs_01.cs │ ├── B06_fs_00_01.fsx │ ├── B06_hs_01.hs │ └── B06_rs_01.rs │ ├── B07 │ ├── B07.md │ ├── B07_cs_01.cs │ ├── B07_fs_00_01.fsx │ ├── B07_hs_01.hs │ ├── B07_hs_02.hs │ └── B07_rs_01.rs │ ├── B08 │ ├── B08.md │ ├── B08_cs_01.cs │ ├── B08_fs_00_01.fsx │ ├── B08_hs_01.hs │ └── B08_rs_01.rs │ ├── B09 │ ├── B09.md │ ├── B09_cs_01.cs │ ├── B09_fs_00_01.fsx │ ├── B09_fs_00_02.fsx │ ├── B09_fs_00_03.fsx │ ├── B09_hs_01.hs │ └── B09_rs_01.rs │ ├── B11 │ ├── B11.md │ ├── B11_cs_01.cs │ ├── B11_fs_00_01.fsx │ ├── B11_hs_01.hs │ ├── B11_hs_02.hs │ └── B11_rs_01.rs │ ├── B12 │ ├── B12.md │ ├── B12_cs_01.cs │ ├── B12_fs_00_01.fsx │ ├── B12_hs_01.hs │ └── B12_rs_01.rs │ ├── B13 │ ├── B13.md │ ├── B13_cs_01.cs │ ├── B13_fs_00_01.fsx │ ├── B13_fs_00_02.fsx │ ├── B13_hs_01.hs │ └── B13_rs_01.rs │ ├── B14 │ ├── B14.md │ ├── B14_cs_01.cs │ ├── B14_fs_00_01.fsx │ ├── B14_hs_01.hs │ └── B14_rs_01.rs │ ├── B16 │ ├── B16.md │ ├── B16_cs_01.cs │ ├── B16_fs_00_01.fsx │ ├── B16_hs_01.hs │ ├── B16_rs_01.rs │ └── B16_rs_02.rs │ ├── B17 │ ├── B17.md │ ├── B17_cs_01.cs │ ├── B17_fs_00_01.fsx │ ├── B17_fs_00_02.fsx │ ├── B17_hs_01.hs │ └── B17_rs_01.rs │ ├── B18 │ ├── B18.md │ ├── B18_cpp_01.cpp │ └── B18_fs_00_01.fsx │ ├── B19 │ ├── B19.md │ ├── B19_cpp_01.cpp │ ├── B19_cs_01.cs │ ├── B19_fs_00_01.fsx │ ├── B19_fs_00_02.fsx │ ├── B19_fs_00_03.fsx │ ├── B19_hs_01.hs │ ├── B19_rs_01.rs │ └── B19_rs_02.rs │ ├── B20 │ ├── B20.md │ ├── B20_cs_01.cs │ ├── B20_fs_00_01.fsx │ ├── B20_fs_00_02.fsx │ ├── B20_fs_00_03.fsx │ ├── B20_hs_01.hs │ ├── B20_hs_02.hs │ ├── B20_py_01.py │ ├── B20_py_02.py │ ├── B20_py_03.py │ └── B20_rs_01.rs │ ├── B21 │ ├── B21.md │ ├── B21_cs_01.cs │ ├── B21_fs_00_01.fsx │ ├── B21_hs_01.hs │ └── B21_rs_01.rs │ ├── B23 │ ├── B23.md │ ├── B23_cs_01.cs │ ├── B23_fs_00_01.fsx │ ├── B23_hs_01.hs │ ├── B23_py_01.py │ └── B23_rs_01.rs │ ├── B24 │ ├── B24.md │ ├── B24_cs_01.cs │ ├── B24_fs_00_01.fsx │ ├── B24_hs_01.hs │ ├── B24_py_00_01.py │ ├── B24_py_01.py │ └── B24_rs_01.rs │ ├── B26 │ ├── B26.md │ ├── B26_cs_01.cs │ ├── B26_fs_00_01.fsx │ ├── B26_fs_00_02.fsx │ ├── B26_fs_00_03.fsx │ ├── B26_hs_01.hs │ └── B26_rs_01.rs │ ├── B27 │ ├── B27.md │ ├── B27_cs_01.cs │ ├── B27_fs_00_01.fsx │ ├── B27_hs_01.hs │ └── B27_rs_01.rs │ ├── B28 │ ├── B28.md │ ├── B28_cs_01.cs │ ├── B28_fs_00_01.fsx │ ├── B28_fs_00_02.fsx │ ├── B28_hs_01.hs │ └── B28_rs_01.rs │ ├── B29 │ ├── B29.md │ ├── B29_cs_01.cs │ ├── B29_cs_02.cs │ ├── B29_fs_00_01.fsx │ ├── B29_fs_00_02.fsx │ ├── B29_hs_01.hs │ ├── B29_rs_01.rs │ └── B29_rs_02.rs │ ├── B30 │ ├── B30.md │ ├── B30_cs_01.cs │ ├── B30_fs_00_01.fsx │ ├── B30_hs_01.hs │ └── B30_rs_01.rs │ ├── B31 │ ├── B31.md │ ├── B31_cs_01.cs │ ├── B31_fs_00_01.fsx │ ├── B31_hs_01.hs │ └── B31_rs_01.rs │ ├── B32 │ ├── B32.md │ ├── B32_cs_01.cs │ ├── B32_fs_00_01.fsx │ ├── B32_hs_01.hs │ ├── B32_py_00_01.py │ ├── B32_py_01.py │ └── B32_rs_01.rs │ ├── B33 │ ├── B33.md │ ├── B33_cs_01.cs │ ├── B33_cs_02.cs │ ├── B33_fs_00_01.fsx │ ├── B33_hs_01.hs │ └── B33_rs_01.rs │ ├── B34 │ ├── B34.md │ ├── B34_cs_01.cs │ ├── B34_fs_00_01.fsx │ ├── B34_hs_01.hs │ ├── B34_hs_02.hs │ └── B34_rs_01.rs │ ├── B36 │ ├── B36.md │ ├── B36_cs_01.cs │ ├── B36_fs_00_01.fsx │ ├── B36_hs_01.hs │ └── B36_rs_01.rs │ ├── B37 │ ├── B37.md │ ├── B37_cs_01.cs │ ├── B37_fs_00_01.fsx │ ├── B37_hs_01.hs │ └── B37_rs_01.rs │ ├── B38 │ ├── B38.md │ ├── B38_cs_01.cs │ ├── B38_fs_00_01.fsx │ ├── B38_hs_01.hs │ └── B38_rs_01.rs │ ├── B39 │ ├── B39.md │ ├── B39_cpp_01.cpp │ ├── B39_cs_01.cs │ ├── B39_fs_00_01.fsx │ ├── B39_fs_00_02.fsx │ ├── B39_hs_01.hs │ ├── B39_hs_02.hs │ └── B39_rs_01.rs │ ├── B40 │ ├── B40.md │ ├── B40_cs_01.cs │ ├── B40_fs_00_01.fsx │ ├── B40_hs_01.hs │ └── B40_rs_01.rs │ ├── B41 │ ├── B41.md │ ├── B41_fs_00_01.fsx │ ├── B41_fs_00_02.fsx │ ├── B41_fs_00_03.fsx │ ├── B41_fs_00_04.fsx │ ├── B41_hs_01.hs │ └── B41_rs_01.rs │ ├── B42 │ ├── B42.md │ ├── B42_cs_01.cs │ ├── B42_fs_00_01.fsx │ ├── B42_hs_01.hs │ └── B42_rs_01.rs │ ├── B43 │ ├── B43.md │ ├── B43_fs_00_01.fsx │ ├── B43_hs_01.hs │ └── B43_rs_01.rs │ ├── B44 │ ├── B44.md │ ├── B44_fs_00_01.fsx │ ├── B44_hs_01.hs │ └── B44_rs_01.rs │ ├── B45 │ ├── B45.md │ ├── B45_fs_00_01.fsx │ ├── B45_hs_01.hs │ └── B45_rs_01.rs │ ├── B51 │ ├── B51.md │ ├── B51_fs_00_01.fsx │ ├── B51_hs_01.hs │ └── B51_rs_01.rs │ ├── B52 │ ├── B52.md │ ├── B52_cs_01.cs │ ├── B52_fs_00_01.fsx │ ├── B52_hs_01.hs │ └── B52_rs_01.rs │ ├── B54 │ ├── B54.md │ ├── B54_fs_00_01.fsx │ ├── B54_fs_00_02.fsx │ ├── B54_hs_01.hs │ └── B54_rs_01.rs │ ├── B55 │ ├── B55.md │ ├── B55_cs_01.cs │ ├── B55_fs_00_01.fsx │ ├── B55_hs_01.hs │ └── B55_rs_01.rs │ ├── B56 │ ├── B56.md │ ├── B56_cs_01.cs │ ├── B56_fs_00_01.fsx │ ├── B56_hs_01.hs │ ├── B56_py_00_01.py │ ├── B56_py_01.py │ └── B56_rs_01.rs │ ├── B57 │ ├── B57.md │ ├── B57_cp_01.cpp │ ├── B57_cs_01.cs │ ├── B57_fs_00_01.fsx │ ├── B57_fs_00_02.fsx │ ├── B57_hs_01.hs │ └── B57_rs_01.rs │ ├── B58 │ ├── B58.md │ ├── B58_cp_01.cpp │ ├── B58_cs_01.cs │ ├── B58_fs_00_01.fsx │ ├── B58_fs_00_02.fsx │ ├── B58_fs_00_03.fsx │ ├── B58_hs_01.hs │ ├── B58_js_01.js │ ├── B58_py_01.py │ └── B58_rs_01.rs │ ├── B59 │ ├── B59.md │ ├── B59_cs_01.cs │ ├── B59_fs_00_01.fsx │ ├── B59_hs_01.hs │ ├── B59_js_01.js │ └── B59_rs_01.rs │ ├── B61 │ ├── B61.md │ ├── B61_cs_01.cs │ ├── B61_fs_00_01.fsx │ ├── B61_hs_01.hs │ └── B61_rs_01.rs │ ├── B62 │ ├── B62.md │ ├── B62_01.rs │ ├── B62_cp_01.cpp │ ├── B62_cs_01.cs │ ├── B62_fs_00_01.fsx │ ├── B62_fs_00_02.fsx │ ├── B62_hs_01.hs │ └── B62_hs_02.hs │ ├── B63 │ ├── B63.md │ ├── B63_cp_01.cpp │ ├── B63_cs_01.cs │ ├── B63_fs_00_01.fsx │ ├── B63_hs_01.hs │ └── B63_rs_01.rs │ ├── B64 │ ├── B64.md │ ├── B64_cp_01.cpp │ ├── B64_cs_01.cs │ ├── B64_fs_00_01.fsx │ ├── B64_hs_01.hs │ ├── B64_py_01.py │ └── B64_rs_01.rs │ ├── B65 │ ├── B65.md │ ├── B65_cs_01.cs │ ├── B65_fs_00_01.fsx │ ├── B65_hs_00.hs │ ├── B65_hs_01.hs │ ├── B65_py_01.py │ ├── B65_rs_00_01.rs │ └── B65_rs_01.rs │ ├── B66 │ ├── B66.md │ ├── B66_cs_01.cs │ ├── B66_fs_00_01.fsx │ ├── B66_hs_01.hs │ ├── B66_py_00.py │ ├── B66_py_01.py │ ├── B66_rs_01.rs │ └── B66_rs_02.rs │ ├── B67 │ ├── B67.md │ ├── B67_cp_01.cpp │ ├── B67_cs_01.cs │ ├── B67_fs_00_01.fsx │ ├── B67_hs_01.hs │ ├── B67_py_01.py │ └── B67_rs_01.rs │ ├── B68 │ ├── B68.md │ ├── B68_cp_01.cpp │ ├── B68_cs_01.cs │ ├── B68_fs_00_01.fsx │ ├── B68_fs_00_02.fsx │ ├── B68_hs_01.hs │ ├── B68_py_01.py │ └── B68_rs_01.rs │ ├── B69 │ ├── B69.md │ ├── B69_cs_01.cs │ ├── B69_fs_00_01.fsx │ ├── B69_hs_01.hs │ └── B69_rs_01.rs │ ├── C01 │ ├── C01.md │ ├── C01_cs_01.cs │ ├── C01_fs_00_01.fsx │ ├── C01_hs_01.hs │ └── C01_rs_01.rs │ ├── C02 │ ├── C02.md │ ├── C02_cs_01.cs │ ├── C02_fs_00_01.fsx │ ├── C02_hs_01.hs │ └── C02_rs_01.rs │ ├── C03 │ ├── C03.md │ ├── C03_cs_01.cs │ ├── C03_fs_00_01.fsx │ ├── C03_hs_01.hs │ └── C03_rs_01.rs │ ├── C04 │ ├── C04.md │ ├── C04_cs_01.cs │ ├── C04_fs_00_01.fsx │ ├── C04_hs_01.hs │ └── C04_rs_01.rs │ ├── C05 │ ├── C05.md │ ├── C05_cs_01.cs │ ├── C05_fs_00_01.fsx │ ├── C05_hs_01.hs │ └── C05_rs_01.rs │ ├── C06 │ ├── C06.md │ ├── C06_cs_01.cs │ ├── C06_fs_00_01.fsx │ ├── C06_hs_01.hs │ └── C06_rs_01.rs │ ├── C07 │ ├── C07.md │ ├── C07_cs_01.cs │ ├── C07_fs_00_01.fsx │ ├── C07_hs_01.hs │ └── C07_rs_01.rs │ ├── C08 │ ├── C08.md │ ├── C08_cs_01.cs │ ├── C08_fs_00_01.fsx │ ├── C08_fs_00_02.fsx │ ├── C08_hs_01.hs │ ├── C08_py_00_01.py │ ├── C08_py_01.py │ ├── C08_rs_01.rs │ └── C08_rs_02.rs │ ├── C09 │ ├── C09.md │ ├── C09_cs_01.cs │ ├── C09_fs_00_01.fsx │ ├── C09_hs_01.hs │ └── C09_rs_01.rs │ ├── C10 │ ├── C10.md │ ├── C10_cs_01.cs │ ├── C10_fs_00_01.fsx │ ├── C10_hs_01.hs │ └── C10_rs_01.rs │ ├── C11 │ ├── C11.md │ ├── C11_cs_01.cs │ ├── C11_fs_00_01.fsx │ ├── C11_hs_01.hs │ ├── C11_py_00_01.py │ ├── C11_py_01.py │ └── C11_rs_01.rs │ ├── C12 │ ├── C12.md │ ├── C12_cs_01.cs │ ├── C12_fs_00_01.fsx │ ├── C12_hs_01.hs │ ├── C12_py_00_01.py │ ├── C12_py_01.py │ └── C12_rs_01.rs │ ├── C13 │ ├── C13.md │ ├── C13_cs_01.cs │ ├── C13_fs_00_01.fsx │ ├── C13_hs_01.hs │ ├── C13_py_01.py │ └── C13_rs_01.rs │ ├── C14 │ ├── C14.md │ ├── C14_cs_01.cs │ ├── C14_hs_01.hs │ ├── C14_py_01.py │ └── C14_rs_01.rs │ ├── C15 │ ├── C15.md │ ├── C15_cs_01.cs │ ├── C15_fs_00_01.fsx │ ├── C15_py_00_01.py │ ├── C15_py_01.py │ └── C15_rs_01.rs │ ├── C16 │ ├── C16.md │ ├── C16_cs_01.cs │ ├── C16_fs_00_01.fsx │ ├── C16_py_01.py │ ├── C16_py_02.py │ └── C16_rs_01.rs │ └── readme.md ├── Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition ├── hsorig │ ├── AVLTree.hs │ ├── Backtracking.hs │ ├── BinTree.hs │ ├── BinomialHeap.hs │ ├── DivideAndConquer.hs │ ├── Dynamic.hs │ ├── FunctionalHeap.hs │ ├── Graph.hs │ ├── GraphAdjacencyList.hs │ ├── Heap.hs │ ├── Other.hs │ ├── PQueue.hs │ ├── PQueueList.hs │ ├── Queue.hs │ ├── QueueList.hs │ ├── S2_6_5.hs │ ├── S4_2.hs │ ├── S4_3.hs │ ├── S5_2.hs │ ├── S5_3.hs │ ├── S5_4.hs │ ├── S5_5.hs │ ├── S5_6.hs │ ├── S5_7.hs │ ├── S5_8.hs │ ├── S5_9.hs │ ├── S6_3_1.hs │ ├── S6_3_2.hs │ ├── S6_3_3.hs │ ├── S6_3_4.hs │ ├── S6_4.hs │ ├── S6_6.hs │ ├── S7_2.hs │ ├── S7_3.hs │ ├── S7_4.hs │ ├── S7_5.hs │ ├── S7_6.hs │ ├── S8_1.hs │ ├── S8_2.hs │ ├── S8_3.hs │ ├── S8_4.hs │ ├── S9_2.hs │ ├── S9_3.hs │ ├── S9_4.hs │ ├── S9_5.hs │ ├── S9_6.hs │ ├── Search.hs │ ├── Set.hs │ ├── SetBitVector.hs │ ├── SetUnOrderedListWithDuplicates.hs │ ├── SetUnOrderedListWithoutDuplicates.hs │ ├── Sort.hs │ ├── Stack.hs │ ├── StackByList.hs │ ├── StackDerivingShow.hs │ ├── Table.hs │ ├── TableArray.hs │ ├── TableFunction.hs │ ├── UnionFind.hs │ └── readme.md └── readme.md ├── Book-AlgorithmsAndDataStructuresForProgrammingContests ├── P074ALDS1_2_D-ShellSort │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P082ALDS1_3_A-Stack │ ├── code00.cpp │ ├── code00.sh │ ├── code01.cpp │ ├── code01.sh │ └── sample1.txt ├── P087ALDS1_3_B-Queue │ ├── code00.cpp │ ├── code00.sh │ ├── code01.cpp │ ├── code01.sh │ └── sample1.txt ├── P095ALDS1_3_C-DoublyLinkedList │ ├── code00.cpp │ ├── code00.sh │ ├── code01.cpp │ ├── code01.sh │ └── sample1.txt ├── P103StlSamples │ ├── list.cpp │ ├── queue.cpp │ ├── run.sh │ ├── stack.cpp │ └── vector.cpp ├── P114ALDS1_3_D │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P119ALDS1_4_A-LinearSearch │ ├── code00.cpp │ ├── code00.sh │ ├── code01.cpp │ ├── code01.sh │ └── sample1.txt ├── P122ALDS1_4_B-BinarySearch │ ├── code00.cpp │ ├── code00.sh │ ├── code01.cpp │ ├── code01.sh │ └── sample1.txt ├── P127ALDS1_4_C-Dictionary │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P132SortByStdLib │ ├── lower_bound.cpp │ ├── lower_bound.sh │ ├── vectorIterator.cpp │ ├── vectorIterator.sh │ └── vectorIterator.txt ├── P136ALDS1_4_D-Allocation │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P141Samples │ ├── code00.cpp │ └── code00.sh ├── P142ALDS1_5_A-ExhaustiveSearch │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P146ALDS1_5_C-KochCurve │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P151ALDS1_5_B-MergeSort │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P158ALDS1_6_B-Partition │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P163ALDS1_6_3-QuickSort │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P249ALDS1_10_A-FibonacciNumber │ ├── code00.cpp │ ├── code00.sh │ ├── code01.cpp │ ├── code01.sh │ └── sample1.txt ├── P253ALDS1_10_C-LongestCommonSubsequence │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P257ALDS1_10_B-MatrixChainMultiplication │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P269ALDS1_11_A-Graph │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P273ALDS1_11_B-DepthFirstSearch │ ├── code00.cpp │ ├── code00.sh │ ├── code01.cpp │ ├── code01.sh │ └── sample1.txt ├── P282ALDS1_11_C-BreadthFIrstSearch │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P287ALDS1_11_D-ConnectedComponents │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P296ALDS1_12_A-MinimumSpanningTree │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P302ALDS1_12_B-SingleSourceShortestPath1 │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P309ALDS1_12_C-SingleSourceShortestPath2 │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── P324DSL_2_C-RangeSearch-kDTree │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── cpp │ ├── 040.txt │ ├── 040_00.cpp │ ├── 046_00.cpp │ ├── 046_00.txt │ ├── 046_01.cpp │ ├── 046_01.txt │ ├── 055.cpp │ ├── 055.txt │ ├── 060.cpp │ ├── 060.txt │ ├── 065.cpp │ ├── 065.txt │ ├── 070.cpp │ ├── 070.txt │ ├── 074.cpp │ ├── 074.txt │ ├── Dockerfile │ ├── Makefile │ ├── docker-compose.yml │ └── readme.md ├── fsharp │ ├── 040.fsx │ ├── 046.fsx │ └── 055.fsx ├── haskell │ ├── .gitignore │ ├── Dockerfile │ ├── Setup.hs │ ├── app │ │ ├── 040.hs │ │ └── Main.hs │ ├── docker-compose.yml │ ├── package.yaml │ ├── readme.md │ ├── src │ │ └── Lib.hs │ ├── stack.yaml │ └── test │ │ └── Spec.hs ├── julia │ ├── 040.jl │ ├── 046.jl │ ├── 055.jl │ ├── 060.jl │ ├── 065.jl │ ├── 070.jl │ └── 074.jl ├── readme.md └── template │ ├── code00.cpp │ ├── code00.sh │ └── sample1.txt ├── Book-Bird.Gibbons-Algorithm_Design_with_Haskell ├── Chap01.fsx ├── Chap01.hs ├── Chap02.fsx ├── Chap02.hs ├── Chap03.fsx ├── Chap03.hs ├── Chap04.fsx ├── Chap04.hs ├── Chap05.fsx ├── Chap06.fsx ├── Chap07.fsx ├── Chap07.hs ├── Chap08.fsx ├── Ex09.hs ├── Ex10.hs ├── Ex11.hs ├── Ex12.hs ├── Ex13.hs ├── Ex14.hs ├── Lib.fsx ├── Lib.hs ├── README.md ├── Sec0301.hs ├── Sec0302.hs ├── Sec0401.hs ├── Sec0402.hs ├── Sec040301.hs ├── Sec040302.hs ├── Sec0404.hs ├── Sec0801.hs ├── Sec0802.hs ├── Sec0803.hs ├── Sec0901.hs ├── Sec0902.hs ├── Sec0903.hs ├── Sec0903RAList.hs ├── Sec090401.hs ├── Sec090402.hs ├── Sec0905.hs ├── Sec0906.hs ├── Sec0907.hs ├── Sec1001.hs ├── Sec1002.hs ├── Sec1003.hs ├── Sec1004.hs ├── Sec1005.hs ├── Sec1101.hs ├── Sec1102.hs ├── Sec1103.hs ├── Sec1201.hs ├── Sec1202.hs ├── Sec1203.hs ├── Sec1301.hs ├── Sec1302.hs ├── Sec1303.hs ├── Sec1304.hs ├── Sec1305.hs ├── Sec140101.hs ├── Sec140102.hs ├── Sec140103.hs ├── Sec1402.hs ├── Sec1403.hs ├── Sec1405.hs ├── Sec1406.hs ├── Sec150101.hs ├── Sec150102.hs ├── Sec1502.hs ├── Sec1503.hs ├── Sec1504.hs ├── Sec1505.hs ├── Sec1601.hs ├── Sec1602.hs └── Sec1603.hs ├── Book-IntroductionToComputation-HaskellLogicAndAutomata ├── hsorig │ ├── AbstractSetAsAVLTree.hs │ ├── AbstractSetAsAVLTree_MyModule.hs │ ├── AbstractSetAsList.hs │ ├── AbstractSetAsList_MyModule │ ├── AbstractSetAsList_MyModule.hs │ ├── AbstractSetAsOrderedTree.hs │ ├── AbstractSetAsOrderedTree_MyModule.hs │ ├── Chap03_simple_computations.hs │ ├── Chap04_venn_diagrams_and_logical_connectives.hs │ ├── Chap05_lists_and_comprehensions.hs │ ├── Chap06_features_and_predicates.hs │ ├── Chap07_testing_your_programs.hs │ ├── Chap10_lists_and_recursion.hs │ ├── Chap11_more_fun_with_recursion.hs │ ├── Chap12_higher_order_functions.hs │ ├── Chap13_higher_and_higher.hs │ ├── Chap14_sequent_calculus.hs │ ├── Chap15_algebraic_data_types.hs │ ├── Chap16_expression_trees.hs │ ├── Chap18_relations_and_quantifiers.hs │ ├── Chap19_checking_satisfiability.hs │ ├── Chap20_data_representation.hs │ ├── Chap20_data_representation_polymorphic_sets_as_balanced_trees.hs │ ├── Chap20_data_representation_polymorphic_sets_as_lists.hs │ ├── Chap20_data_representation_sets_as_balanced_trees.hs │ ├── Chap20_data_representation_sets_as_lists.hs │ ├── Chap20_data_representation_sets_as_ordered_lists_without_duplicates.hs │ ├── Chap20_data_representation_sets_as_ordered_trees.hs │ ├── Chap21_data_abstraction.hs │ ├── Chap22_efficient_CNF_conversion.hs │ ├── Chap24_type_classes.hs │ ├── Chap25_search_in_trees.hs │ ├── Chap26_combinatorial_algorithms.hs │ ├── Chap29_nondeterministic_finite_automata.hs │ ├── Chap30_input_output_and_monads.hs │ ├── Main.hs │ ├── SetAsAVLTree.hs │ ├── SetAsAVLTree_MyModule.hs │ ├── SetAsList.hs │ ├── SetAsList_MyModule.hs │ ├── SetAsOrderedList.hs │ ├── SetAsOrderedList_MyModule.hs │ ├── SetAsOrderedTree.hs │ ├── SetAsOrderedTree_MyModule.hs │ └── readme.md └── readme.md ├── Book-Okasaki-Purely_Functional_Data_Structures ├── README.md └── hs │ ├── AltBinaryRandomAccessList.hs │ ├── BankersDeque.hs │ ├── BankersQueue.hs │ ├── BatchedQueue.hs │ ├── BinaryRandomAccessList.hs │ ├── BinomialHeap.hs │ ├── BootstrapHeap.hs │ ├── BootstrappedQueue.hs │ ├── BottomUpMergeSort.hs │ ├── CatList.hs │ ├── CatenableDeque.hs │ ├── CatenableList.hs │ ├── Deque.hs │ ├── FiniteMap.hs │ ├── Heap.hs │ ├── HoodMelvilleQueue.hs │ ├── ImplicitCatenableDeque.hs │ ├── ImplicitQueue.hs │ ├── LazyPairingHeap.hs │ ├── LeftistHeap.hs │ ├── PairingHeap.hs │ ├── PhysicistsQueue.hs │ ├── Queue.hs │ ├── RandomAccessList.hs │ ├── RedBlackSet.hs │ ├── Set.hs │ ├── SimpleCatenableDeque.hs │ ├── SkewBinomialHeap.hs │ ├── Sortable.hs │ ├── SplayHeap.hs │ ├── Trie.hs │ ├── TrieOfTrees.hs │ └── UnbalancedSet.hs ├── Book-Yoneda-Math_Algorithm └── readme.md ├── Cargo.lock ├── Cargo.toml ├── DataStructures ├── AvlTree.fsx ├── BinaryTree.fsx ├── DoublyLinkedList.fsx ├── Graph.fsx ├── Heap.fsx ├── Okasaki │ ├── AlternativeBinaryRandomAccessList.fsx │ ├── BankersDoubleEndedQueue.fsx │ ├── BankersQueue.fsx │ ├── BatchedQueue.fsx │ ├── BinaryRandomAccessList.fsx │ ├── BinarySearchTree.fsx │ ├── BinomialHeap.fsx │ ├── BootstrappedQueue.fsx │ ├── BottomUpMergeSort.fsx │ ├── BottomUpMergeSortBySeq.fsx │ ├── CustomStack.fsx │ ├── DoubleEndedQueue.fsx │ ├── FiniteMap.fsx │ ├── HoodMelvilleQueue.fsx │ ├── ImplicitQueue.fsx │ ├── LazyBinomialHeap.fsx │ ├── LazyBinomialHeapBySeq.fsx │ ├── LazyPairingHeap.fsx │ ├── LeftistHeap.fsx │ ├── PairingHeap.fsx │ ├── PhysicistQueue.fsx │ ├── RealTimeDoubleEndedQueue.fsx │ ├── RealTimeQueue.fsx │ ├── RedBlackSet.fsx │ ├── ScheduledBinomialHeap.fsx │ ├── SkewBinaryRandomAccessList.fsx │ ├── SkewBinomialHeap.fsx │ └── SplayHeap.fsx ├── PriorityQueue01.fsx ├── PriorityQueue02.fsx ├── Queue.fsx ├── RabhiLapalme │ ├── AVLTree.fsx │ ├── Backtracking.fsx │ ├── BinTree.fsx │ ├── BinomialHeap.fsx │ ├── BinomialHeapForInt.fsx │ ├── DivideAndConquer.fsx │ ├── FunctionalHeap.fsx │ ├── Heap.fsx │ ├── PriorityQueueByHeap.fsx │ ├── PriorityQueueByList.fsx │ ├── Queue.fsx │ ├── QueueConv.fsx │ ├── SetByListWithDuplicates.fsx │ ├── SetByOrderedListWithoutDuplicates.fsx │ ├── SetByUnorderedListWithoutDuplicates.fsx │ ├── SetForIntByBitVectorRepresentation.fsx │ ├── SetTreeRepresentations.fsx │ ├── Stack.fsx │ ├── StackByList.fsx │ ├── Table.fsx │ ├── TableByArray.fsx │ ├── TableByFunction.fsx │ ├── TableByList.fsx │ └── readme.md ├── RedBlackTrees.fsx ├── SegmentTree.fsx ├── SegmentTreeOop.fsx ├── Stack.fsx ├── UnionFind.fsx └── hs │ └── DoublyLinkedList.hs ├── Library ├── Arithmetics.fsx ├── AtCoder.fsx ├── C++ │ ├── enumerate_divisors.cpp │ └── is_prime.cpp ├── CpsTr.fsx ├── FParseC │ ├── JsonSample01.fsx │ ├── JsonSample02.fsx │ ├── JsonSample03.fsx │ ├── JsonSample04.fsx │ ├── JsonSample05.fsx │ ├── JsonSample06.fsx │ ├── JsonSample07.fsx │ ├── JsonSample08.fsx │ ├── JsonSample09.fsx │ ├── JsonSample10.fsx │ ├── JsonSample11.fsx │ ├── JsonSample12.fsx │ └── PartsSamples.fsx ├── File.fsx ├── Graph.fsx ├── Haskell │ └── Math.hs ├── Math.fsx ├── References.fsx ├── Regex.fsx ├── Search │ ├── Binary.fsx │ ├── Linear.fsx │ └── LowerBound.fsx ├── UnitsOfMeasure.fsx └── sort │ ├── Counting.fsx │ ├── bubble.fsx │ ├── hs │ ├── Bubble.hs │ ├── Counting.hs │ ├── Insertion.hs │ ├── Merge.hs │ ├── Quick.hs │ ├── Selection.hs │ └── Shell.hs │ ├── insertion.fsx │ ├── merge.fsx │ ├── quick.fsx │ └── selection.fsx ├── MyLectureJP ├── .gitignore ├── 000_fsharp_fundamentals.fsx ├── 001_introduction.fsx ├── fundamental_for_computer_science.fsx └── readme.md ├── phasetr.rs └── readme.md /.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | [*] 3 | end_of_line = lf 4 | insert_final_newline = true 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | indent_style = space 9 | 10 | [*.cs] 11 | indent_size = 4 12 | 13 | [*.py] 14 | indent_size = 4 15 | 16 | [*.rs] 17 | indent_size = 4 18 | 19 | [Makefile] 20 | indent_style = tab 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.tmp.txt 2 | .ionide 3 | packages 4 | paket-files/ 5 | paket.lock 6 | target 7 | -------------------------------------------------------------------------------- /AOJ/ALDS1/01B_c_01.c: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_1_B/review/650410/ei1333/C 2 | #include 3 | int main(){ 4 | int x; 5 | scanf("%d",&x); 6 | printf("%d\n",x*x*x); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /AOJ/ALDS1/01B_cp_01.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_1_B/review/1983388/naoto172/C++ 2 | #include 3 | int main(){ 4 | int x; 5 | scanf("%d",&x); 6 | printf("%d\n",x*x*x); 7 | } 8 | -------------------------------------------------------------------------------- /AOJ/ALDS1/01B_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve x = pown x 3 5 | 6 | let x = stdin.ReadLine() |> int 7 | solve x |> stdout.WriteLine 8 | 9 | solve 2 |> should equal 8 10 | solve 3 |> should equal 27 11 | -------------------------------------------------------------------------------- /AOJ/ALDS1/01B_js_01.js: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_1_B/review/1216417/miraikako/JavaScript 2 | const x = require('fs').readFileSync('/dev/stdin', 'utf8'); 3 | console.log(Math.pow(x,3)); 4 | 5 | -------------------------------------------------------------------------------- /AOJ/ALDS1/01B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_1_B/review/2033894/roiti/OCaml *) 2 | let () = let x = read_int () in Printf.printf "%d\n" (x*x*x) 3 | -------------------------------------------------------------------------------- /AOJ/ALDS1/01B_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_1_B/review/1829123/superluminalsloth/OCaml *) 2 | Scanf.scanf "%d\n" (fun x-> Printf.printf "%d\n" (x*x*x));; 3 | -------------------------------------------------------------------------------- /AOJ/ALDS1/01B_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_1_B/review/2756251/MitI7/Rust 2 | use std::io; 3 | 4 | fn main() { 5 | let mut x = String::new(); 6 | io::stdin().read_line(&mut x).unwrap(); 7 | let x: i32 = x.trim().parse().unwrap(); 8 | println!("{}", x * x * x); 9 | } 10 | -------------------------------------------------------------------------------- /AOJ/ALDS1/03C_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | """TODO""" 5 | -------------------------------------------------------------------------------- /AOJ/ALDS1/04D_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_4_D/review/1126210/giguru/Python 2 | n,k=map(int,raw_input().split()) 3 | w=[input() for _ in range(n)] 4 | l=max(w) 5 | r=sum(w) 6 | while lm:s=i;c+=1 12 | if c> q) & 1)or"no") 13 | -------------------------------------------------------------------------------- /AOJ/ALDS1/05C_py_03.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_5_C/review/2710765/kyuna/Python3 2 | d=[0j,100+0j] 3 | for _ in[0]*int(input()): 4 | p=[d[0]] 5 | for i in range(len(d)-1): 6 | a,b=d[i],d[i+1] 7 | r=(b-a)/3 8 | p+=[a+r,a+r+r*(1+3**.5*1j)/2,b-r,b] 9 | d=p 10 | for e in d:print(e.real,e.imag) 11 | -------------------------------------------------------------------------------- /AOJ/ALDS1/06A_ml_03.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_6_A/review/5517382/que0/OCaml *) 2 | -------------------------------------------------------------------------------- /AOJ/ALDS1/09C_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_9_C/review/2046783/leafmoon/Python3 2 | from heapq import * 3 | import sys 4 | q=[] 5 | while True: 6 | a=sys.stdin.readline().split() 7 | if a[0]=='end': break 8 | if a[0]=='insert': 9 | heappush(q,-int(a[1])) 10 | else: 11 | print(-heappop(q)) 12 | -------------------------------------------------------------------------------- /AOJ/ALDS1/09D_hs_00.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_9_D 2 | -------------------------------------------------------------------------------- /AOJ/ALDS1/10A_c_01.c: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_10_A/review/3752058/kyopro_friends/C 2 | #include 3 | 4 | int main(){ 5 | int n; 6 | scanf("%d",&n); 7 | int a=1,b=1,c; 8 | while(n--)c=a+b,a=b,b=c; 9 | printf("%d\n",a); 10 | } 11 | -------------------------------------------------------------------------------- /AOJ/ALDS1/10A_cp_01.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_10_A/review/800796/ei1333/C++ 2 | #include 3 | using namespace std; 4 | int main(){ 5 | int n,dp[45]={1,1}; 6 | cin >> n; 7 | for(int i = 2 ; i <= n ; i++ ) dp[i] = dp[i-1] + dp[i-2]; 8 | cout << dp[n] << endl; 9 | } 10 | -------------------------------------------------------------------------------- /AOJ/ALDS1/10A_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve N = 5 | let rec fib a b = function 6 | | 0 -> a 7 | | n -> fib (a+b) a (n-1) 8 | fib 1 0 N 9 | 10 | let N = stdin.ReadLine() |> int 11 | solve Xa |> stdout.WriteLine 12 | 13 | solve 3 |> should equal 3 14 | Array.map solve [|0..13|] |> should equal [|1;1;2;3;5;8;13;21;34;55;89;144;233;377|] 15 | -------------------------------------------------------------------------------- /AOJ/ALDS1/10A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_10_A/review/1442784/lrmystp/Haskell 2 | main :: IO () 3 | main = readLn >>= \n -> print $ fibs !! n 4 | 5 | fibs :: [Integer] 6 | fibs = 1 : 1 : zipWith (+) fibs (tail fibs) 7 | -------------------------------------------------------------------------------- /AOJ/ALDS1/10A_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_10_A/review/1870547/superluminalsloth/OCaml *) 2 | let fib n = 3 | let rec fib a b = function 4 | | 0 -> a 5 | | n -> fib (a+b) a (n-1) 6 | in fib 1 0 n;; 7 | 8 | let () = 9 | let n = read_int () 10 | in fib n |> print_int;print_newline ();; 11 | -------------------------------------------------------------------------------- /AOJ/ALDS1/10A_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_10_A/review/3184892/jakenu0x5e/Python3 2 | N = int(input()) 3 | a = b = 1 4 | while N: 5 | a, b = b, a+b 6 | N -= 1 7 | print(a) 8 | -------------------------------------------------------------------------------- /AOJ/ALDS1/10A_py_02.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_10_A/review/5906539/lloyz_nt/Python3 2 | n = int(input()) 3 | 4 | fib = [0 for _ in range(n + 1)] 5 | fib[0] = fib[1] = 1 6 | for i in range(2, n + 1): 7 | fib[i] = fib[i - 1] + fib[i - 2] 8 | print(fib[n]) 9 | -------------------------------------------------------------------------------- /AOJ/ALDS1/10A_py_03.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_10_A/review/2723866/kyuna/Python3 2 | a=b=1 3 | for _ in range(int(input())):a,b=b,a+b 4 | print(a) 5 | -------------------------------------------------------------------------------- /AOJ/ALDS1/11A_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_11_A/review/1687135/amusan39/Haskell 2 | import Control.Monad ( replicateM_ ) 3 | 4 | main = do 5 | n <- readLn 6 | replicateM_ n $ do 7 | lines <- fmap (map read . drop 2 . words) getLine 8 | putStrLn $ unwords $ map (\a -> if a `elem` lines then "1" else "0") [1..n] 9 | -------------------------------------------------------------------------------- /AOJ/ALDS1/11A_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_11_A/review/3184890/jakenu0x5e/Python3 2 | N = int(input()) 3 | for i in range(N): 4 | u, k, *vs = map(int, input().split()) 5 | E = [0]*N 6 | for v in vs: 7 | E[v-1] = 1 8 | print(*E) 9 | -------------------------------------------------------------------------------- /AOJ/ALDS1/14A_cp_01.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ALDS1_14_A/review/1776938/dohatsu/C++ 2 | #include 3 | using namespace std; 4 | string n,m; 5 | int main(){ 6 | cin>>n>>m; 7 | int i=n.find(m); 8 | while(i!=-1){ 9 | cout< int 7 | solve n |> stdout.WriteLine 8 | 9 | solve 2 |> should equal 8 10 | solve 3 |> should equal 27 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/01B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_B&lang=ja 2 | main :: IO () 3 | main = readLn >>= print . solve1 4 | solve1 x = x^3 5 | 6 | test = solve1 2 == 8 7 | && solve1 3 == 27 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/01B_hs_02.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = readLn >>= print . (^3) 3 | -------------------------------------------------------------------------------- /AOJ/ITP1/01B_ml_00.ml: -------------------------------------------------------------------------------- 1 | let x = read_int ();; 2 | Printf.printf "%d\n" (x*x*x) 3 | -------------------------------------------------------------------------------- /AOJ/ITP1/01B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_1_B/review/2289780/suibaka/OCaml *) 2 | let _ = 3 | let x = read_line () in 4 | let x = int_of_string x in 5 | let x = x * x * x in 6 | print_endline (string_of_int x) 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/01C_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve a b = [|a*b; 2*(a+b)|] 5 | let a,b = stdin.ReadLine().Split() |> Array.map int |> (fun x -> x.[0], x.[1]) 6 | solve a b |> Array.map stdin |> String.concat " " |> stdout.WriteLine 7 | 8 | solve 3 5 |> should equal [|15;16|] 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/01C_ml_00.ml: -------------------------------------------------------------------------------- 1 | let a,b = Scanf.scanf "%d %d" (fun a b -> a,b) 2 | let () = Printf.printf "%d %d\n" (a*b) (2*(a+b)) 3 | -------------------------------------------------------------------------------- /AOJ/ITP1/01C_ml_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_C&lang=ja 2 | main :: IO () 3 | main = do 4 | line <- getLine 5 | let a:b:_ = map read $ words line :: [Int] 6 | print $ show (a*b) ++ " " ++ show (2*(a+b)) 7 | -- printf "%d %d\n" (a * b) (2 * (a + b)) 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/01C_ml_02.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_C&lang=ja 2 | main :: IO () 3 | main = getLine >>= putStrLn . solve . map read . words 4 | 5 | solve :: (Show a, Num a) => [a] -> [Char] 6 | solve [a,b] = show (a*b) ++ " " ++ show (2*(a+b)) 7 | solve _ = error "not come here" 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/01C_ml_03.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = getLine >>= 3 | print . unwords . map show . (\[a,b] -> [a*b, 2*(a+b)]) 4 | . map read . words 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/01C_ml_04.hs: -------------------------------------------------------------------------------- 1 | import Control.Applicative 2 | main :: IO () 3 | main = do 4 | [a, b] <- map read . words <$> getLine 5 | putStrLn . unwords . map show $ [a*b, 2*(a+b)] 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/01D_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve x = [|x/(60*60);(x % (60*60))/60; x % 60|] 5 | 6 | let S = stdin.ReadLine() |> int 7 | solve S |> String.concat ":" |> stdout.WriteLine 8 | 9 | solve 46979 |> should equal [|13;2;59|] 10 | solve 46979 |> Array.map string |> String.concat ":" |> should equal "13:2:59" 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/01D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_D&lang=ja 2 | main :: IO () 3 | main = do 4 | s1 <- readLn :: IO Int 5 | let s = s1 `mod` 60 6 | let m = s1 `div` 60 `mod` 60 7 | let h = s1 `div` 3600 8 | putStrLn $ show h ++ ":" ++ show m ++ ":" ++ show s 9 | -- printf "%d:%d:%d\n" h m s 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/01D_hs_02.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = do 3 | s <- readLn :: IO Int 4 | putStrLn $ foldl1 (\x y -> x ++ ":" ++ y) $ map show [s `div` 3600, s `div` 60 `mod` 60, s `mod` 60] 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/01D_hs_03.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = readLn >>= 3 | putStrLn . 4 | foldl1 (\x y -> x ++ ":" ++ y) . 5 | map show . 6 | (\s -> [s `div` 3600, s `div` 60 `mod` 60, s `mod` 60]) 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/01D_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve x = 2 | let h = x / (60*60) in 3 | let m = (x mod (60*60)) / 60 in 4 | let s = x mod 60 in 5 | Printf.sprintf "%d:%d:%d" h m s;; 6 | let _ = 7 | let x = Scanf.scanf "%d" (fun x -> x) in 8 | print_endline @@ solve x;; 9 | 10 | Printf.printf "%B" (solve 46979 = "13:2:59");; 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/01D_ml_01.ml: -------------------------------------------------------------------------------- 1 | let () = 2 | let hms = 3 | let t = read_int () in 4 | List.map string_of_int [t / 3600; t / 60 mod 60; t mod 60] in 5 | print_endline (String.concat ":" hms) 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/02A_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve a b = if ab then "a > b" else "a == b" 5 | let a,b = stdin.ReadLine().Split() |> Array.map int |> (fun x -> x.[0], x.[1]) 6 | solve a b |> stdout.WriteLine 7 | 8 | solve 1 2 |> should equal "a < b" 9 | solve 4 3 |> should equal "a > b" 10 | solve 5 5 |> should equal "a == b" 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/02A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_A&lang=ja 2 | main :: IO () 3 | main = do 4 | [a, b] <- map (read :: String -> Int) . words <$> getLine 5 | let s | a < b = "a < b" 6 | | a > b = "a > b" 7 | | a == b = "a == b" 8 | putStrLn s 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/02A_hs_02.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = do 3 | [a, b] <- map (read :: String -> Int) . words <$> getLine 4 | putStrLn $ if a < b then "a < b" else if a > b then "a > b" else "a == b" 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/02A_hs_03.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = getLine >>= putStrLn . solve . map read . words 3 | solve :: [Int] -> String 4 | solve [a, b] 5 | | a > b = "a > b" 6 | | a < b = "a < b" 7 | | a == b = "a == b" 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/02A_hs_04.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = getLine >>= putStrLn . solve . map read . words 3 | 4 | solve :: [Int] -> String 5 | solve [a, b] = 6 | case a `compare` b of 7 | LT -> "a < b" 8 | EQ -> "a == b" 9 | GT -> "a > b" 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/02A_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve a b = if a b";; 2 | let a,b = Scanf.scanf "%d %d" (fun a b -> a,b);; 3 | let () = Printf.printf "%s\n" (solve a b);; 4 | 5 | solve 1 2 = "a < b";; 6 | solve 4 3 = "a > b";; 7 | solve 5 5 = "a == b";; 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/02A_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_2_A/review/1829162/superluminalsloth/OCaml *) 2 | let () = Scanf.scanf "%d %d\n" 3 | (fun x y-> Printf.printf "%s\n" 4 | (if x=y then "a == b" else if x>y then "a > b" else "a < b"));; 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/02A_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_2_A/review/1998066/r6eve/OCaml *) 2 | Scanf.scanf"%d %d"(fun a b->print_endline("a "^[|"<";"==";">"|].(compare a b+1)^" b")) 3 | -------------------------------------------------------------------------------- /AOJ/ITP1/02B_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve a b c = if a < b && b < c then "Yes" else "No" 5 | 6 | let a,b,c = stdin.ReadLine().Split() |> Array.map int |> (fun x -> x.[0],x.[1],x.[2]) 7 | solve a b c |> stdout.WriteLine 8 | 9 | solve 1 3 8 |> should equal "Yes" 10 | solve 3 8 1 |> should equal "No" 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/02B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_B&lang=ja 2 | main :: IO () 3 | main = getLine >>= 4 | putStrLn 5 | . (\[a,b,c] -> if a < b && b < c then "Yes" else "No") 6 | . map read . words 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/02B_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve a b c = if a a,b,c);; 3 | let () = Printf.printf "%s\n" (solve a b c);; 4 | 5 | solve 1 3 8 = "Yes";; 6 | solve 3 8 1 = "No";; 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/02B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_2_B/review/2781821/tetrose/OCaml *) 2 | let f a b c = if a < b && b < c then print_string "Yes\n" else print_string "No\n";; 3 | Scanf.sscanf(read_line()) "%d %d %d" f;; 4 | -------------------------------------------------------------------------------- /AOJ/ITP1/02C_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve (Xa: int[]) = Xa |> Array.sort |> Array.map string |> String.concat " " 5 | 6 | let Xa = stdin.ReadLine().Split() |> Array.map int 7 | solve Xa |> stdout.WriteLine 8 | 9 | solve [|3;8;1|] |> should equal "1 3 8" 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/02C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_C&lang=ja 2 | import Data.List ( sort ) 3 | solve :: [Int] -> String 4 | solve = unwords . map show . sort 5 | main :: IO () 6 | main = getLine >>= putStrLn . solve . map read . words 7 | 8 | test :: IO () 9 | test = print $ solve [3,8,1] == "1 3 8" 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/02C_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve a b c = 2 | let xa = [|a;b;c|] in 3 | Array.sort compare xa; 4 | Printf.sprintf "%d %d %d" xa.(0) xa.(1) xa.(2);; 5 | let a,b,c = Scanf.scanf "%d %d %d" (fun a b c -> a,b,c);; 6 | let () = Printf.printf "%s\n" (solve a b c);; 7 | 8 | solve 3 8 1 = "1 3 8";; 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/02C_ml_01.ml: -------------------------------------------------------------------------------- 1 | let solve xa = 2 | Array.sort compare xa; 3 | Printf.sprintf "%d %d %d" xa.(0) xa.(1) xa.(2);; 4 | let xa = Scanf.scanf "%d %d %d" (fun a b c -> [|a;b;c|]);; 5 | let () = solve xa |> Printf.printf "%s\n";; 6 | 7 | solve [|3;8;1|] = "1 3 8";; 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/02C_ml_04.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_2_C/review/1995674/r6eve/OCaml *) 2 | Scanf.scanf "%d %d %d" 3 | (fun a b c -> 4 | match List.sort (-) [a;b;c] with [x;y;z] -> Printf.printf "%d %d %d\n" x y z |_ -> ());; 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/02C_ml_05.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_2_C/review/2960627/napo/OCaml *) 2 | let () = 3 | let xs = Scanf.sscanf(read_line()) "%d %d %d" (fun x y z -> [|x;y;z|]) in 4 | Array.sort compare xs; 5 | Printf.printf "%d %d %d\n" xs.(0) xs.(1) xs.(2) 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/03A_fs_00.fsx: -------------------------------------------------------------------------------- 1 | for i in 1..1000 do stdout.WriteLine "Hello World" done 2 | [1..1000] |> List.iter (fun _ -> stdout.WriteLine "Hello World") 3 | -------------------------------------------------------------------------------- /AOJ/ITP1/03A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_A&lang=ja 2 | main = mapM_ putStrLn $ replicate 1000 "Hello World" 3 | -------------------------------------------------------------------------------- /AOJ/ITP1/03A_hs_02.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = putStr $ unlines $ [1..1000] >> ["Hello World"] 3 | -------------------------------------------------------------------------------- /AOJ/ITP1/03A_hs_03.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad ( replicateM_ ) 2 | main :: IO () 3 | main = replicateM_ 1000 $ putStrLn "Hello World" 4 | -------------------------------------------------------------------------------- /AOJ/ITP1/03A_ml_00.ml: -------------------------------------------------------------------------------- 1 | let () = for i=1 to 1000 do Printf.printf "Hello World\n" done;; 2 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_cpp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | g++ -std=gnu++1y -g -O0 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o 3B03.out 3B03.cpp 3 | cat << EOS 4 | RESULT 5 | Case 1: 3 6 | Case 2: 5 7 | Case 3: 11 8 | Case 4: 7 9 | Case 5: 8 10 | Case 6: 19 11 | ====== 12 | EOS 13 | ./3B03.out < 3B03.txt 14 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_cpp.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 5 3 | 11 4 | 7 5 | 8 6 | 19 7 | 0 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_cpp_01.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() { 5 | int i = 1, x; 6 | cin >> x; 7 | while (x != 0) { 8 | cout << "Case " << i << ": " << x << endl; 9 | i++; 10 | cin >> x; 11 | } 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_B&lang=ja 2 | -- http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=1708835#1 3 | main :: IO () 4 | main = getContents >>= 5 | mapM_ putStrLn 6 | . zipWith (\n m -> "Case " ++ show n ++ ": " ++ m) [1..] 7 | . init . words 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_hs_02.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = getContents >>= 3 | mapM_ (putStrLn . (\(i, l) -> "Case " ++ show i ++ ": " ++ l)) 4 | . takeWhile (\(i, l) -> l /= "0") 5 | . zip [1..] . lines 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_ml_00.ml: -------------------------------------------------------------------------------- 1 | let rec frec n = 2 | let x = read_int () in 3 | if x!=0 then ( 4 | Printf.printf "Case %d: %d\n" n x; 5 | frec (n+1) 6 | );; 7 | frec 1;; 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_3_B/review/2289854/suibaka/OCaml *) 2 | let rec solve cnt = 3 | let x = Scanf.scanf "%d " (fun x -> x) in 4 | if x != 0 then ( 5 | Printf.printf "Case %d: %d\n" cnt x; 6 | solve (cnt+1) 7 | ) 8 | let _ = solve 1;; 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_3_B/review/1833303/superluminalsloth/OCaml *) 2 | let rec read i = 3 | match Scanf.scanf "%d\n" (fun x->x) with 4 | 0 -> () 5 | | n -> Printf.printf "Case %d: %d\n" i n; read (i+1);; 6 | let () = read 1;; 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/03B_ml_03.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_3_B/review/3730262/Umyy/OCaml *) 2 | let rec case i = 3 | match read_int() with 4 | | 0 -> () 5 | | x -> Printf.printf "Case %d: %d\n" i x; 6 | case (i + 1) in case 1;; 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/03C_fs_00.fsx: -------------------------------------------------------------------------------- 1 | let rec main() = match sprintf "%d %d\n" (fun x y -> if x () 3 | | (x,y) -> stdout.WriteLine "%d %d" x y; main() 4 | main() 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/03C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_C&lang=ja 2 | import Data.List 3 | main = getContents >>= 4 | mapM_ putStrLn 5 | . map (unwords . map show . sort . map read . words) 6 | -- . map ((\xs -> if xs!!0 < xs!!1 then xs!!0 ++ " " ++ xs!!1 else xs!!1 ++ " " ++ xs!!0) . words) 7 | . init . lines 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/03C_hs_02.hs: -------------------------------------------------------------------------------- 1 | import Data.List 2 | main :: IO () 3 | main = interact $ unlines 4 | . map (unwords . map show . sort . map read . words) 5 | . init . lines 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/03C_ml_00.ml: -------------------------------------------------------------------------------- 1 | let rec main ()= match Scanf.scanf "%d %d\n" (fun x y -> if x () 3 | | (x,y) -> Printf.printf "%d %d\n" x y; main ();; 4 | let () = main ();; 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/03C_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_3_C/review/2781928/tetrose/OCaml *) 2 | let rec f ()= 3 | let (x,y) = Scanf.sscanf(read_line()) "%d %d" (fun x y -> if x < y then (x,y) else (y,x)) 4 | in 5 | if x <> 0 || y <> 0 then (Printf.printf "%d %d\n" x y;f()) else ();; 6 | f ();; 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/03C_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_3_C/review/1829547/superluminalsloth/OCaml *) 2 | let rec read ()= 3 | let t = Scanf.scanf "%d %d\n" (fun x y-> if x () 6 | | (x,y) -> Printf.printf "%d %d\n" x y;read ();; 7 | let () = read ();; 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/03D_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve a b c = [|a..b|] |> Array.filter (fun x -> 80 % x = 0) |> Array.length 5 | 6 | let a,b,c = stdin.ReadLine().Split() |> Array.map int |> (fun x -> x.[0],x.[1],x.[2]) 7 | solve a b c |> stdout.WriteLine 8 | 9 | solve 5 14 80 |> should equal 3 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/03D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_D&lang=ja 2 | -- http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=1709762#1 3 | main :: IO () 4 | main = getLine >>= 5 | putStrLn . show 6 | . (\[a, b, c] -> length [x | x <- [a..b], c `mod` x == 0]) 7 | . map (read :: String -> Int) . words 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/03D_hs_02.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = getLine >>= 3 | putStrLn 4 | . (\[a, b, c] -> show . length $ filter ((==) 0 . mod c) [a..b]) 5 | . map read . words 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/03D_ml_00.ml: -------------------------------------------------------------------------------- 1 | let rec solve a b c n acc = 2 | if b a,b,c) in 7 | Printf.printf "%d\n" @@ solve a b c a 0;; 8 | 9 | solve 5 14 80 5 0 == 3 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/03D_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_3_D/review/2289876/suibaka/OCaml *) 2 | let rec range x y = if x > y then [] else (x :: range (x+1) y) 3 | let solve a b c = 4 | let ok n = c mod n == 0 in 5 | range a b |> List.filter ok |> List.length |> Printf.printf "%d\n" 6 | let _ = Scanf.scanf "%d %d %d" solve 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/04A_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve a b = (a/b, a mod b, ((float_of_int a) /. (float_of_int b)));; 2 | let a,b = Scanf.scanf "%d %d" (fun a b -> a,b);; 3 | let () = (solve a b) |> fun (a,b,c) -> Printf.printf "%d %d %f\n" a b c;; 4 | 5 | solve 3 2 = (1,1,1.5) 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/04B_hl_01.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_4_B 3 | -} 4 | import Text.Printf (printf) 5 | main :: IO () 6 | main = (readLn :: IO Double) >>= (\r -> printf "%.6f %.6f\n" (pi*(r^2)) (2*pi*r)) 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/04B_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve r = 2 | let pi = 4.0 *. atan 1.0 in 3 | Printf.sprintf "%f %f\n" (pi *. r *. r) (2.0 *. pi *. r);; 4 | let () = read_float() |> solve |> print_endline;; 5 | 6 | solve 2.0;; (* "12.566371 12.566371\n" *) 7 | solve 3.0;; (* "28.274334 18.849556\n" *) 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/04B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_4_B/review/2289890/suibaka/OCaml *) 2 | let _ = 3 | let r = Scanf.scanf "%f" (fun r -> r) in 4 | let pi = acos (-1.0) in 5 | Printf.printf "%f %f\n" (r *. r *. pi) (2.0 *. r *. pi) 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/04B_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_4_B/review/1833696/superluminalsloth/OCaml *) 2 | let pi = 4.0 *. atan 1.0;; 3 | let r = read_float () in 4 | Printf.printf "%f %f\n" (r*.r*.pi) (2.0*.r*.pi);; 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/04C_ml_00.ml: -------------------------------------------------------------------------------- 1 | let calc x op y = match op with 2 | | "+" -> x+y 3 | | "-" -> x-y 4 | | "*" -> x*y 5 | | _ -> x/y 6 | ;; 7 | let rec main () = 8 | let x,op,y = Scanf.sscanf(read_line()) "%d %s %d" (fun a b c -> a,b,c) in 9 | if op = "?" then () else begin 10 | Printf.printf "%d\n" @@ calc x op y; 11 | main() 12 | end;; 13 | main();; 14 | -------------------------------------------------------------------------------- /AOJ/ITP1/04D_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve (aa:int[]) = (Array.min aa, Array.max aa, Array.sum aa) 5 | 6 | let n = stdin.ReadLine() |> int 7 | let aa = stdin.ReadLine().Split() |> Array.map int 8 | solve aa |> (fun (a,b,c) -> "%d %d %d" a b c |> printfn) 9 | 10 | solve [|10;1;5;4;17|] |> should equal (1,17,37) 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/04D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_4_D 2 | import Text.Printf 3 | main :: IO () 4 | main = getLine >> getLine >>= 5 | (\xs -> printf "%d %d %d\n" (minimum xs) (maximum xs) (sum xs)) 6 | . map (read :: String -> Int) . words 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/04D_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve xs = 2 | List.fold_left (fun (accx, accy, accz) x -> (min accx x, max accy x, accz+x)) 3 | (max_int, min_int, 0) xs;; 4 | let () = 5 | let _ = read_int () in 6 | read_line () |> Str.split (Str.regexp " ") |> List.map int_of_string |> solve 7 | |> fun (a,b,c) -> Printf.printf "%d %d %d\n" a b c;; 8 | 9 | solve [10;1;5;4;17] = (1,17,37);; 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/05A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_5_A 2 | import Control.Monad ( replicateM_ ) 3 | main :: IO () 4 | main = do 5 | [h,w] <- fmap (map read . words) getLine 6 | if (h,w)==(0,0) then return () else do 7 | replicateM_ h (putStrLn (concat $ replicate w "#")) 8 | putStrLn "" 9 | main 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/05C_hs_01.hs: -------------------------------------------------------------------------------- 1 | import Control.Applicative ((<$>)) 2 | main = do 3 | [h,w] <- map read . words <$> getLine 4 | if (h,w)==(0,0) then return () else do 5 | mapM_ putStrLn (chessboard h w) 6 | putStrLn "" 7 | main 8 | chessboard h w = map (line w) [1..h] 9 | line w i = map (\j -> if even (j+i) then '#' else '.') [1..w] 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/05C_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_5_C 2 | import Data.List 3 | main = interact 4 | $ unlines . map (cb . map read . words) . init . lines 5 | cb :: [Int] -> String 6 | cb [h,w] = unlines $ take h $ map (take w) $ tails $ cycle "#." 7 | cb _ = error "undefined" 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/05C_hs_03.hs: -------------------------------------------------------------------------------- 1 | main = getContents >>= 2 | mapM_ (\[h,w] -> do cb h w; putStrLn "") 3 | . takeWhile (/= [0,0]) . map (map read . words) . lines 4 | cb :: Int -> Int -> IO () 5 | cb h w = sequence_ 6 | $ take h . cycle . map (putStrLn . take w) 7 | $ [cycle "#.", cycle ".#"] 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/05C_hs_04.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = interact 3 | $ unlines . map (unlines . cb . map read . words) 4 | . takeWhile (/="0 0") . lines 5 | 6 | cb :: [Int] -> [String] 7 | cb [x,y] = f x (f y '#' '.') (f y '.' '#') 8 | where f n a b = take n . cycle $ a : [b] 9 | cb _ = error "undefined" 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/05C_hs_05.hs: -------------------------------------------------------------------------------- 1 | import Control.Applicative 2 | main = mapM_ (mapM_ putStrLn . chessboard) <$> 3 | fmap (takeWhile (\l -> l /= [0,0]) 4 | . map (map read . words) . lines) getContents 5 | where 6 | line w i = map (\j -> if odd j then '#' else '.') [1..w] 7 | chessboard [h,w] = map (line w) [1..h] ++ [""] 8 | chessboard _ = error "undefined" 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/05D_hs_01.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = readLn >>= putStrLn . (\n -> " " ++ unwords (map show $ f n)) where 3 | f n = filter (\j -> mod3 j || contain3 j) [1..n] 4 | mod3 j = j `mod` 3 == 0 5 | contain3 j = '3' `elem` show j 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/05D_hs_02.hs: -------------------------------------------------------------------------------- 1 | main = readLn >>= 2 | putStrLn . concat 3 | . (\n -> [" " ++ show x | x <- [1..n], 4 | elem '3' (show x) || (mod x 3 == 0)]) 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/05D_hs_03.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = readLn >>= putStrLn . (' ':) . unwords . f 3 | f :: (Integral a, Show a) => a -> [String] 4 | f n = [show x | x <- [1..n], x `mod` 3 == 0 || '3' `elem` show x] 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/05D_ml_00.ml: -------------------------------------------------------------------------------- 1 | let mod3 j = j mod 3 == 0;; 2 | let contain3 j = String.contains (string_of_int j) '3';; 3 | let solve n = for i=1 to n do if (mod3 i || contain3 i) then Printf.printf " %d" i else () done; print_newline();; 4 | let () = let n = read_int() in solve n;; 5 | 6 | solve 30;; 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/05D_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_5_D/review/2963157/napo/OCaml *) 2 | let () = 3 | let n = read_int() in 4 | for i = 3 to n do 5 | if i mod 3 = 0 || String.contains (string_of_int i) '3' then 6 | Printf.printf " %d" i; 7 | done; 8 | print_newline();; 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/06A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_6_A 2 | main :: IO () 3 | main = getLine >> getLine >>= putStrLn . unwords . reverse . words 4 | -------------------------------------------------------------------------------- /AOJ/ITP1/06A_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve xs = xs |> List.rev |> String.concat " ";; 2 | read_int() |> ignore; 3 | read_line() |> Str.split (Str.regexp " ") |> solve |> print_endline;; 4 | 5 | solve ["1";"2";"3";"4";"5"] = "5 4 3 2 1";; 6 | solve ["3";"3";"4";"4";"5";"8";"7";"9"] = "9 7 8 5 4 4 3 3";; 7 | 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/06A_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_6_A/review/1503472/kayabuyama8x/OCaml *) 2 | let () = 3 | ignore(read_line ()); 4 | print_endline (read_line () |> 5 | Str.split (Str.regexp " ") |> 6 | List.rev |> 7 | String.concat " ") 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/06A_ml_04.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_6_A/review/4960676/tonooo71/OCaml *) 2 | let n = read_int () 3 | let a = read_line () 4 | |> Str.split (Str.regexp_string " ") 5 | |> List.map int_of_string 6 | |> List.rev 7 | |> List.iteri (fun i a -> if i = (n - 1) then Printf.printf "%d\n" a else Printf.printf "%d " a) 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/06A_ml_05.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_6_A/review/5464436/que0/OCaml *) 2 | let _ = read_line () in 3 | let ls = Str.split (Str.regexp " ") (read_line ()) in 4 | print_string @@ String.concat " " @@ List.rev ls; 5 | print_newline() 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/06B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_6_B 2 | import Data.List ((\\)) 3 | main = getLine >> getContents >>= 4 | putStr . unlines . (\\) [x ++ " " ++ show y | x<-["S","H","C","D"], y<-[1..13]] . lines 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/06B_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_6_B/review/3483265/yachiwataru/Haskell 2 | main = getLine >> getContents >>= 3 | mapM_ putStrLn 4 | . (\cards -> filter (\x -> notElem x $ lines cards) 5 | [x ++ " " ++ show y | x <- ["S","H","C","D"], y <- [1..13]]) 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/07C_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_7_C/review/1690188/satoshi3/Haskell 2 | main :: IO () 3 | main = getContents >>= 4 | mapM_ (putStrLn . unwords . map show) 5 | . (\xs -> [x ++ [sum x] | x<-xs]) 6 | . (\([r,c]:xs) 7 | -> xs ++ [[sum $ map (!!n) xs | n <- [0..c-1]]]) 8 | . map (map read . words) . lines 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/08A_c_01.c: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_A/review/6605657/khagiwara/C 2 | #include 3 | #include 4 | int main() { 5 | char c; 6 | while ((c = getchar()) != EOF) { 7 | if (islower(c)) { c = toupper(c); } 8 | else { if (isupper(c)) { c = tolower(c); } } 9 | printf("%c", c); 10 | } 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /AOJ/ITP1/08A_cp_02.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_A/review/1988972/naoto172/C++ 2 | #include 3 | int main(){ 4 | char ch; 5 | while((ch = getchar()) != EOF){ 6 | if(ch >= 97 && ch <= 122) { printf("%c",ch-32); } 7 | else if(ch >= 65 && ch <= 90) { printf("%c",ch+32); } 8 | else { printf("%c",ch); } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/08A_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_A/review/2211469/aimy/Haskell 2 | import Data.Char (isLower,toLower,toUpper) 3 | main = interact 4 | $ map (\c -> if isLower c then toUpper c else toLower c) 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/08A_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_A/review/1696340/amusan39/Haskell 2 | import Data.Char (isLower,isUpper,toLower,toUpper) 3 | swapCase :: Char -> Char 4 | swapCase c 5 | | isUpper c = toLower c 6 | | isLower c = toUpper c 7 | | otherwise = c 8 | main :: IO () 9 | main = getLine >>= putStrLn . map swapCase 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/08A_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_A/review/5472874/que0/OCaml *) 2 | String.map 3 | (fun c -> let i = int_of_char c in char_of_int (i lxor (49/(abs(abs(i*2-187)-32)+24)*32))) 4 | (read_line ()) 5 | |> print_endline 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/08B_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve x = x |> Seq.map (string >> int) |> Seq.reduce (fun acc s -> acc+s) 5 | 6 | let main() = 7 | match stdin.ReadLine() with 8 | | "0" -> () 9 | | s -> solve x; main() 10 | 11 | [|"123";"55";"1000"|] |> Array.map solve |> should equal [|6;10;1|] 12 | -------------------------------------------------------------------------------- /AOJ/ITP1/08B_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_B/review/2211476/aimy/Haskell 2 | main :: IO () 3 | main = interact 4 | $ unlines . map (show . sum . map (read . return)) 5 | . takeWhile (/= "0") . lines 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/08B_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_B/review/1690385/satoshi3/Haskell 2 | import Data.Char ( digitToInt ) 3 | main :: IO () 4 | main = getContents >>= 5 | mapM_ (print . sum . map digitToInt) . init . words 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/08B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_B/review/5473857/que0/OCaml *) 2 | let s = ref "" ;; 3 | while (s := read_line (); !s <> "0") do 4 | let a = ref 0 in 5 | String.iter (fun c -> a:=!a+ + String.index_from "0123456789" 0 c) !s; 6 | Printf.printf "%d\n" !a 7 | done 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/08C_cp_01.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_C/review/1984735/naoto172/C++ 2 | #include 3 | int main(){ 4 | int countTable[256] = {0}; 5 | char ch; 6 | 7 | while((ch = getchar()) != EOF){ 8 | countTable[ch]++; 9 | } 10 | for(int i = 97; i <=122;i++){printf("%c : %d\n",i,countTable[i]+countTable[i-32]);} 11 | } 12 | -------------------------------------------------------------------------------- /AOJ/ITP1/08C_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_C/review/1690442/satoshi3/Haskell 2 | import Data.List (elemIndices) 3 | import Data.Char (toLower) 4 | 5 | main :: IO () 6 | main = getLine >>= 7 | mapM_ putStrLn 8 | . (\xs -> [ c : " : " ++ show (length $ elemIndices c xs) | c <- ['a'..'z']]) 9 | . map toLower 10 | -------------------------------------------------------------------------------- /AOJ/ITP1/08C_hs_04.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_C/review/2376612/napo/Haskell 2 | import Data.Char (toLower) 3 | main :: IO () 4 | main = getContents >>= 5 | putStr . unlines . solve . map toLower 6 | solve :: String -> [String] 7 | solve s = map f ['a'..'z'] 8 | where f c = (c : " : ") ++ (show . length $ filter (==c) s) 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/08C_hs_05.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_C/review/2459097/lhttjdr/Haskell 2 | import Data.Char (toLower) 3 | main :: IO () 4 | main = getContents >>= putStr . unlines . solve 5 | solve :: String -> [String] 6 | solve s = map f ['a'..'z'] where 7 | f c = c : " : " ++ show (length $ filter (== c) lowered) 8 | lowered = map toLower s 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/08D_c_02.c: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_D/review/6608152/khagiwara/C 2 | #include 3 | #include 4 | int main() { 5 | char s[101], s2[201], p[101]; 6 | scanf("%s", s); 7 | scanf("%s", p); 8 | strcpy(s2, s); 9 | strcat(s2, s); 10 | printf("%s\n", (strstr(s2, p) ? "Yes" : "No")); 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /AOJ/ITP1/08D_cp_01.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_D/review/1833464/beet/C++ 2 | #include 3 | #include 4 | using namespace std; 5 | int main(){ 6 | string s,p; 7 | cin >> s >> p; 8 | s=s+s; 9 | if(s.find(p)!=-1) {cout << "Yes" << endl;} 10 | else {cout << "No" << endl;} 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /AOJ/ITP1/08D_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_D/review/2212407/aimy/Haskell 2 | import Data.List (isInfixOf) 3 | main :: IO () 4 | main = interact 5 | $ (\[s,p] -> if p `isInfixOf` (s++s) then "Yes\n" else "No\n") 6 | . lines 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/08D_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_D/review/1518935/hamukichi/Haskell 2 | import Data.List (isInfixOf) 3 | 4 | main :: IO () 5 | main = do 6 | s <- getLine 7 | p <- getLine 8 | putStrLn $ if isInfixOf p $ concat $ replicate 2 s then "Yes" else "No" 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/08D_hs_04.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_D/review/1690443/satoshi3/Haskell 2 | import Data.List (isInfixOf) 3 | main = getContents >>= putStrLn 4 | . (\b -> if b then "Yes" else "No") 5 | . (\[s,p] -> isInfixOf p $ concat $ replicate 2 s) 6 | . words 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/08D_js_01.js: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_D/review/1219346/miraikako/JavaScript 2 | const input = require('fs').readFileSync('/dev/stdin', 'utf8'); 3 | const Arr=(input.trim()).split("\n"); 4 | const a=Arr[0]+Arr[0]+Arr[0]; 5 | const b=Arr[1]; 6 | console.log((a.indexOf(b)!==-1)?"Yes":"No"); 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/08D_js_02.js: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_D/review/6204897/RikiaR/JavaScript 2 | (inputs=>{ 3 | let p=inputs[0],s=inputs[1]; 4 | p+=p; 5 | console.log( p.includes(s)?"Yes":"No" ); 6 | })(require("fs").readFileSync("/dev/stdin","utf-8").trim("\n").split("\n")); 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/08D_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_8_D/review/1841858/superluminalsloth/OCaml *) 2 | let () = 3 | let l = read_line () 4 | and w = read_line () |> Str.regexp in 5 | try let _ = Str.search_forward w (l^l) 0 in "Yes" 6 | with Not_found -> "No"; |> print_endline;; 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/09A_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_9_A/review/2212417/aimy/Haskell 2 | import Data.Char ( toLower ) 3 | main :: IO () 4 | main = getContents >>= 5 | (\(w:t) -> print $ length $ filter (==w) t) 6 | . words . map toLower 7 | -------------------------------------------------------------------------------- /AOJ/ITP1/09A_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_9_A/review/1690448/satoshi3/Haskell 2 | import Data.List ( elemIndices ) 3 | import Data.Char ( toLower ) 4 | 5 | main :: IO () 6 | main = getContents >>= print 7 | . (\(x:xs) -> length $ elemIndices x xs) 8 | . map (map toLower) . words 9 | -------------------------------------------------------------------------------- /AOJ/ITP1/09C_hs_04.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_9_C/review/1690581/satoshi3/Haskell 2 | main :: IO () 3 | main = getContents 4 | >>= putStrLn 5 | . (\x -> shows (sum $ fst x) " " ++ show (sum $ snd x)) 6 | . (\xs -> unzip [ if a > b then (3,0) else if a < b then (0,3) else (1,1) | [a,b] <- xs]) 7 | . map words . tail . lines 8 | -------------------------------------------------------------------------------- /AOJ/ITP1/10A_c_01.c: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_10_A/review/2823771/bal4u/C 2 | #include 3 | #include 4 | 5 | int main(){ 6 | double x1, y1, x2, y2; 7 | scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2); 8 | printf("%.8lf\n", hypot(x1-x2, y1-y2)); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/10A_cp_01.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_10_A/review/1993636/naoto172/C++ 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main(){ 7 | double x1,y1,x2,y2; 8 | scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2); 9 | printf("%.8lf\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))); 10 | } 11 | -------------------------------------------------------------------------------- /AOJ/ITP1/10A_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_10_A/review/2212480/aimy/Haskell 2 | main = getLine 3 | >>= print 4 | . (\[x1,y1,x2,y2]-> sqrt $ (x2-x1)^2 + (y2-y1)^2) 5 | . map read . words 6 | -------------------------------------------------------------------------------- /AOJ/ITP1/10A_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_10_A/review/1839965/superluminalsloth/OCaml *) 2 | let () = 3 | Scanf.scanf "%f %f %f %f\n" (fun x1 y1 x2 y2->sqrt( (x2-.x1)**2.0 +. (y2-.y1)**2.0 ) ) 4 | |> print_float;print_newline();; 5 | -------------------------------------------------------------------------------- /AOJ/ITP1/10A_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_10_A/review/1997658/r6eve/OCaml *) 2 | Scanf.scanf"%f %f %f %f"(fun a b c d->Printf.printf"%f 3 | "(hypot(a-.c)(b-.d))) 4 | -------------------------------------------------------------------------------- /AOJ/ITP1/10A_ml_03.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP1_10_A/review/2030064/ydash/OCaml *) 2 | let () = 3 | let x,y = Scanf.scanf "%f %f %f %f\n" (fun a b c d -> a-.c,b-.d) in 4 | Printf.printf "%f\n" (hypot x y) 5 | -------------------------------------------------------------------------------- /AOJ/ITP2/01A_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/ITP2_1_A/review/5017994/mohejin/Python3 2 | q=int(input()) 3 | a=[] 4 | for i in range(q): 5 | com=list(map(int,input().split())) 6 | if com[0]==0: 7 | a.append(com[1]) 8 | elif com[0]==1: 9 | print(a[com[1]]) 10 | else: a.pop() 11 | -------------------------------------------------------------------------------- /AOJ/NTL1/01A_c_01.c: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_A/review/3759138/kyopro_friends/C 2 | #include 3 | int main(){ 4 | int n; 5 | scanf("%d",&n); 6 | printf("%d:",n); 7 | for(int i=2;i*i<=n;i++)if(n%i==0)printf(" %d",i),n/=i--; 8 | printf(n==1?"\n":" %d\n",n); 9 | } 10 | -------------------------------------------------------------------------------- /AOJ/NTL1/01B_c_01.c: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_B/review/3759153/kyopro_friends/C 2 | #include 3 | 4 | int main(){ 5 | int a,n; 6 | scanf("%d%d",&a,&n); 7 | long s=1,c=a,MOD=1000000007; 8 | while(n){ 9 | if(n%2)s=s*c%MOD; 10 | c=c*c%MOD; 11 | n/=2; 12 | } 13 | printf("%ld\n",s); 14 | } 15 | -------------------------------------------------------------------------------- /AOJ/NTL1/01B_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_B/review/1171693/lyoz/Python3 2 | m,n=map(int,input().split()) 3 | print(pow(m,n,1000000007)) 4 | -------------------------------------------------------------------------------- /AOJ/NTL1/01C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_C/review/1616092/cojna/Haskell 2 | main :: IO () 3 | main = interact $ (++"\n").show.foldr(lcm.read)1.tail.words 4 | -------------------------------------------------------------------------------- /AOJ/NTL1/01C_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_C/review/2121887/pedal/Haskell 2 | import Data.List(foldl1') 3 | 4 | main :: IO () 5 | main = do 6 | s' <- getContents 7 | print $ foldl1' lcm $ map read $ tail $ words s' 8 | -------------------------------------------------------------------------------- /AOJ/NTL1/01C_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_C/review/1906193/Naoki_M/Haskell 2 | import Data.Int ( Int64 ) 3 | main :: IO () 4 | main = getContents >>= print . foldl lcm 1 . map (read :: String -> Int64) . words . last . lines 5 | -------------------------------------------------------------------------------- /AOJ/NTL1/01C_hs_04.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_C/review/1717589/s1190170/Haskell 2 | main :: IO () 3 | main = do 4 | n <- getLine 5 | a <- fmap (map (read :: String -> Int) . words) getLine 6 | print $ foldl lcm 1 a 7 | -------------------------------------------------------------------------------- /AOJ/NTL1/01C_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_C/review/2688019/kyuna/Python3 2 | import math 3 | input();b=1 4 | for a in list(map(int,input().split())):b=a*b//math.gcd(a,b) 5 | print(b) 6 | -------------------------------------------------------------------------------- /AOJ/NTL1/01C_py_02.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_C/review/5007394/Kite_kuma/Python3 2 | import math 3 | 4 | n = int(input()) 5 | a = list(map(int, input().split())) 6 | ans = a[0] 7 | for x in a: 8 | ans = ans // math.gcd(ans,x) * x 9 | print(ans) 10 | -------------------------------------------------------------------------------- /AOJ/NTL1/01C_py_03.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_C/review/2163086/cima/Python3 2 | def gcd(a,b): 3 | while b:a,b=b,a%b 4 | return a 5 | 6 | def lcm(a,b): 7 | return a//gcd(a,b)*b 8 | 9 | input() 10 | a = list(map(int,input().split())) 11 | b = 1 12 | for i in a: 13 | b = lcm(b,i) 14 | print(b) 15 | -------------------------------------------------------------------------------- /AOJ/NTL1/01D_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_D/review/2188523/cima/Python3 2 | n=m=int(input()) 3 | i=2 4 | while i*i<=n: 5 | if n%i==0: 6 | m=m//i*(i-1) 7 | while n%i==0: n//=i 8 | i+=1 9 | if n!=1:m=m//n*(n-1) 10 | print(m) 11 | -------------------------------------------------------------------------------- /AOJ/NTL1/01E_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_E/review/2461659/r6eve/OCaml *) 2 | let rec($)a b=if b=0then(1,0)else let(x,y)=b$(a mod b)in(y,x-a/b*y);;Scanf.scanf"%d %d"(fun a b->let(x,y)=a$b in Printf.printf"%d %d 3 | "x y) 4 | -------------------------------------------------------------------------------- /AOJ/NTL1/01E_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_E/review/6080963/lloyz_nt/Python3 2 | def rec_gcd(a, b): 3 | if b == 0: 4 | return a, 1, 0 5 | d, y, x = rec_gcd(b, a % b) 6 | y -= a // b * x 7 | return d, x, y 8 | 9 | a, b = map(int, input().split()) 10 | _, x, y = rec_gcd(a, b) 11 | print(x, y) 12 | -------------------------------------------------------------------------------- /AOJ/NTL1/01E_py_02.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_1_E/review/2188577/cima/Python3 2 | a,b=map(int,input().split()) 3 | c=g=1;e=f=0 4 | while b: 5 | d,m=divmod(a,b) 6 | h=c-d*e 7 | i=f-d*g 8 | a,b=b,m 9 | c,e=e,h 10 | f,g=g,i 11 | print(c,f) 12 | -------------------------------------------------------------------------------- /AOJ/NTL1/02A_cp_01.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_2_A/review/5353315/tatyam/C++ 2 | #include 3 | #include 4 | 5 | int main(){ 6 | boost::multiprecision::cpp_int a, b; 7 | std::cin >> a >> b; 8 | std::cout << a + b << std::endl; 9 | } 10 | -------------------------------------------------------------------------------- /AOJ/NTL1/02A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_2_A/review/3831096/th90tk297/Haskell 2 | main :: IO () 3 | main = do 4 | [a,b] <- fmap (map read . words) getLine 5 | putStrLn $ unwords [show (a + b)] 6 | -------------------------------------------------------------------------------- /AOJ/NTL1/02A_ml_00.ml: -------------------------------------------------------------------------------- 1 | #load "nums.cma" 2 | open Big_int 3 | 4 | let solve a b = add_big_int a b;; 5 | 6 | let () = 7 | let x = Scanf.scanf "%s %s" (fun a b -> solve (big_int_of_string a) (big_int_of_string b)) in 8 | Printf.printf "%s\n" (Big_int.string_of_big_int x) ;; 9 | -------------------------------------------------------------------------------- /AOJ/NTL1/02A_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_2_A/review/3403219/beet/Python3 2 | print(sum(map(int, input().split()))) 3 | -------------------------------------------------------------------------------- /AOJ/NTL1/02B_cp_01.cpp: -------------------------------------------------------------------------------- 1 | // https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_2_B/review/6092185/neguse_atama/C++ 2 | #include 3 | #include 4 | using namespace std; 5 | int main(void){ 6 | boost::multiprecision::cpp_int a,b; 7 | cin>>a>>b; 8 | cout< solve (big_int_of_string a) (big_int_of_string b)) in 8 | Printf.printf "%s\n" (Big_int.string_of_big_int x);; 9 | -------------------------------------------------------------------------------- /AOJ/NTL1/02B_py_01.py: -------------------------------------------------------------------------------- 1 | A, B = map(int, input().split()) 2 | print(A-B) 3 | -------------------------------------------------------------------------------- /AOJ/NTL1/02C_ml_00.ml: -------------------------------------------------------------------------------- 1 | #load "nums.cma" 2 | open Big_int 3 | 4 | let solve a b = mult_big_int a b;; 5 | 6 | let () = 7 | let x = Scanf.scanf "%s %s" (fun a b -> solve (big_int_of_string a) (big_int_of_string b)) in 8 | Printf.printf "%s\n" (Big_int.string_of_big_int x);; 9 | -------------------------------------------------------------------------------- /AOJ/NTL1/02D_py_00.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_2_D/review/3363559/jakenu0x5e/Python3 2 | def solve(a,b): 3 | c = abs(a)//abs(b) 4 | return -c if a*b<0 else c 5 | a,b = map(int, input().split()) 6 | print(solve(a,b)) 7 | 8 | print(solve(5,8) == 0) 9 | -------------------------------------------------------------------------------- /AOJ/NTL1/02D_py_01.py: -------------------------------------------------------------------------------- 1 | # https://onlinejudge.u-aizu.ac.jp/solutions/problem/NTL_2_D/review/3363559/jakenu0x5e/Python3 2 | A, B = map(int, input().split()) 3 | C = abs(A)//abs(B) 4 | print(-C if A^B < 0 else C) 5 | -------------------------------------------------------------------------------- /AOJ/NTL1/02F_py_00.py: -------------------------------------------------------------------------------- 1 | A, B = map(int, input().split()) 2 | print(A*B) 3 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-001.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/69 3 | 標準出力を用いて、Hello Algo-method!と表示するプログラムを作成してください。 4 | -} 5 | module Main where 6 | main :: IO () 7 | main = putStrLn "Hello Algo-method!" 8 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-001.js: -------------------------------------------------------------------------------- 1 | console.log("Hello Algo-method!"); 2 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-001.py: -------------------------------------------------------------------------------- 1 | print("Hello Algo-method!") 2 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-001.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello Algo-method!"); 3 | } 4 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-002.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/70 3 | 標準出力を用いて、1 行目に 1 を、 2 行目に 2 を、 3 行目に 3 を表示するプログラムを作成してください。 4 | -} 5 | module Main where 6 | main :: IO () 7 | main = do 8 | putStrLn "1" 9 | putStrLn "2" 10 | putStrLn "3" 11 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-002.js: -------------------------------------------------------------------------------- 1 | console.log(1); 2 | console.log(2); 3 | console.log(3); 4 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-002.py: -------------------------------------------------------------------------------- 1 | print("1\n2\n3") 2 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-002.rs: -------------------------------------------------------------------------------- 1 | fn main(){ 2 | println!("1\n2\n3"); 3 | } 4 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-003.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/71 3 | 27182 を 818 で割った余りを表示するプログラムを作成してください。 4 | -} 5 | module Main where 6 | main :: IO () 7 | main = print $ 27182 `mod` 818 8 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-003.js: -------------------------------------------------------------------------------- 1 | console.log(27182%818); 2 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-003.py: -------------------------------------------------------------------------------- 1 | print(27182%818) 2 | # print(27182//818) 3 | # print (818*33) 4 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-003.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("{}", 27182 % 818); 3 | } 4 | 5 | fn add(a: i32, b: i32) -> i32 { 6 | a + b 7 | } 8 | 9 | #[cfg(test)] 10 | mod tests { 11 | use super::*; 12 | #[test] 13 | fn add_test() { 14 | assert_eq!(2, add(1, 1)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-004.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/72 3 | 314×(159+265)−358 の計算結果を出力するプログラムを作成してください。 4 | -} 5 | module Main where 6 | main :: IO () 7 | main = print $ 314*(159+265)-358 8 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-004.js: -------------------------------------------------------------------------------- 1 | console.log(314*(159+265)-358); 2 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-004.py: -------------------------------------------------------------------------------- 1 | print(314*(159+265)-358) 2 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-004.rs: -------------------------------------------------------------------------------- 1 | fn main(){ 2 | println!("{}", 314*(159+265)-358); 3 | } 4 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-005.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/73 3 | 1 日は 24 時間、 1 時間は 60 分、1 分は 60 秒です。 4 | 1 日は何秒かを計算し、整数で出力するプログラムを作成してください。 5 | -} 6 | module Main where 7 | main :: IO () 8 | main = print $ 24*60*60 9 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-005.js: -------------------------------------------------------------------------------- 1 | console.log(24*60*60); 2 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-005.py: -------------------------------------------------------------------------------- 1 | print(24*60*60) 2 | -------------------------------------------------------------------------------- /Algo-Method/01-std-output/001-005.rs: -------------------------------------------------------------------------------- 1 | fn main(){ 2 | println!("{}", 24*60*60); 3 | } 4 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-001.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/15 3 | 1 以上 100 以下の整数 N が標準入力から与えられます。 4 | N を 2 倍した値を標準出力するプログラムを作ってください。 5 | -} 6 | module Main where 7 | main :: IO () 8 | main = do 9 | n <- read <$> getLine :: IO Int 10 | print $ n*2 11 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-001.js: -------------------------------------------------------------------------------- 1 | let reader = require('readline').createInterface({ 2 | input: process.stdin, 3 | output: process.stdout 4 | }); 5 | let lines = []; 6 | reader.on('line', function(line) { 7 | lines.push(parseInt(line,10)); 8 | }); 9 | reader.on('close', function() { 10 | console.log(lines[0]*2); 11 | }); 12 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-001.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | print(2*n) 3 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-001.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s: String = String::new(); 3 | std::io::stdin().read_line(&mut s).ok(); 4 | let n:i32 = s.trim().parse().unwrap(); 5 | println!("{}", n * 2); 6 | } 7 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-002.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/16 3 | 1 以上 100 以下の整数 N が標準入力から与えられます。 4 | N を 5 で割ったあまりを標準出力するプログラムを作成してください。 5 | -} 6 | main :: IO () 7 | main = getLine >>= print . (`div` 5) . read 8 | 9 | test :: IO () 10 | test = do 11 | n <- read <$> getLine :: IO Int 12 | print $ n `div` 5 13 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-002.py: -------------------------------------------------------------------------------- 1 | n = int(input()) 2 | print(n%5) 3 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-002.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut s: String = String::new(); 3 | std::io::stdin().read_line(&mut s).ok(); 4 | let n:i32 = s.trim().parse().unwrap(); 5 | println!("{:?}", n%5); 6 | } 7 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-003.py: -------------------------------------------------------------------------------- 1 | s = input() 2 | print(f"{s}{s}{s}") 3 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-003.rs: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/submissions/848771 2 | use std::io; 3 | 4 | fn main() { 5 | let mut input = String::new(); 6 | io::stdin().read_line(&mut input).expect("Failed to read line"); 7 | let s = input.trim().to_string(); 8 | println!("{}", s.repeat(3)); 9 | } 10 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-004.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/22 3 | 長さ 5 の文字列 S が標準入力から与えられます。文字列 S の中央の文字を出力してください。 4 | 5 | たとえば入出力例 1 に示す通り、S= power に対しては、文字 w を出力します。 6 | -} 7 | main :: IO () 8 | main = getLine >>= putChar . (!!2) 9 | 10 | test1 = (!!2) <$> getLine >>= putChar 11 | test2 = getLine >>= putChar . head . drop 2 12 | test3 = interact $ return . (!!2) 13 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-004.py: -------------------------------------------------------------------------------- 1 | s = input() 2 | print(s[2]) 3 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-004.rs: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/submissions/413830 2 | fn main() { 3 | let ref mut s = String::new(); 4 | std::io::stdin().read_line(s); 5 | print!("{}", s.chars().nth(2).unwrap()); 6 | } 7 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-005.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/23 3 | 0 以上 23 以下の整数 X が標準入力から与えられます。 4 | 現在の時刻が X 時のとき、日が変わる ( 24 時になる) まであと何時間かかるかを計算してください。 5 | -} 6 | main :: IO () 7 | main = getLine >>= putStrLn . show . (24-) . read 8 | test1 = readLn >>= print . (24-) 9 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-005.py: -------------------------------------------------------------------------------- 1 | x = int(input()) 2 | print(24-x) 3 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/001-005.rs: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/submissions/276393 2 | fn main() { 3 | let mut s = String::new(); 4 | std::io::stdin().read_line(&mut s); 5 | let num :u32 = s.trim().parse().unwrap(); 6 | println!("{}", 24 - num); 7 | } 8 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-001.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/24 3 | 2 つの正の整数 A,B が空白区切りで入力されます。A+B の値を出力してください。 4 | -} 5 | main :: IO () 6 | main = getLine >>= print . sum . map read . words 7 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-001.py: -------------------------------------------------------------------------------- 1 | a,b = map(int,input().split()) 2 | print(a+b) 3 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-001.rs: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/submissions/413831 2 | fn main() { 3 | let ref mut s = String::new(); 4 | std::io::stdin().read_line(s); 5 | let s: u8 = s.split_whitespace() 6 | .map(|s| s.parse::().unwrap()) 7 | .sum(); 8 | print!("{}", s); 9 | } 10 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-002.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/27 3 | 2 つの正の整数 A,B が空白区切りで入力されます。A と B のうち大きい方の値を出力してください。 4 | 5 | ただし、A と B の値は異なることが保証されています。 6 | -} 7 | main :: IO () 8 | main = getLine >>= 9 | print . maximum . map (\x -> read x :: Int) . words 10 | 11 | test1 = getLine >>= print . foldr (max . read) 0 . words 12 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-002.py: -------------------------------------------------------------------------------- 1 | a,b = map(int,input().split()) 2 | print(b if a>= print 9 | . (\[a,b] -> if a `mod` 10 < b `mod` 10 then a else b) 10 | . map read . words 11 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-003.py: -------------------------------------------------------------------------------- 1 | a,b = input().split() 2 | print(a if (int(a[-1])>= putStr 7 | . (\[a,b] -> if a `mod` b == 0 then "Yes" else "No") 8 | . map read . words 9 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-004.py: -------------------------------------------------------------------------------- 1 | a,b = map(int,input().split()) 2 | print("Yes" if a%b==0 else "No") 3 | 4 | a,b = 8,4 5 | print("Yes" if a%b==0 else "No" == "Yes") 6 | a,b = 11,3 7 | print("Yes" if a%b==0 else "No" == "No") 8 | 9 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-005.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/25 3 | 3 つの整数 A,B,C が空白区切りで入力されます。3 つの整数の平均値を整数で出力してください。 4 | 5 | ただし、答えは整数になることが保証されています。 6 | -} 7 | main :: IO () 8 | main = getLine >>= putStrLn .show 9 | . (`div` 3) . sum . map read . words 10 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-005.py: -------------------------------------------------------------------------------- 1 | a,b,c = map(int,input().split()) 2 | print((a+b+c)//3) 3 | 4 | # test 5 | print((1+3+8)//3) 6 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-006.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/29 3 | 4 つの正の整数 A,B,C,D が空白区切りで入力されます。4 つの整数の最大値を出力してください。 4 | -} 5 | main :: IO () 6 | main = getLine >>= print . maximum . map (\x -> read x :: Int) . words 7 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-006.py: -------------------------------------------------------------------------------- 1 | a,b,c,d = map(int,input().split()) 2 | print(max(a,b,c,d)) 3 | 4 | def test(): 5 | print(max(31,41,59,26)) 6 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-006.rs: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/submissions/415575 2 | fn main() { 3 | let ref mut s = String::new(); 4 | std::io::stdin().read_line(s); 5 | let s: u8 = s.split_whitespace() 6 | .map(|s| s.parse().unwrap()) 7 | .max() 8 | .unwrap(); 9 | print!("{}", s); 10 | } 11 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-007.py: -------------------------------------------------------------------------------- 1 | s = input() 2 | t = input() 3 | print("Yes" if s==t else "No") 4 | 5 | def test(): 6 | print(("Yes" if "turtle" == "turtle" else "No") == "Yes") 7 | print(("Yes" if "algo" == "method" else "No") == "No") 8 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-007.rs: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/submissions/258537 2 | use std::io; 3 | 4 | fn main() { 5 | let mut s = String::new(); 6 | io::stdin().read_line(&mut s); 7 | 8 | let mut t = String::new(); 9 | io::stdin().read_line(&mut t); 10 | 11 | println!("{}", if s.trim() == t.trim() {"Yes"} else {"No"}); 12 | } 13 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-008.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/26 3 | 3 つの文字列 S, T, U が改行区切りで入力されます。U と T と S をこの順につなげた文字列を出力してください。 4 | -} 5 | import Control.Monad (replicateM) 6 | main :: IO () 7 | main = getContents >>= putStr . concat . reverse . lines 8 | 9 | solve1 = replicateM 3 getLine >>= putStr . concat . reverse 10 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-008.py: -------------------------------------------------------------------------------- 1 | def solve(s,t,u): return u+t+s 2 | s = input() 3 | t = input() 4 | u = input() 5 | print(solve(s,t,u)) 6 | 7 | def test(): 8 | print(solve("hod","met","algo") == "algomethod") 9 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-009.py: -------------------------------------------------------------------------------- 1 | def solve(s,n): return s[n-1] 2 | s = input() 3 | n = int(input()) 4 | print(solve(s,n)) 5 | 6 | def test(): 7 | print(solve("algo", 2) == "l") 8 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/002-010.py: -------------------------------------------------------------------------------- 1 | def solve(s,n,m): 2 | l = list(s) 3 | l[n-1],l[m-1] = l[m-1],l[n-1] 4 | return "".join(l) 5 | s = input() 6 | n,m = map(int,input().split()) 7 | print(solve(s,n,m)) 8 | 9 | def test(): 10 | print(solve("algo",2,3) == "aglo") 11 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-001.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/53 3 | N 個の正の整数 A0,A1,…,AN−1が与えられます。 4 | N 個の整数の合計値を求めてください。 5 | -} 6 | main :: IO () 7 | main = getLine >> getLine >>= print . sum . map read . words 8 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-001.py: -------------------------------------------------------------------------------- 1 | def solve(n,a): return sum(a) 2 | n = input() 3 | a = map(int,input().split()) 4 | print(solve(n,a)) 5 | 6 | def test(): 7 | print(solve(3,[10,20,30]) == 60) 8 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-001.rs: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/submissions/416242 2 | use std::io::stdin; 3 | fn main() { 4 | let ref mut s = String::new(); 5 | stdin().read_line(s); 6 | stdin().read_line(s); 7 | let s: u32 = s.split_whitespace() 8 | .skip(1) 9 | .map(|s| s.parse::().unwrap()) 10 | .sum(); 11 | print!("{}", s); 12 | } 13 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-002.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/54 3 | -} 4 | 5 | main :: IO () 6 | main = getLine >> getLine >>= print . product . map read . words 7 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-002.py: -------------------------------------------------------------------------------- 1 | from functools import reduce 2 | def solve(n,a): return reduce(lambda x,y: x*y, a) 3 | n = input() 4 | a = map(int,input().split()) 5 | print(solve(n,a)) 6 | 7 | def test(): 8 | print(solve(3,[10,20,30]) == 6000) 9 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-003.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/52 3 | -} 4 | main :: IO () 5 | main = getLine >> getLine >>= mapM_ print 6 | <$> map (\x -> read x `mod` 10) . words 7 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-003.py: -------------------------------------------------------------------------------- 1 | def solve(n,a): return list(map(lambda x: x%10, a)) 2 | n = input() 3 | a = map(int,input().split()) 4 | for x in solve(n,a): print(x) 5 | 6 | def test(): 7 | n = 3 8 | a = [31,41,59] 9 | map(print,solve(n, a)) 10 | print(solve(n,a) == [1,1,9]) 11 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-004.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/56 3 | -} 4 | main :: IO () 5 | main = getLine >> getLine >>= mapM_ print 6 | . filter (\x -> x `mod` 3 == 0) . map read . words 7 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-004.py: -------------------------------------------------------------------------------- 1 | def solve(n,A): return list(filter(lambda x: x%3==0, A)) 2 | n = input() 3 | A = map(int,input().split()) 4 | for x in solve(n,A): print(x) 5 | 6 | def test(): 7 | n,A = 3,[27,18,28] 8 | print(solve(n,A) == [27,18]) 9 | n,A = 3,[31,41,59] 10 | print(solve(n,A) == []) 11 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-005.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/57 3 | -} 4 | main :: IO () 5 | main = getLine >> getLine >>= mapM_ putStrLn <$> reverse . words 6 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-005.py: -------------------------------------------------------------------------------- 1 | def solve(n,A): return list(reversed(A)) 2 | n = input() 3 | A = list(map(int,input().split())) 4 | for x in solve(n,A): print(x) 5 | 6 | def test(): 7 | n,A = 3,[31,41,59] 8 | print(solve(n,A) == [59,41,31]) 9 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-006.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/60 3 | -} 4 | main :: IO () 5 | main = do 6 | n <- readLn 7 | as <- map read . words <$> getLine 8 | print $ (\x -> floor $ x/n :: Int) $ sum as 9 | 10 | solve :: IO () 11 | solve = do 12 | n <- readLn :: IO Int 13 | xs <- map read . words <$> getLine :: IO [Int] 14 | print $ sum xs `div` n 15 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-006.py: -------------------------------------------------------------------------------- 1 | def solve(n,A): return sum(A)//n 2 | n = int(input()) 3 | A = list(map(int,input().split())) 4 | print(solve(n,A)) 5 | 6 | def test(): 7 | n,A = 3,[31,41,59] 8 | print(solve(n,A) == 43) 9 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-007.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/61 3 | -} 4 | module Main where 5 | import Control.Monad (replicateM) 6 | import Data.Function ((&)) 7 | import Data.Maybe (fromJust) 8 | import qualified Data.ByteString.Char8 as BS 9 | 10 | main :: IO () 11 | main = getLine >> getLine >>= print . minimum . map (\x -> read x :: Int) . words 12 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-007.py: -------------------------------------------------------------------------------- 1 | def solve(n,A): return min(A) 2 | n = int(input()) 3 | A = list(map(int,input().split())) 4 | print(solve(n,A)) 5 | 6 | def test(): 7 | n,A = 3,[27,18,28] 8 | print(solve(n,A) == 18) 9 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-008.py: -------------------------------------------------------------------------------- 1 | from functools import reduce 2 | def solve(n,S): return len(reduce(lambda x,y: x+y, S)) 3 | n = int(input()) 4 | S = [input() for i in range(n)] 5 | print(solve(n,S)) 6 | 7 | def test(): 8 | n,S = 3,["hello","algo","method"] 9 | print(solve(n,S)) 10 | print(solve(n,S) == 15) 11 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-009.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://algo-method.com/tasks/58 3 | -} 4 | import Control.Monad (replicateM) 5 | main :: IO () 6 | main = (getLine >>= (`replicateM` getLine) . read) 7 | >>= putStr . map head 8 | -------------------------------------------------------------------------------- /Algo-Method/02-std-input/003-009.py: -------------------------------------------------------------------------------- 1 | def solve(n,S): return "".join(list(map(lambda x:x[0], S))) 2 | n = int(input()) 3 | S = [input() for x in range(n)] 4 | print(solve(n,S)) 5 | 6 | def test(): 7 | n,S = 4,["hyper","text","transfer","protocol"] 8 | print(solve(n,S) == "http") 9 | -------------------------------------------------------------------------------- /Algo-Method/08-knapsack-dp/307-01-py.py: -------------------------------------------------------------------------------- 1 | N = int(input()) 2 | As = map(int,input().split()) 3 | 4 | def solve(As): 5 | Bs = list(filter(lambda x: x>=0, As)) 6 | return 0 if len(Bs) == 0 else sum(Bs) 7 | 8 | print(solve(As)) 9 | 10 | def test(): 11 | N,As = 3, [7,-6,9] 12 | print(solve(As) == 16) 13 | N,As = 2, [-9,-16] 14 | print(solve(As) == 0) 15 | -------------------------------------------------------------------------------- /Algo-Method/Arithmetics/tasks-00108.py: -------------------------------------------------------------------------------- 1 | n = len(list(filter(lambda x: x%2 == 0, range(1,101)))) 2 | print(100-n) 3 | -------------------------------------------------------------------------------- /Algo-Method/Arithmetics/tasks-00109.py: -------------------------------------------------------------------------------- 1 | A,B = input().split() 2 | A = int(A) 3 | B = int(B) 4 | print(A+B) 5 | -------------------------------------------------------------------------------- /Algo-Method/FullSearch/01_cpp_0069.cpp: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/tasks/209 2 | //#include 3 | #include 4 | using namespace std; 5 | 6 | int main() { 7 | cout << "Hello Algo-method!" << endl; 8 | //printf("Hello Algo-method!\n"); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /Algo-Method/FullSearch/02_cpp_0070.cpp: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/tasks/70 2 | #include 3 | using namespace std; 4 | 5 | int main() { 6 | printf("1\n"); 7 | printf("2\n"); 8 | printf("3\n"); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /Algo-Method/FullSearch/03_cpp_0071.cpp: -------------------------------------------------------------------------------- 1 | // https://algo-method.com/tasks/70 2 | #include 3 | using namespace std; 4 | 5 | int main() { 6 | printf("%d\n", 27182 % 818); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /Algo-Method/FullSearch/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | - [全探索](https://algo-method.com/courses/3) 3 | -------------------------------------------------------------------------------- /Algo-Method/computation-complexity/003-004.py: -------------------------------------------------------------------------------- 1 | def solve(n,A): s = sum(A); return s*s 2 | n = int(input()) 3 | A = list(map(int,input().split())) 4 | print(solve(n,A)) 5 | 6 | def test(): 7 | n,A = 2,[1,2] 8 | print(solve(n,A) == 9) 9 | n,A = 3,[1,10,100] 10 | print(solve(n,A) == 12321) 11 | -------------------------------------------------------------------------------- /Algo-Method/computation-complexity/003-005.py: -------------------------------------------------------------------------------- 1 | def solve(n,A): 2 | s1 = sum(A) 3 | s2 = sum(map(lambda a: a**2, A)) 4 | return (s1**2-s2)//2 5 | n = int(input()) 6 | A = list(map(int,input().split())) 7 | print(solve(n,A)) 8 | 9 | def test(): 10 | n,A = 2,[1,2] 11 | print(solve(n,A) == 2) 12 | n,A = 3,[1,10,100] 13 | print(solve(n,A) == 1110) 14 | -------------------------------------------------------------------------------- /AtCoder/ABC042/B_fs_01.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let solve N L Ss = Array.sort Ss |> String.concat "" 5 | let N, L = stdin.ReadLine().Split() |> Array.map int |> (fun x -> x.[0], x.[1]) 6 | let Ss = [| for i in 1..N do (stdin.ReadLine()) |] 7 | solve N L Ss |> stdout.WriteLine 8 | 9 | solve 3 3 [|"dxx";"axx";"cxx"|] |> should equal "axxcxxdxx" 10 | -------------------------------------------------------------------------------- /AtCoder/ABC042/B_ml_00.ml: -------------------------------------------------------------------------------- 1 | let solve sa = 2 | Array.sort compare sa; 3 | sa |> Array.to_list |> String.concat "";; 4 | let n,l = Scanf.scanf " %d %d" @@ fun a b -> a, b;; 5 | let sa = Array.init n @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s;; 6 | solve sa |> print_endline;; 7 | 8 | solve [|"dxx";"axx";"cxx"|] = "axxcxxdxx";; 9 | 10 | -------------------------------------------------------------------------------- /AtCoder/ABC042/B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc042/submissions/7672533 *) 2 | let n,l = Scanf.scanf " %d %d" @@ fun a b -> a, b;; 3 | let sa = Array.init n @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s;; 4 | Array.sort compare sa; 5 | Array.iter print_string sa; 6 | print_newline();; 7 | -------------------------------------------------------------------------------- /AtCoder/ABC042/B_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc042/submissions/7672504 *) 2 | let n, l = Scanf.scanf " %d %d" @@ fun a b -> a, b 3 | let ss = Array.init n @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s 4 | let _ = Array.(sort compare ss; to_list ss |> String.concat "" |> print_endline) 5 | -------------------------------------------------------------------------------- /AtCoder/ABC042/B_ml_03.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc042/submissions/4377347 *) 2 | let () = 3 | let n = Scanf.scanf " %d %d\n" (fun n _ -> n) in 4 | List.init n (fun _ -> Scanf.scanf "%s\n" (fun x -> x)) 5 | |> List.sort compare 6 | |> List.fold_left (fun x y -> x ^ y) "" 7 | |> print_endline 8 | -------------------------------------------------------------------------------- /AtCoder/ABC043/B_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc043/submissions/7993860 *) 2 | let s = read_line ();; 3 | let cs, i = Array.make 10 ' ', ref 0;; 4 | let _ = String.(iter (function 5 | |'B' -> i := max 0 @@ !i - 1 6 | | c -> cs.(!i) <- c; incr i) s; 7 | print_endline @@ init !i @@ Array.get cs) 8 | -------------------------------------------------------------------------------- /AtCoder/ABC044/B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc044/submissions/15336681 *) 2 | Scanf.scanf "%s" (fun w -> 3 | let h = Array.make 26 0 in 4 | String.iter (fun v -> let q = int_of_char v - 97 in h.(q) <- h.(q) + 1) w; 5 | print_endline @@ if Array.fold_left (lor) 0 h mod 2 = 0 then "Yes" else "No") 6 | -------------------------------------------------------------------------------- /AtCoder/ABC044/B_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc044/submissions/7972522 *) 2 | let w = read_line () 3 | let f s x = let n = ref 0 in String.iter (fun c -> if c = x then incr n) s; !n 4 | let _ = String.iter (fun c -> if f w c mod 2 = 1 then (print_endline "No"; exit 0)) w; print_endline "Yes" 5 | -------------------------------------------------------------------------------- /AtCoder/ABC044/B_ml_03.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc044/submissions/5903395 *) 2 | (* O(n) *) 3 | let w = read_line ();; 4 | let n = String.length w;; 5 | for i = Char.code 'a' to Char.code 'z' do 6 | let c = ref 0 in 7 | String.iter (fun x -> if x = Char.chr i then incr c) w; 8 | if !c mod 2 <> 0 then (print_endline "No"; exit 0) 9 | done; 10 | print_endline "Yes";; 11 | -------------------------------------------------------------------------------- /AtCoder/ABC044/B_ml_05.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc044/submissions/2139288 *) 2 | let arr_of_str s = Array.init (String.length s) (fun i -> s.[i]);; 3 | let f b c = b lxor (1 lsl (int_of_char c - 97));; 4 | let st = Scanf.scanf "%s" arr_of_str |> Array.fold_left f 0 in 5 | print_endline (if st = 0 then "Yes" else "No") 6 | -------------------------------------------------------------------------------- /AtCoder/ABC048/B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc048/submissions/4762237 2 | main :: IO () 3 | main = do 4 | [a,b,x] <- map read . words <$> getLine 5 | print $ b `div` x - (a-1) `div` x 6 | -------------------------------------------------------------------------------- /AtCoder/ABC048/B_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc048/submissions/26794378 2 | main :: IO () 3 | main = interact $ show . f . map read . words; f [a,b,x] = div b x - div (a-1) x 4 | -------------------------------------------------------------------------------- /AtCoder/ABC048/B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc048/submissions/16768705 *) 2 | Scanf.scanf "%d %d %d" (fun a b x -> Printf.printf "%d\n" (b / x - (a + x - 1) / x + 1)) 3 | 4 | -------------------------------------------------------------------------------- /AtCoder/ABC048/B_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc048/submissions/6317559 *) 2 | let a, b, x = Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c 3 | let f n = if n < 0 then 0 else n / x + 1 4 | let _ = Printf.printf "%d\n" @@ f b - f (a - 1) 5 | -------------------------------------------------------------------------------- /AtCoder/ABC048/B_ml_03.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc048/submissions/14640650 *) 2 | Scanf.scanf "%d %d %d" (fun a b x -> 3 | let ans = if a = 0 then b / x + 1 else b / x - (a - 1) / x in 4 | Printf.printf "%d\n" ans 5 | ) 6 | -------------------------------------------------------------------------------- /AtCoder/ABC049/C_fs_01.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc049/submissions/13132180 2 | open System.Text.RegularExpressions 3 | 4 | let ok str = 5 | let m = Regex("^(dream|dreamer|erase|eraser)+$").Match(str) 6 | m.Success 7 | 8 | let S = stdin.ReadLine() 9 | if ok S then "YES" else "NO" |> stdout.WriteLine 10 | -------------------------------------------------------------------------------- /AtCoder/ABC049/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc049/submissions/1024184 2 | f :: [Char] -> [Bool] 3 | f [] = [True] 4 | f s = [a == x && or (f b) | 5 | x <- ["dream","dreamer","erase","eraser"], 6 | let (a,b) = splitAt (length x) s] 7 | main :: IO () 8 | main = do 9 | s <- getLine 10 | putStrLn $ if or (f s) then "YES" else "NO" 11 | -------------------------------------------------------------------------------- /AtCoder/ABC049/C_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc049/submissions/25639280 2 | main=do s<-reverse<$>getLine;putStr$ f s 3 | f "" = "YES" 4 | f ('m':'a':'e':'r':'d':ns) = f ns 5 | f ('r':'e':'m':'a':'e':'r':'d':ns) = f ns 6 | f ('e':'s':'a':'r':'e':ns) = f ns 7 | f ('r':'e':'s':'a':'r':'e':ns) = f ns 8 | f _ = "NO" 9 | -------------------------------------------------------------------------------- /AtCoder/ABC049/C_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc049/submissions/3453531 *) 2 | Scanf.scanf" %s"@@fun s->print_endline@@if Str.(string_match(regexp"^\\s*\\(dream\\|dreamer\\|erase\\|eraser\\)+\\s*$")s 0)then"YES"else"NO" 3 | -------------------------------------------------------------------------------- /AtCoder/ABC049/C_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc049/submissions/6048694 *) 2 | (* O(|s|) *) 3 | open Str 4 | let s = read_line () 5 | let _ = print_endline @@ if string_match (regexp "^\\(dream\\|dreamer\\|erase\\|eraser\\)+$") s 0 then "YES" else "NO" 6 | -------------------------------------------------------------------------------- /AtCoder/ABC051/B02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc051/submissions/24941243{- 2 | main :: IO () 3 | main = interact 4 | $show . solve . map read . words 5 | 6 | solve :: (Enum a, Ord a, Num a) => [a] -> Int 7 | solve [k,s] = length [1 | x <- [0..k] , y <- [0..k], 8 | 0<=s-x-y && s-x-y<=k] 9 | solve _ = error "undefined" 10 | -------------------------------------------------------------------------------- /AtCoder/ABC051/B03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc051/submissions/21602008 2 | main :: IO () 3 | main = do 4 | [k, s] <- map read . words <$> getLine 5 | print $ solve k s 6 | 7 | solve :: Int -> Int -> Int 8 | solve k s = length [1 | x <- [0..k], y <- [0..k], 9 | let z = s - x - y, z <= k, z >= 0] 10 | -------------------------------------------------------------------------------- /AtCoder/ABC051/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc051/submissions/14684395 2 | main :: IO () 3 | main = interact $ solve .map read . words 4 | solve :: [Int] -> String 5 | solve [sx,sy,tx,ty] = 6 | concat $ zipWith replicate [x,y+1,x+1,y+1,1,1,x+1,y+1,x+1,y] "RULDRDRULD" 7 | where (x,y) = (tx-sx,ty-sy) 8 | solve _ = error "not come here" 9 | -------------------------------------------------------------------------------- /AtCoder/ABC051/C_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc051/submissions/9848337 2 | main :: IO () 3 | main = do 4 | [a,b,c,d] <- map read . words <$> getLine 5 | putStrLn $ f (c-a) (d-b) ++ "LULU" ++ f (c-a) (d-b) 6 | f :: Int -> Int -> String 7 | f x y = replicate y 'U' ++ replicate (x+1) 'R' ++ replicate (y+1) 'D' ++ replicate x 'L' 8 | -------------------------------------------------------------------------------- /AtCoder/ABC051/C_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc051/submissions/7793127 *) 2 | let dx, dy = Scanf.scanf " %d %d %d %d" @@ fun a b c d -> c - a, d - b 3 | let f n c = print_string @@ String.make n c 4 | let _ = f dy 'U'; f dx 'R'; f dy 'D'; f dx 'L'; 5 | f 1 'L'; f (dy + 1) 'U'; f (dx + 1) 'R'; f 1 'D'; f 1 'R'; f (dy + 1) 'D'; f (dx + 1) 'L'; f 1 'U' 6 | -------------------------------------------------------------------------------- /AtCoder/ABC057/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc057/submissions/9848330 2 | main :: IO () 3 | main = do 4 | n <- readLn 5 | print $ minimum [f i $ div n i | i <- [1..10^5], mod n i == 0] 6 | f :: Integer -> Integer -> Int 7 | f a b = max (g a) (g b) 8 | g :: Integer -> Int 9 | g = length . show 10 | -------------------------------------------------------------------------------- /AtCoder/ABC057/C_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc057/submissions/11965721 2 | main :: IO () 3 | main = interact $ show . sol . read 4 | sol :: Integer -> Int 5 | sol n = length . show . div n $ last [i | i <- [1..min n (10^5)], mod n i==0, i*i<=n] 6 | -------------------------------------------------------------------------------- /AtCoder/ABC057/C_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc057/submissions/6327311 *) 2 | let n = read_int () 3 | let i, d = ref 1, ref 1 4 | let rec f n = if n <= 9 then 1 else 1 + f (n / 10) 5 | let _ = 6 | while !i * !i < n do if n mod !i = 0 then d := !i; incr i done; 7 | Printf.printf "%d\n" @@ if !i * !i = n then f !i else f @@ n / !d 8 | -------------------------------------------------------------------------------- /AtCoder/ABC057/C_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc057/submissions/2254472 *) 2 | let n = read_int () 3 | let rec f x = if n mod x = 0 then n / x else f (pred x) 4 | let len_int x = 5 | let rec f tmp c = if tmp > 0 then f (tmp / 10) (succ c) else c in 6 | f x 0 7 | let () = int_of_float (float n ** 0.5) |> f |> len_int |> Printf.printf "%d\n" 8 | -------------------------------------------------------------------------------- /AtCoder/ABC061/C04.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc061/submissions/15800217 2 | import Data.List 3 | main = interact 4 | $ show . f . map (map read . words) . lines 5 | 6 | f([n,k]:l) = k % sort l;k%([a,b]:l)|b getLine 4 | print . maximum . filter (<= n) $ [2^x | x <- [0..10]] 5 | -------------------------------------------------------------------------------- /AtCoder/ABC068/B1.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc068/submissions/5224609 2 | 3 | main = 4 | interact $ \x -> show . (`div` 2) . head . dropWhile (((read::String->Int) x) >=) . map (2^) $ [1..] 5 | -------------------------------------------------------------------------------- /AtCoder/ABC068/B3.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc068/submissions/2373088 2 | let rec f n x = if x * 2 > n then x else f n (x * 2) 3 | 4 | let N = stdin.ReadLine() |> int 5 | f N 1 |> printfn "%d" 6 | -------------------------------------------------------------------------------- /AtCoder/ABC070/C2.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc070/submissions/22268965 3 | -} 4 | import Control.Monad (replicateM) 5 | import Data.List (foldl') 6 | 7 | main :: IO () 8 | main = do 9 | n <- readLn 10 | ts <- replicateM n readLn :: IO [Int] 11 | print $ solve ts 12 | 13 | solve :: [Int] -> Int 14 | solve = foldl' lcm 1 15 | -------------------------------------------------------------------------------- /AtCoder/ABC070/C3.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc070/submissions/15459532 3 | -} 4 | main :: IO () 5 | main = interact $ show . foldr1 lcm . tail . map read . words 6 | -------------------------------------------------------------------------------- /AtCoder/ABC081/A.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc081/tasks/abc081_a 2 | let fa: string -> int = Seq.sumBy (fun x -> if x = '1' then 1 else 0) 3 | 4 | //for i in [| "101"; "000" |] do fa i |> printfn "%d" 5 | 6 | [] 7 | let main argv = 8 | stdin.ReadLine() |> fa |> printfn "%d" 9 | 0 10 | -------------------------------------------------------------------------------- /AtCoder/ABC081/A.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/abc081/tasks/abc081_a 2 | print(sum(map(int, input()))) 3 | -------------------------------------------------------------------------------- /AtCoder/ABC081/B.py: -------------------------------------------------------------------------------- 1 | 2 | # https://atcoder.jp/contests/abs/submissions/14323299 3 | input() 4 | A = list(map(int, input().split())) 5 | count = 0 6 | 7 | while all(a % 2 == 0 for a in A): 8 | A = [a/2 for a in A] 9 | count += 1 10 | print(count) 11 | -------------------------------------------------------------------------------- /AtCoder/ABC081/B1.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc081/submissions/12307380 2 | // シンプルでいい 3 | let rec f x = if x % 2 = 0 then 1 + f (x / 2) else 0 4 | 5 | [] 6 | let main argv = 7 | stdin.ReadLine() |> ignore 8 | stdin.ReadLine().Split() 9 | |> Array.map (int >> f) 10 | |> Array.min 11 | |> printfn "%d" 12 | 0 13 | -------------------------------------------------------------------------------- /AtCoder/ABC084/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc084/submissions/15246801 2 | main :: IO () 3 | main = interact $ g . map read . tail . words where 4 | g (c:s:f:l) = shows ((s+c)#l) "\n" ++ g l 5 | g _ = "0" 6 | t # (c:s:f:l) = (div (max t s+f-1) f * f + c) # l 7 | t # _ = t 8 | -------------------------------------------------------------------------------- /AtCoder/ABC084/C_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc084/submissions/1930735 2 | import Control.Monad ( replicateM ) 3 | import Data.List ( tails ) 4 | 5 | main :: IO () 6 | main = readLn 7 | >>= flip replicateM (map read . words <$> getLine) . subtract 1 8 | >>= mapM_ (print . foldl (\t [c,s,f] -> c + max s (f * div (t + f - 1) f)) 0) . tails 9 | -------------------------------------------------------------------------------- /AtCoder/ABC086/A.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/ABC086/tasks/abc086_a 2 | stdin.ReadLine().Split(' ') 3 | |> Array.map int 4 | |> Array.reduce (*) 5 | |> fun x -> if x % 2 = 0 then "Even" else "Odd" 6 | |> printfn "%s" 7 | -------------------------------------------------------------------------------- /AtCoder/ABC086/A.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/abc086/tasks/abc086_a 2 | a, b = map(int, input().split()) 3 | print("Even" if a*b % 2 == 0 else "Odd") 4 | -------------------------------------------------------------------------------- /AtCoder/ABC099/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc099/submissions/9848419 2 | main :: IO () 3 | main = do 4 | n <- readLn 5 | print $ minimum [f i 6 + f (n-i) 9 | i <- [0..n]] 6 | 7 | f :: Integral p => p -> p -> p 8 | f 0 k = 0 9 | f n k = mod n k + f (div n k) k 10 | -------------------------------------------------------------------------------- /AtCoder/ABC099/C_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc099/submissions/2981662 2 | radixConvert :: Integral t => t -> t -> [t] 3 | radixConvert b n 4 | | n < b = [n] 5 | | otherwise = mod n b : radixConvert b (div n b) 6 | 7 | main :: IO () 8 | main = do 9 | n <- readLn 10 | print $ minimum [sum (radixConvert 6 i) + sum (radixConvert 9 (n-i))| i<-[0..n]] 11 | -------------------------------------------------------------------------------- /AtCoder/ABC099/C_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc099/submissions/2698906 2 | adicI :: Int -> Int -> Int 3 | adicI i n = if n < i then n else mod n i + adicI i (div n i) 4 | 5 | solver :: Int -> Int 6 | solver n = minimum [adicI 6 (n-i) + adicI 9 i | i <- [0..n]] 7 | 8 | main :: IO() 9 | main = readLn >>= print . solver 10 | -------------------------------------------------------------------------------- /AtCoder/ABC102/C_fs_01.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc102/submissions/2823883 2 | let n = int(stdin.ReadLine()) 3 | let a = stdin.ReadLine().Split(' ') |> Array.mapi (fun i s -> int64(int(s)-i-1)) 4 | let b = a |> Seq.sort |> Seq.item (n/2) 5 | a |> Seq.sumBy (fun x -> abs(x-b)) |> stdout.WriteLine 6 | -------------------------------------------------------------------------------- /AtCoder/ABC102/C_fs_02.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc102/submissions/2783376 2 | let n = int (stdin.ReadLine()) 3 | let a = stdin.ReadLine().Split() |> Array.mapi (fun i x -> int64 x - int64 i - 1L) |> Array.sort 4 | let b = if n % 2 = 0 then (a.[n / 2] + a.[n / 2 - 1]) / 2L else a.[n / 2] 5 | printfn "%d" (Array.sumBy (fun x -> abs (x - b)) a) 6 | -------------------------------------------------------------------------------- /AtCoder/ABC105/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc105/submissions/9848463 2 | main :: IO () 3 | main = do 4 | n <- readLn 5 | putStrLn $ if n==0 then "0" else f n 6 | 7 | f :: (Integral a, Show a) => a -> [Char] 8 | f 0 = "" 9 | f k = f ((k `mod` 2-k) `div` 2) ++ show (k `mod` 2) 10 | -------------------------------------------------------------------------------- /AtCoder/ABC105/C_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc105/submissions/3139310 2 | cvt :: (Show a, Integral a) => a -> [Char] 3 | cvt n = if n==0 then "0" else csub n 4 | 5 | csub :: (Show a, Integral a) => a -> [Char] 6 | csub 0 = "" 7 | csub n = let (q, r) = divMod n 2 in csub (-q) ++ show r 8 | 9 | main :: IO () 10 | main = readLn >>= putStrLn . cvt 11 | -------------------------------------------------------------------------------- /AtCoder/ABC107/B_lisp_02.lisp: -------------------------------------------------------------------------------- 1 | #| 2 | https://atcoder.jp/contests/abc107/submissions/24640958 3 | |# 4 | -------------------------------------------------------------------------------- /AtCoder/ABC107/B_lisp_03.lisp: -------------------------------------------------------------------------------- 1 | #| 2 | https://atcoder.jp/contests/abc107/submissions/23361179 3 | |# 4 | 5 | -------------------------------------------------------------------------------- /AtCoder/ABC107/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc107/submissions/7355173 2 | main :: IO () 3 | main = interact $ show . f . map read . words where 4 | f(_:k:l) = minimum . zipWith (%) l $ drop (k-1) l 5 | f _ = error "not come here" 6 | x%y | x>0 = y 7 | | y<0 = negate x 8 | | 0<1 = min(-x)y-x+y 9 | | otherwise = error "not come here" 10 | -------------------------------------------------------------------------------- /AtCoder/ABC110/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc110/submissions/12928553 2 | import Data.List ( group, sort ) 3 | 4 | main :: IO () 5 | main = do 6 | s <- getLine 7 | t <- getLine 8 | putStrLn $ if sort (f (sort s)) == sort (f (sort t)) then "Yes" else "No" 9 | where f s = map length (group s) 10 | -------------------------------------------------------------------------------- /AtCoder/ABC112/D_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc112/submissions/28109007 2 | use proconio::input; 3 | 4 | fn main() { 5 | input!{ 6 | n: usize, 7 | m: usize, 8 | } 9 | 10 | for i in (1..=m/n).rev() { 11 | if m % i != 0 { continue; } 12 | println!("{}", i); 13 | break; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /AtCoder/ABC114/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc114/submissions/4563366 2 | main :: IO () 3 | main = do 4 | n <- readLn 5 | print $ sum [1 | i<-[2..9], l<-mapM (const "753") [0..i], all (`elem` l) "753", read l < n+1] 6 | -------------------------------------------------------------------------------- /AtCoder/ABC115/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc115/submissions/17146340 2 | import Data.Bits ( Bits(shift) ) 3 | main :: IO () 4 | main = print . (\[n,x] -> f n x) . map read . words =<< getLine 5 | f 0 x = min 1 x 6 | f n x 7 | | x <=n = 0 8 | | x getLine :: IO Int 5 | xs <- map read . words <$> getLine :: IO [Int] 6 | print $ solve xs 7 | 8 | solve = f 0 9 | where 10 | f acc [] = 0 11 | f acc (h:hs) = max (h-acc) 0 + f h hs 12 | -------------------------------------------------------------------------------- /AtCoder/ABC116/C4.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc116/submissions/10737716 2 | main :: IO() 3 | main = do 4 | getLine 5 | hn <- map read . words <$> getLine 6 | print $ solve hn 7 | 8 | solve :: (Ord a, Num a) => [a] -> a 9 | solve hn = 10 | foldl (\ans (prev, next) -> if prev < next then ans+next-prev else ans) 0 $ zip (0:init hn) hn 11 | -------------------------------------------------------------------------------- /AtCoder/ABC118/C2.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc118/submissions/4554091 3 | -} 4 | import Data.Maybe (fromJust) 5 | import qualified Data.ByteString.Char8 as C8 6 | main :: IO () 7 | main = do 8 | _ <- getLine 9 | as <- fmap (map (fst . fromJust . C8.readInt) . C8.words) C8.getLine 10 | print $ foldl1 gcd as 11 | -------------------------------------------------------------------------------- /AtCoder/ABC118/C4.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc118/submissions/9848341 3 | -} 4 | main=getLine>>getLine>>=print.foldl1 gcd.map read.words 5 | -------------------------------------------------------------------------------- /AtCoder/ABC121/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc121/submissions/4521830 2 | import Foreign ( Bits(xor) ) 3 | main :: IO () 4 | main = interact $ show. f . (\[a,b] -> (a,b)) . map read . words where 5 | f (a,b) = g b `xor` g(a-1) 6 | where g x = [x,1,x+1,0] !! mod x 4 7 | -------------------------------------------------------------------------------- /AtCoder/ABC121/D_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc121/submissions/27303883 2 | use proconio::input; 3 | 4 | fn main() { 5 | input!{ a: u64, b: u64, } 6 | let mut ans = 0; 7 | for i in a..(a+4)/4*4 { ans ^= i; } 8 | for i in b/4*4..=b { ans ^= i; } 9 | println!("{}", ans); 10 | } 11 | -------------------------------------------------------------------------------- /AtCoder/ABC123/C2.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc123/submissions/25840682 3 | -} 4 | main :: IO () 5 | main = interact $ show . f . map read . words where 6 | f (n:l) | m <- minimum l = div (n+m-1) m+4 7 | f _ = error "not come here" 8 | -------------------------------------------------------------------------------- /AtCoder/ABC123/C3.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc123/submissions/4871559 3 | -} 4 | main :: IO () 5 | main = do 6 | n <- readLn 7 | x <- minimum . map read . lines <$> getContents 8 | print $ (n+x-1) `div` x + 4 9 | -------------------------------------------------------------------------------- /AtCoder/ABC125/D_fs_00.fsi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phasetr/AlgorithmsAndDataStructureByFSharp/82ff528a427c83eb05e0af206a2a4633a57681d2/AtCoder/ABC125/D_fs_00.fsi -------------------------------------------------------------------------------- /AtCoder/ABC125/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc125/submissions/9712662 2 | import Data.List ( sort ) 3 | main :: IO () 4 | main = do 5 | n <- getLine 6 | a <- map read . words <$> getLine 7 | print $ sum $ 8 | if even (length (filter (<0) a)) then map abs a 9 | else (\(l:a) -> (-1*l):a) (sort (map abs a)) 10 | -------------------------------------------------------------------------------- /AtCoder/ABC130/C3.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc130/submissions/19753409 3 | -} 4 | main :: IO () 5 | main = interact $ solve . map read . words 6 | 7 | solve :: (Show a, Fractional a, Eq a) => [a] -> String 8 | solve [w,h,x,y] = show(w*h/2) ++ 9 | if w==x*2 && h==y*2 then" 1"else" 0" 10 | solve _ = error "not come here" 11 | -------------------------------------------------------------------------------- /AtCoder/ABC133/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc133/submissions/9857855 2 | main :: IO () 3 | main = interact $ unwords . init . f . map read . words 4 | f :: (Show a, Num a) => [a] -> [String] 5 | f (_:l) = show <$> scanr ((-) . (*2)) (foldr1 (-) l) l 6 | f _ = error "not come here" 7 | -------------------------------------------------------------------------------- /AtCoder/ABC133/D_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc133/submissions/24844014 2 | main :: IO () 3 | main = do 4 | n <- readLn 5 | as <- map read . words <$> getLine 6 | putStrLn . unwords . map show $ solve n as 7 | 8 | solve :: Int -> [Int] -> [Int] 9 | solve n as = scanl (\acc x -> 2*x - acc) x1 $ take (n-1) as 10 | where x1 = sum $ zipWith (*) as (cycle [1,-1]) 11 | -------------------------------------------------------------------------------- /AtCoder/ABC137/C2.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc137/submissions/25865432 3 | -} 4 | import Data.List (group,sort) 5 | import Control.Monad (ap,replicateM) 6 | 7 | main :: IO () 8 | main = readLn >>= flip replicateM getLine >>= print . solve 9 | 10 | solve :: [String] -> Int 11 | solve = sum . map ((`div`2) . ap (*) (-1+) . length) . group . sort . map sort 12 | -------------------------------------------------------------------------------- /AtCoder/ABC139/B0.md: -------------------------------------------------------------------------------- 1 | # README 2 | - 3 | 4 | B 口以上になるまで電源タップを 1 つずつ使うシミュレーションをすればよく, 5 | 最初差込口を 1 口として差込口が B 口未満である間, 6 | 電源タップ 1 つ と差込口 1 口を使って差込口を A 口増やす. 7 | 8 | 他には電源タップを 1 つ使うごとに差込口が A − 1 口増え, 9 | 最終的に初期状態から B − 1 口増やしたいと考えれば, 10 | 答えは ⌈ (B−1)/(A-1) ⌉ (B − 1 を A − 1 で割った切り上げ) になる. 11 | -------------------------------------------------------------------------------- /AtCoder/ABC139/B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc139/submissions/17894630 2 | main :: IO () 3 | main = do 4 | [a,b] <- map read.words<$>getLine 5 | print $ ceiling $ (b-1)/(a-1) 6 | -------------------------------------------------------------------------------- /AtCoder/ABC139/B_js_01.js: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc139/submissions/32143995 2 | function solve(a,b){ 3 | return Math.ceil((b-1)/(a-1)); 4 | } 5 | const [[a,b]]=require("fs").readFileSync("/dev/stdin","utf8").trim().split("\n") 6 | .map(i=>i.trim().split(/\s+/).map(i=>isNaN(i)?i:i-0)); 7 | console.log(solve(a,b)); 8 | -------------------------------------------------------------------------------- /AtCoder/ABC139/B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc139/submissions/16571286 *) 2 | let rec solve target now ans x = 3 | if target <= now then ans else solve target (now-1+x) (ans+1) x;; 4 | let () = 5 | Scanf.scanf "%d %d\n" @@ 6 | fun a b -> Printf.printf "%d\n" (solve b 1 0 a) 7 | -------------------------------------------------------------------------------- /AtCoder/ABC139/B_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc139/submissions/15658199 *) 2 | let solve a b = (b - 1 + a - 2) / (a - 1);; 3 | let () = Scanf.scanf "%d %d" @@ 4 | fun a b -> Printf.printf "%d\n" (solve a b) 5 | -------------------------------------------------------------------------------- /AtCoder/ABC139/B_ml_03.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc139/submissions/7446056 *) 2 | let solve a b = ((b-1)+a-2) / (a-1);; 3 | let a,b = Scanf.scanf " %d %d" (fun a b -> a, b);; 4 | let () = Printf.printf "%d\n" (solve a b) 5 | -------------------------------------------------------------------------------- /AtCoder/ABC140/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc140/submissions/7415000 2 | main :: IO () 3 | main = interact $ show . f . words 4 | 5 | f :: (Num a, Read a, Ord a) => [String] -> a 6 | f [n,k,s] = read n - max (g s-2*read k) 1 7 | f _ = error "not come here" 8 | 9 | g :: (Num p, Eq a) => [a] -> p 10 | g (x:y:l) = sum [1 | x/=y] + g (y:l) 11 | g _=1 12 | -------------------------------------------------------------------------------- /AtCoder/ABC140/D_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc140/submissions/16510638 2 | main :: IO () 3 | main = do 4 | [n, k] <- map read . words <$> getLine 5 | ds <- getContents 6 | let s = length . filter id . (zipWith (==) <$> id <*> tail) $ ds 7 | print $ (s + 2 * k) `min` (n - 1) 8 | -------------------------------------------------------------------------------- /AtCoder/ABC140/D_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc140/submissions/26852270 2 | use proconio::marker::*; 3 | use proconio::*; 4 | fn main() { 5 | input! {n: usize,k: usize,s: Bytes} 6 | println!("{}",(n - 1).min((0..n - 1).filter(|&i| s[i] == s[i + 1]).count() + 2 * k)); 7 | } 8 | -------------------------------------------------------------------------------- /AtCoder/ABC142/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc142/submissions/9857049 2 | import Data.List ( nub ) 3 | main :: IO () 4 | main = do 5 | [a,b]<-map read.words<$>getLine 6 | let x=gcd a b 7 | print$(1+)$length$nub$f 2 x 8 | f :: Integral a => a -> a -> [a] 9 | f p x 10 | |x==1=[] 11 | |p*p>x=[x] 12 | |x`mod`p==0=p:f p(div x p) 13 | |otherwise=f(p+1)x 14 | -------------------------------------------------------------------------------- /AtCoder/ABC144/D02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc144/submissions/24978048 2 | main :: IO () 3 | main = do 4 | [a,b,x] <- map read . words <$> getLine 5 | let r2d x = x * 180 / pi 6 | print $ if x <= a^2*b / 2 7 | then r2d $ atan (a * b^2 / 2 / x) 8 | else r2d $ atan $ 2 * (a^2 * b - x) / (a^3) 9 | -------------------------------------------------------------------------------- /AtCoder/ABC144/D04.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc144/submissions/9856954 2 | main :: IO () 3 | main = getLine >>= 4 | print . solve . (\[a,b,x] -> (a,b,x)) . map read . words 5 | 6 | solve :: RealFloat a => (a, a, a) -> a 7 | solve (a,b,x) = (57.2958*) 8 | $ flip atan2 (a/b) $ if 1 int64 3 | 4 | let rec pre x = (if x < 1L then 1L else 5L * pre (x - 1L)) 5 | let p x = 2L * (pre x) 6 | 7 | let ans = [for i in 1L..25L -> (n / (p i))] |>List.sum 8 | 9 | if (n % 2L) = 0L then ans else 0L 10 | |>stdout.WriteLine 11 | -------------------------------------------------------------------------------- /AtCoder/ABC148/E_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc148/submissions/18899811 2 | main :: IO () 3 | main = print . solve =<< readLn 4 | solve :: Integral p => p -> p 5 | solve n = if odd n then 0 else sum.map(div m).takeWhile(m>=)$iterate(*5)5 where m=div n 2 6 | -------------------------------------------------------------------------------- /AtCoder/ABC148/E_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc148/submissions/13411405 2 | main :: IO () 3 | main = do 4 | n <- readLn 5 | print $ if odd n then 0 else sum . map (n `div`) . takeWhile (<= n) $ map (\i -> 2*5^i) [1..] 6 | -------------------------------------------------------------------------------- /AtCoder/ABC148/E_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc148/submissions/14663083 2 | main :: IO () 3 | main = do 4 | x <- readLn 5 | case divMod x 2 of 6 | (_, 1) -> print 0 7 | (q, 0) -> print $ sum [div q (5 ^ i)|i<-[1..64]] 8 | _ -> error "not come here" 9 | -------------------------------------------------------------------------------- /AtCoder/ABC148/E_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc148/submissions/9691302 *) 2 | let n = read_int () 3 | let rec f n s p = if n / p = 0 then s else f n (s + n / p) (p * 5) 4 | let _ = Printf.printf "%d\n" @@ if n mod 2 = 1 then 0 else f (n / 2) 0 5 5 | -------------------------------------------------------------------------------- /AtCoder/ABC148/E_ml_02.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc148/submissions/9088873 *) 2 | let rec calc d x = if x < d then 0 else x / d + calc d (x / d) 3 | let solve n = 4 | if n mod 2 = 1 then 0 5 | else min (calc 2 n) (calc 5 (n/2)) 6 | let _ = Scanf.scanf "%d" solve |> Printf.printf "%d\n" 7 | -------------------------------------------------------------------------------- /AtCoder/ABC148/E_ml_03.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc148/submissions/12557519 *) 2 | let id x = x 3 | let n = Scanf.scanf "%d\n" id 4 | let rec f = function 5 | | i when i * 2 > n -> [] 6 | | i -> (n / i / 2) :: f (i * 5) 7 | let () = print_int @@ if n mod 2 = 1 then 0 else List.fold_left (+) 0 (f 5) 8 | -------------------------------------------------------------------------------- /AtCoder/ABC153/D2.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open System 3 | open System.IO 4 | open FsUnit 5 | 6 | let rec solve = function 7 | | 1L -> 1L 8 | | n -> 2L * solve (n/2L) + 1L 9 | 10 | solve 2L |> should equal 3L 11 | solve 3L |> should equal 3L 12 | solve 4L |> should equal 7L 13 | solve 1000000000000L |> should equal 1099511627775L 14 | -------------------------------------------------------------------------------- /AtCoder/ABC156/C0.md: -------------------------------------------------------------------------------- 1 | # README 2 | - 3 | -------------------------------------------------------------------------------- /AtCoder/ABC156/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc156/submissions/25143420 2 | main :: IO() 3 | main = (getLine >> getLine) >>= (print . solve . map read . words) 4 | 5 | solve :: [Int] -> Int 6 | solve xs = minimum $ map (step xs) [1..pMax] where 7 | step xs p = foldl (\acc x -> acc + (x-p)^2 ) 0 xs 8 | pMax = 100 9 | -------------------------------------------------------------------------------- /AtCoder/ABC161/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc161/submissions/16303119 2 | main :: IO () 3 | main = readLn >>= print . (a!!) . pred 4 | where a = [1..9]++(a >>= (\n -> map (10*n+) [max (n `mod` 10 - 1) 0..min(n `mod` 10+1) 9])) 5 | -------------------------------------------------------------------------------- /AtCoder/ABC161/D_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc161/submissions/11572825 2 | main :: IO () 3 | main = readLn >>= print . (lnum!!) . pred 4 | lnum :: [Integer] 5 | lnum = [1..9] ++ [10*x+a | x <- lnum, let r = mod x 10, a <- [r-1 .. r+1], 0 <= a, a <= 9] 6 | -------------------------------------------------------------------------------- /AtCoder/ABC169/A.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc169/tasks/abc169_a 2 | let aTest = [| [| "2"; "5" |]; [| "100"; "100" |] |] 3 | let aAns = [| 10; 10000 |] 4 | 5 | let fa: string [] -> int = Array.map int >> Array.fold (*) 1 6 | 7 | Array.map2 (=) (aTest |> Array.map fa) aAns 8 | 9 | let main = 10 | stdin.ReadLine().Split(' ') |> fa |> printfn "%d" 11 | -------------------------------------------------------------------------------- /AtCoder/ABC169/F1.txt: -------------------------------------------------------------------------------- 1 | 3 4 2 | 2 2 4 3 | -------------------------------------------------------------------------------- /AtCoder/ABC169/F2.txt: -------------------------------------------------------------------------------- 1 | 5 8 2 | 9 9 9 9 9 3 | -------------------------------------------------------------------------------- /AtCoder/ABC169/F3.txt: -------------------------------------------------------------------------------- 1 | 10 10 2 | 3 1 4 1 5 9 2 6 5 3 3 | -------------------------------------------------------------------------------- /AtCoder/ABC170/A.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc170/tasks/abc170_b 2 | let s = [| 1; 0; 3; 4; 5 |] 3 | s |> Array.findIndex (fun x -> x = 0) 4 | 5 | [] 6 | let main argv = 7 | let s = stdin.ReadLine().Split(' ') |> Array.map int 8 | let num = s |> Array.findIndex (fun x -> x = 0) 9 | printfn "%d" (num + 1) 10 | 0 11 | -------------------------------------------------------------------------------- /AtCoder/ABC171/A.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc171/tasks/abc171_a 2 | open System 3 | 4 | [] 5 | let main argv = 6 | stdin.ReadLine() |> char 7 | |> fun x -> if Char.IsUpper x then "A" else "a" 8 | |> printfn "%s" 9 | 0 10 | -------------------------------------------------------------------------------- /AtCoder/ABC172/A.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc172/tasks/abc172_a 2 | [] 3 | let main argv = 4 | stdin.ReadLine() 5 | |> int 6 | |> fun x -> x + x*x + x*x*x 7 | |> printfn "%d" 8 | 0 9 | -------------------------------------------------------------------------------- /AtCoder/ABC172/CSample1.txt: -------------------------------------------------------------------------------- 1 | 3 4 240 2 | 60 90 120 3 | 80 150 80 150 4 | -------------------------------------------------------------------------------- /AtCoder/ABC172/CSample2.txt: -------------------------------------------------------------------------------- 1 | 3 4 730 2 | 60 90 120 3 | 80 150 80 150 4 | -------------------------------------------------------------------------------- /AtCoder/ABC172/CSample3.txt: -------------------------------------------------------------------------------- 1 | 5 4 1 2 | 1000000000 1000000000 1000000000 1000000000 1000000000 3 | 1000000000 1000000000 1000000000 1000000000 4 | -------------------------------------------------------------------------------- /AtCoder/ABC173/A.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc173/tasks/abc173_a 2 | let solve n = (10000 - n) % 1000 3 | //solve 1900 4 | //solve 3000 5 | 6 | [] 7 | let main argv = 8 | stdin.ReadLine() |> int |> solve |> printfn "%d" 9 | 0 10 | -------------------------------------------------------------------------------- /AtCoder/AGC003/B_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc003/submissions/3123170 2 | import Data.List ( groupBy ) 3 | 4 | main :: IO() 5 | main = do 6 | n <- readLn :: IO Int 7 | as <- map read . lines <$> getContents :: IO [Integer] 8 | print $ (sum . map ((`div` 2) . sum) . filter (notElem 0) . groupBy (\a b -> a /= 0 && b /= 0)) as 9 | -------------------------------------------------------------------------------- /AtCoder/AGC005/A_fs_01.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/agc005/submissions/36529108 2 | let x = stdin.ReadLine() 3 | 4 | x 5 | |> Seq.fold 6 | (fun (s, len) -> 7 | function 8 | | 'S' -> (s + 1, len) 9 | | 'T' when s > 0 -> (s - 1, len - 2) 10 | | _ -> (s, len)) 11 | (0, x.Length) 12 | |> snd 13 | |> stdout.WriteLine 14 | -------------------------------------------------------------------------------- /AtCoder/AGC005/A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc005/submissions/9931696 2 | main :: IO () 3 | main = getLine >>= print . foldl (\a c -> max (a + if c=='S' then 2 else -2) 0) 0 4 | -------------------------------------------------------------------------------- /AtCoder/AGC005/A_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc005/submissions/912035 2 | --f :: Num a => [Char] -> [Char] -> a -> a 3 | f :: String -> String -> Int -> Int 4 | f [] _ n = n 5 | f ('T':x) ('S':y) n = f x y (n-1) 6 | f (c:x) y n = f x (c:y) (n+1) 7 | main :: IO () 8 | main = do 9 | x <- getLine 10 | print $ f x [] 0 11 | -------------------------------------------------------------------------------- /AtCoder/AGC005/A_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc005/submissions/13692043 2 | main :: IO () 3 | main = do 4 | x <- getLine 5 | let (s,t) = foldl solve (0,0) x 6 | print $ s + t 7 | 8 | solve :: (Int,Int) -> Char -> (Int,Int) 9 | solve (s,t) x 10 | | x == 'S' = (s+1,t) 11 | | s == 0 = (s,t+1) 12 | | otherwise = (s-1,t) 13 | -------------------------------------------------------------------------------- /AtCoder/AGC007/A3.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/agc007/submissions/19514646 3 | -} 4 | import Data.Bool (bool) 5 | 6 | main :: IO () 7 | main = do 8 | [h,w] <- map read . words <$> getLine 9 | xs <- getContents 10 | putStrLn (bool "Impossible" "Possible" (length (filter (== '#') xs) == (h+w-1))) 11 | -------------------------------------------------------------------------------- /AtCoder/AGC007/A4.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/agc007/submissions/17183789 3 | -} 4 | import Data.Bool (bool) 5 | main :: IO () 6 | main = putStrLn . bool "Impossible" "Possible" =<< f . map read . words =< IO Bool 9 | f [h,w] = (== h+w-1) . length . filter (=='#') <$> getContents 10 | f _ = error "not come here" 11 | -------------------------------------------------------------------------------- /AtCoder/AGC008/A5.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/agc008/submissions/9931736 3 | -} 4 | main :: IO () 5 | main = do 6 | [a,b] <- map read . words <$> getLine 7 | print $ (+1) $ minimum $ abs <$> [a+b,b-a-1] 8 | -------------------------------------------------------------------------------- /AtCoder/AGC014/B_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc014/submissions/1264660 2 | import Data.Bool ( bool ) 3 | import Data.List ( group, sort ) 4 | 5 | main :: IO () 6 | main = do 7 | getLine 8 | ls <- map length . group . sort . words <$> getContents 9 | putStrLn $ bool "NO" "YES" (all even ls) 10 | -------------------------------------------------------------------------------- /AtCoder/AGC017/A3.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/agc017/submissions/1409115 3 | -} 4 | import Data.List.Split 5 | main = mapM_ (print . solve) . chunksOf 2. map (map read . words) . lines =<< getContents 6 | solve [[n, p], as] = 2^e * max (1-p) (2^o `div` 2) 7 | where [e,o] = map (length . flip filter as) [even,odd] 8 | -------------------------------------------------------------------------------- /AtCoder/AGC018/A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc018/submissions/9931828 2 | main :: IO () 3 | main = do 4 | [n,k] <- map read . words <$> getLine 5 | a <- map read . words <$> getLine 6 | putStr $ if k>maximum a || k `mod` foldl1 gcd a > 0 then "IM" else "" 7 | putStrLn "POSSIBLE" 8 | -------------------------------------------------------------------------------- /AtCoder/AGC018/A_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc018/submissions/1450039 2 | main :: IO () 3 | main = getContents >>= putStrLn . solve . map read . words 4 | 5 | solve :: [Int] -> String 6 | solve (n:k:a:as) = if any (\a -> k <= a && (a - k) `mod` d == 0) (a:as) then "POSSIBLE" else "IMPOSSIBLE" 7 | where d = foldl gcd a as 8 | solve _ = error "not come here" 9 | -------------------------------------------------------------------------------- /AtCoder/AGC031/A02.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/agc031/submissions/13928890 3 | -} 4 | import Data.List (foldl',group,sort) 5 | main :: IO () 6 | main = do 7 | getLine 8 | s <- getLine 9 | print $ solve s 10 | 11 | solve :: String -> Int 12 | solve s = pred . foldl' (\a x -> (a*x) `mod` 1000000007) 1 13 | $ map (succ . length) (group (sort s)) 14 | -------------------------------------------------------------------------------- /AtCoder/AGC034/B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc034/submissions/17495339 2 | main :: IO () 3 | main = print . f 0 0 =<< getLine 4 | f :: Num p => p -> p -> [Char] -> p 5 | f i k ('B':'C':s) = f (i+k) k s 6 | f i k (c:s) = f i (if c=='A' then k+1 else 0) s 7 | f i _ _ = i 8 | -------------------------------------------------------------------------------- /AtCoder/AGC035/A03.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/agc035/submissions/6371774 3 | -} 4 | import Data.Bits (Bits(xor)) 5 | 6 | main :: IO () 7 | main = getLine >> getLine >>= putStrLn . solve 8 | . map read . words 9 | 10 | solve :: [Int] -> String 11 | solve as = if foldl1 xor as == 0 then "Yes" else "No" 12 | -------------------------------------------------------------------------------- /AtCoder/AGC036/A_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | let S = 3L 5 | let solve (S:int64) = 6 | let K = 1_000_000_000L 7 | let x = (K - (S%K))%K 8 | let y = (S+x)/K 9 | sprintf "0 0 1000000000 1 %d %d" x y 10 | let S = stdin.ReadLine() |> int64 11 | solve S |> stdout.WriteLine 12 | 13 | solve 3L 14 | solve 100L 15 | solve 311114770564041497L 16 | -------------------------------------------------------------------------------- /AtCoder/AGC036/A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc036/submissions/14160402 2 | main = do 3 | s <- readLn :: IO Int 4 | let x = (10^9 - (s `mod` 10^9)) `mod` 10^9 5 | y = (s + x) `div` 10^9 6 | putStrLn $ "0 0 1000000000 1 " ++ show x ++ " " ++ show y 7 | -------------------------------------------------------------------------------- /AtCoder/AGC036/A_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/agc036/submissions/30797816 2 | use proconio::{input}; 3 | 4 | fn main() { 5 | input! {s:u64} 6 | let m = (s as f64).sqrt().ceil() as u64; 7 | println!("0 0 {} {} 1 {}",m,m*m-s,m); 8 | } 9 | -------------------------------------------------------------------------------- /AtCoder/AGC045/B.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/agc045/tasks/agc045_b -------------------------------------------------------------------------------- /AtCoder/AGC046/B.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/agc046/tasks/agc046_b 2 | -------------------------------------------------------------------------------- /AtCoder/AGC048/A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/agc038/submissions/7647149 2 | import Control.Monad ( replicateM_ ) 3 | 4 | main = do 5 | [h,w,a,b] <- map read . words <$> getLine 6 | replicateM_ b $ putStrLn $ replicate a '0' ++ replicate (w-a) '1' 7 | replicateM_ (h-b) $ putStrLn $ replicate a '1' ++ replicate (w-a) '0' 8 | -------------------------------------------------------------------------------- /AtCoder/APC001/B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/apc001/submissions/10334375 2 | main = do 3 | getLine 4 | a <- map read . words <$> getLine 5 | b <- map read . words <$> getLine 6 | let u = zipWith (-) b a 7 | let s = sum u 8 | putStrLn $ if s < negate (sum $ filter (<0) u ) || s < sum (map (flip div 2 . (1+)) $ filter (>0) u) then "No" else "Yes" 9 | -------------------------------------------------------------------------------- /AtCoder/ARC059/A02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/arc059/submissions/11983527 2 | main :: IO () 3 | main = getLine >> getLine 4 | >>= print . solve . map read . words 5 | solve :: [Int] -> Int 6 | solve as = minimum [sum $ map ((^2) . (b -)) as | b <- [-100..100]] 7 | -------------------------------------------------------------------------------- /AtCoder/ARC059/A03.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/arc059/submissions/1550300 3 | -} 4 | main :: IO () 5 | main = do 6 | getLine 7 | as <- map read . words <$> getLine 8 | print $ minimum [sum [(a-x)^2 | a <- as] | x <- [-100..100]] 9 | -------------------------------------------------------------------------------- /AtCoder/ARC061/A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc045/submissions/16276641 2 | import Control.Monad ( foldM ) 3 | main :: IO () 4 | main = getLine >>= 5 | (\(x:y) -> print $ sum $ concat $ foldM (\[a,t] c -> [[a+t,c],[a,10*t+c]]) [0,x] y) 6 | . map (read . pure) 7 | -------------------------------------------------------------------------------- /AtCoder/ARC061/A_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc045/submissions/16274977 2 | import Control.Monad ( foldM ) 3 | main = do 4 | (x:xs) <- map (read . pure) <$> getLine 5 | print $ sum $ map (uncurry (+)) $ foldM (\(acc,top) cur -> [(acc+top,cur),(acc,10*top+cur)]) (0,x) xs 6 | -------------------------------------------------------------------------------- /AtCoder/ARC063/A02.fsx: -------------------------------------------------------------------------------- 1 | @"https://atcoder.jp/contests/abc047/submissions/28257282" 2 | #r "nuget: FsUnit" 3 | open FsUnit 4 | 5 | let solve = Seq.pairwise >> Seq.filter (<>) >> Seq.length 6 | let S = stdin.ReadLine() 7 | solve S |> stdout.WriteLine 8 | 9 | solve "BBBWW" |> should equal 1 10 | solve "WWWWWW" |> should equal 0 11 | solve "WBWBWBWBWB" |> should equal 9 12 | -------------------------------------------------------------------------------- /AtCoder/ARC063/A03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc047/submissions/30161397 2 | import qualified Data.ByteString.Char8 as BS 3 | main :: IO () 4 | main = do 5 | s <- BS.getLine 6 | print $ solve s 7 | 8 | solve :: BS.ByteString -> Int 9 | solve s = length $ filter id $ BS.zipWith (/=) s $ BS.tail s 10 | -------------------------------------------------------------------------------- /AtCoder/ARC063/A04.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc047/submissions/21601143 3 | -} 4 | import Data.List (group) 5 | 6 | main :: IO () 7 | main = do 8 | s <- getLine 9 | print $ solve s 10 | solve :: String -> Int 11 | solve s = length (map head $ group s) - 1 12 | -------------------------------------------------------------------------------- /AtCoder/ARC063/A05.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc047/submissions/16026060 3 | -} 4 | import Data.List (group) 5 | main :: IO () 6 | main = getLine >>= print . pred . length . group 7 | -------------------------------------------------------------------------------- /AtCoder/ARC067/B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc052/submissions/11072894 2 | main :: IO () 3 | main = interact $ show . sol . fmap get . lines 4 | 5 | get :: String -> [Integer] 6 | get = fmap read . words 7 | 8 | sol :: (Num c, Ord c) => [[c]] -> c 9 | sol [[n,a,b],xs] = sum . fmap (min b . (*a)) $ zipWith (-) (tail xs) xs 10 | sol _ = error "not come here" 11 | -------------------------------------------------------------------------------- /AtCoder/ARC068/A02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/arc068/submissions/25084530 2 | main :: IO () 3 | main = readLn >>= print 4 | . (\x -> x `quot` 11*2 + quot (rem x 11+5) 6) 5 | -------------------------------------------------------------------------------- /AtCoder/ARC068/A03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/arc068/submissions/12021969 2 | main = readLn >>= print.solve 3 | solve x 4 | | r == 0 = 2*q 5 | | r <= 6 = 2*q + 1 6 | | otherwise = 2*q + 2 7 | where (q, r) = divMod x 11 8 | -------------------------------------------------------------------------------- /AtCoder/ARC068/A04.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/arc068/submissions/1085353 2 | main :: IO () 3 | main = readLn >>= 4 | print . (\x -> x`div`11*2 + (x`mod`11+5)`div`6) 5 | -------------------------------------------------------------------------------- /AtCoder/ARC068/A05.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/arc068/submissions/1081945 2 | main :: IO () 3 | main = readLn >>= print . f . flip divMod 11 . pred 4 | f :: (Ord a1, Num a1, Num a2) => (a2, a1) -> a2 5 | f (q,r) 6 | | r<=5 = 2*q+1 7 | | 0<1 = 2*q+2 8 | | otherwise = error "undefined" 9 | -------------------------------------------------------------------------------- /AtCoder/ARC069/A1.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/arc069/submissions/19069862 3 | -} 4 | main :: IO () 5 | main = do 6 | [n,m] <- map read . words <$> getLine 7 | print $ solve n m 8 | 9 | solve :: Integral a => a -> a -> a 10 | solve n m = min (m `div` 2) ((n*2+m) `div` 4) 11 | 12 | test :: IO () 13 | test = print $ (solve 1 6 == 2 && solve 12345 678901 == 175897) 14 | -------------------------------------------------------------------------------- /AtCoder/ARC070/A1.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc056/submissions/23923922 3 | -} 4 | main :: IO () 5 | main = do 6 | n <- read <$> getLine 7 | print $ solve n 8 | 9 | solve :: Int -> Int 10 | solve n = head $ filter (\x -> x*(x+1) >= n*2) [1..] 11 | -------------------------------------------------------------------------------- /AtCoder/ARC070/A2.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc056/submissions/12966703 3 | -} 4 | solve :: Int -> Int 5 | solve n = length . takeWhile (< n) $ scanl (+) 0 [1..] 6 | 7 | main :: IO () 8 | main = do 9 | n <- readLn 10 | print $ solve n 11 | -------------------------------------------------------------------------------- /AtCoder/ARC070/A3.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc056/submissions/11401993 3 | -} 4 | main :: IO () 5 | main = print . ceiling . (\x -> (sqrt(8*x+1)-1)/2) =<< readLn 6 | -------------------------------------------------------------------------------- /AtCoder/ARC071/A4.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc058/submissions/15852937 3 | -} 4 | main :: IO () 5 | main = interact $ f . lines where 6 | f (_:l) = do 7 | c <- ['a'..'z'] 8 | minimum [filter (==c) s | s <- l] 9 | f _ = error "undefined" 10 | -------------------------------------------------------------------------------- /AtCoder/ARC071/A5.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc058/submissions/1866281 3 | -} 4 | import Data.List ((\\),sort) 5 | main :: IO () 6 | main = interact $ (++"\n") . sort . foldl1 (\x y -> x \\ (x \\ y)) . tail . lines 7 | -------------------------------------------------------------------------------- /AtCoder/ARC077/A5.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc066/submissions/1398254 3 | -} 4 | solve :: [a] -> [a] -> [a] -> [a] 5 | solve xs ys [] = ys ++ reverse xs 6 | solve xs ys (z:zs) = solve ys (z:xs) zs 7 | 8 | main :: IO () 9 | main = do 10 | getLine 11 | as <- getLine 12 | putStrLn $ unwords $ solve [] [] $ words as 13 | -------------------------------------------------------------------------------- /AtCoder/ARC078/A3.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/abc067/submissions/16470460 3 | -} 4 | main :: IO () 5 | main =interact $ show . f . map read . words 6 | 7 | f :: (Ord p, Num p) => [p] -> p 8 | f (_:x:l) = minimum . map abs 9 | $ zipWith (-) (scanl (+) x l) $ scanr1 (+) l 10 | f _ = error "not come here" 11 | -------------------------------------------------------------------------------- /AtCoder/ARC091/B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc090/submissions/3108580 2 | main = do 3 | (n:k:_) <- map read . words <$> getLine 4 | print $ if k==0 then n*n else sum.map (\b-> (b-k) * (n `div` b) + max ((n `mod` b)-k+1) 0) $ [k+1..n] 5 | -------------------------------------------------------------------------------- /AtCoder/ARC095/B_fs_02.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc094/submissions/24802917 2 | let N = stdin.ReadLine() |> int 3 | let A = stdin.ReadLine().Split() |> Array.map int64 |> Array.sort 4 | 5 | [|for i in A -> (i,((i |> float) / (Array.last A |> float) - 0.5) |> abs)|] 6 | |> Array.sortBy (snd) 7 | |> fun x -> 8 | printfn "%d %d" (Array.last A) (fst x.[0]) 9 | -------------------------------------------------------------------------------- /AtCoder/ARC095/B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/abc094/submissions/10051384 *) 2 | let a_s = Array.init (read_int ()) @@ fun _ -> Scanf.scanf " %d" (+) 0 3 | let h = Array.fold_left max 0 a_s 4 | let _ = Array.fold_left (fun b a -> if a < h && abs (a - h / 2) < abs (b - h / 2) then a else b) max_int a_s 5 | |> Printf.printf "%d %d\n" h 6 | -------------------------------------------------------------------------------- /AtCoder/ARC102/A_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc108/submissions/25689779 2 | main :: IO () 3 | main = interact $ show . f . map read . words 4 | f :: Integral a => [a] -> a 5 | f [n,k] | even k = ((n+k `div` 2) `div` k)^3 + (n`div`k)^3 | 0<1 = (n `div` k)^3 6 | f _ = error "not come here" 7 | -------------------------------------------------------------------------------- /AtCoder/ARC102/A_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc108/submissions/8561611 2 | main :: IO () 3 | main = do 4 | [n, k] <- map read . words <$> getLine 5 | print $ (n `div` k) ^ 3 + if even k then ((n + k `div` 2) `div` k) ^ 3 else 0 6 | -------------------------------------------------------------------------------- /AtCoder/ARC102/A_hs_03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/abc108/submissions/3118600 2 | main = do 3 | (n:k:_) <- map read . words <$> getLine 4 | print $ sol n k 5 | -- 6 | sol :: Integral a => a -> a -> a 7 | sol n k 8 | | odd k = (n `div` k)^3 9 | | otherwise = (n `div` k)^3 + ((n + (k `div` 2)) `div` k)^3 10 | -------------------------------------------------------------------------------- /AtCoder/ARC102/A_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc108/submissions/21233112 2 | use proconio::input; 3 | 4 | fn main() { 5 | input! { n: usize, k: usize }; 6 | 7 | let mut c = (n/k).pow(3); 8 | if k%2 == 0 { c += ((n+k/2)/k).pow(3) } 9 | 10 | println!("{}", c); 11 | } 12 | -------------------------------------------------------------------------------- /AtCoder/ARC102/A_rs_02.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/abc108/submissions/23522230 2 | fn main() { 3 | proconio::input! { n: i64, k: i64, }; 4 | let modk = n/k; 5 | let modkhalf = if k % 2 == 0 {n/(k/2)-n/k} else {0}; 6 | let ans = modk.pow(3) + modkhalf.pow(3); 7 | println!("{}", ans); 8 | } 9 | -------------------------------------------------------------------------------- /AtCoder/CODEFESTIVAL2016final/B03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/cf16-final/submissions/12966831 2 | import Data.List (partition) 3 | 4 | main = do 5 | n <- readLn 6 | let (ts, ds) = partition (< n) $ scanl (+) 0 [1..n] 7 | let l = length ts 8 | m = head ds - n 9 | mapM_ print [1..m-1] 10 | mapM_ print [m+1..l] 11 | -------------------------------------------------------------------------------- /AtCoder/CODEFESTIVAL2016qualC/B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/code-festival-2016-qualc/submissions/9690081 2 | main = do 3 | getLine; a <- map read . words <$> getLine 4 | print $ max (maximum a* 2 - sum a - 1) 0 5 | -------------------------------------------------------------------------------- /AtCoder/CODEFESTIVAL2016qualC/B_ml_01.ml: -------------------------------------------------------------------------------- 1 | (* https://atcoder.jp/contests/code-festival-2016-qualc/submissions/7944514 *) 2 | let k, t = Scanf.scanf " %d %d" @@ fun a b -> a, b 3 | let a_s = Array.init t @@ fun _ -> Scanf.scanf " %d" (+) 0 4 | let _ = Printf.printf "%d\n" @@ max 0 @@ 2 * Array.fold_left max a_s.(0) a_s - k - 1 5 | -------------------------------------------------------------------------------- /AtCoder/CODEFESTIVAL2017qualA/B03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/code-festival-2017-quala/submissions/19239170 2 | main :: IO () 3 | main = interact 4 | $ f . (\[n,m,k] -> (n,m,k)) . map read . words 5 | 6 | f :: (Num a, Enum a, Eq a) => (a, a, a) -> [Char] 7 | f (n,m,k) = last 8 | $ "No" : ["Yes" | x <- [0..n], y <- [0..m], 9 | x*(m-y)+(n-x)*y==k] 10 | -------------------------------------------------------------------------------- /AtCoder/DIVERTA2019/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/diverta2019/submissions/5357440 2 | main :: IO () 3 | main = readLn >>= \n -> 4 | print (sum [n `div` r - 1 | r <- [1..1000000], r*(r+1) < n, n `mod` r == 0]) 5 | -------------------------------------------------------------------------------- /AtCoder/DIVERTA2019/D_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/diverta2019/submissions/5384013 2 | main :: IO () 3 | main = do 4 | p <- readLn 5 | let s = floor . sqrt . fromIntegral $ p 6 | if p == 1 7 | then print 0 8 | else print $ sum [r | c<-[1..s],mod p c==0, let r=div p c-1,div p r== mod p r] 9 | -------------------------------------------------------------------------------- /AtCoder/DP/A06.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/dp/submissions/26866015 2 | main :: IO () 3 | main = do 4 | getLine 5 | h <- map read . words <$> getLine 6 | print $ last 7 | $ foldl (\[h2,c2,h1,c1] h0 -> [h1,c1,h0,min (c2 + abs(h0-h2)) $ c1 + abs(h0-h1)]) [0,0,head h,0] h 8 | -------------------------------------------------------------------------------- /AtCoder/DP/H03.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/dp/submissions/26866276 2 | main=do 3 | getLine 4 | a <- lines <$> getContents 5 | print $ solve a 6 | 7 | solve :: (Foldable t, Integral a) => t [Char] -> a 8 | solve a = last $ foldl (\t ai -> tail $ scanl (\x (y,aij) -> if aij=='.' then mod(x+y) $ 10^9+7 else 0) 0 $ zip t ai) (1:repeat 0) a 9 | -------------------------------------------------------------------------------- /AtCoder/DP/R04.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/dp/submissions/30484080 2 | from numpy import* 3 | (n,k),*a=[int_(t.split())for t in open(0)] 4 | a=matrix(a,'O') 5 | M=10**9+7 6 | s=1 7 | while k:s*=~k%2or a;k//=2;a=a*a%M 8 | print(sum(s)%M) 9 | -------------------------------------------------------------------------------- /AtCoder/DP/U07.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/dp/submissions/31108922 2 | N,*A=map(int,open(0).read().split()) 3 | R,*c=range, 4 | for o in R(1<>_//N&o>>_%N&1) * A[_] for _ in R(N*N)); s=o 6 | while s: s=~-s&o; t=max(t,c[-s]+c[s]) 7 | c+=t 8 | print(t>>1) 9 | -------------------------------------------------------------------------------- /AtCoder/DP/W00_TODO.fsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phasetr/AlgorithmsAndDataStructureByFSharp/82ff528a427c83eb05e0af206a2a4633a57681d2/AtCoder/DP/W00_TODO.fsx -------------------------------------------------------------------------------- /AtCoder/KEYENCE2020/C2.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/keyence2020/submissions/15311353 3 | -} 4 | main :: IO () 5 | main = interact $ solve . map read . words 6 | 7 | solve :: [Int] -> String 8 | solve [n,k,s] = unwords . map show 9 | $ replicate k s ++ replicate (n-k) ((s+1) `mod` 10^9) 10 | solve _ = error "not come here" 11 | -------------------------------------------------------------------------------- /AtCoder/PANASONIC2020/C2.hs: -------------------------------------------------------------------------------- 1 | {- 2 | https://atcoder.jp/contests/panasonic2020/submissions/21754836 3 | -} 4 | main :: IO () 5 | main = do 6 | [a,b,c] <- map read . words <$> getLine 7 | putStrLn $ solve a b c 8 | 9 | solve :: Int -> Int -> Int -> String 10 | solve a b c = if 0 getLine :: IO Int 4 | mapM (putStrLn.reverse) (solve n) 5 | 6 | solve :: Int -> [String] 7 | solve 1 = ["a"] 8 | solve n = [c:cs | cs <- solve (n-1),c <- ['a'..succ $ maximum cs],c <= 'z'] 9 | -------------------------------------------------------------------------------- /AtCoder/Practice1A/A.cpp: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/practice/tasks/practice_1 2 | // https://qiita.com/drken/items/fd4e5e3630d0f5859067 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | int main() { 8 | int a, b, c; 9 | string s; 10 | cin >> a >> b >> c; 11 | cin >> s; 12 | cout << a + b + c << " " << s << endl; 13 | } -------------------------------------------------------------------------------- /AtCoder/Practice1A/A.fsx: -------------------------------------------------------------------------------- 1 | (* 2 | https://atcoder.jp/contests/practice/tasks/practice_1 3 | *) 4 | let aTest = "1 2".Split(' ') 5 | 6 | let fa = 7 | Array.map int 8 | >> Array.fold (*) 1 9 | >> (fun x -> if x % 2 = 0 then "Even" else "Odd") 10 | 11 | aTest |> fa |> printfn "%s" 12 | 13 | let main = 14 | stdin.ReadLine().Split(' ') |> fa |> printfn "%s" 15 | -------------------------------------------------------------------------------- /AtCoder/SC2019qualB/B_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/jsc2019-qual/submissions/7170968 2 | main = interact $ show.f.map read.words;f(n:k:l)=foldl(&)0$[k*(k-1)`div`2|x<-l,y<-l,x>y]++[k | i<-[0..n-1],z<-drop i l,l!!i>z];x&y=rem(x+y)1000000007 3 | -------------------------------------------------------------------------------- /AtCoder/SUMITRUST2019/D_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/sumitrust2019/submissions/12257814 2 | import Data.List ( isSubsequenceOf ) 3 | import Control.Monad ( replicateM ) 4 | main :: IO () 5 | main = getLine >> getLine >>= print.solve 6 | solve :: String -> Int 7 | solve s = length 8 | $ filter (`isSubsequenceOf` s) 9 | $ replicateM 3 ['0'..'9'] 10 | -------------------------------------------------------------------------------- /AtCoder/TENKA1-2017/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tenka1-2017/submissions/9552113 2 | main :: IO () 3 | main = interact $ unwords . map show . head . f . read 4 | f :: Integral a => a -> [[a]] 5 | f n= [[x,y,div m d] | x<-q, y<-q, let d=4*x*y-n*x-n*y, let m=n*x*y, d>0, mod m d<1] 6 | where q = [1..3500] 7 | -------------------------------------------------------------------------------- /AtCoder/TENKA1-2017/C_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tenka1-2017/submissions/14262074 2 | main :: IO () 3 | main = do 4 | n <- readLn :: IO Int 5 | let (x,y,z) = head [(h,w,(h*w*n) `div` (4*h*w-w*n-h*n)) | h <- [1..3500], w <- [h..3500], (4*h*w-w*n-h*n) > 0, (h*w*n) `mod` (4*h*w-w*n-h*n) == 0] 6 | putStrLn $ show x ++ " " ++ show y ++ " " ++ show z 7 | -------------------------------------------------------------------------------- /AtCoder/TENKA1-2018/C_py_01.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/tenka1-2018/submissions/12997425 2 | N,*a = map(int,open(0)) 3 | n = N//2-1 4 | a.sort() 5 | print(2*sum(a[n+2:])-2*sum(a[:n])+a[n+1]-a[n]-N%2*min(a[~n]+a[n],2*a[n+1])) 6 | -------------------------------------------------------------------------------- /AtCoder/TENKA1-2018/C_py_02.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/tenka1-2018/submissions/20056689 2 | import sys 3 | 4 | def main(): 5 | N = int(sys.stdin.buffer.readline()) 6 | n = N//2 - 1 7 | a = sorted(int(x) for x in sys.stdin.buffer.readlines()) 8 | print(2*sum(a[n+2:])-2*sum(a[:n])+a[n+1]-a[n]-N%2*min(a[~n]+a[n],2*a[n+1])) 9 | main() 10 | -------------------------------------------------------------------------------- /AtCoder/TENKA1-2018/C_py_03.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/tenka1-2018/submissions/19558151 2 | N = int(input()) 3 | A = [int(input()) for i in range(N)] 4 | A.sort() 5 | ans = 0 6 | if N%2==0: 7 | ans = 2*sum(A[N//2:])-2*sum(A[:N//2])-A[N//2]+A[N//2-1] 8 | else: 9 | ans = 2*(sum(A[N//2+1:])-sum(A[:N//2]))+max(A[N//2]-A[N//2+1],A[N//2-1]-A[N//2]) 10 | print(ans) 11 | -------------------------------------------------------------------------------- /AtCoder/TENKA1-2019/C_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tenka1-2019/submissions/9944101 2 | main :: IO () 3 | main = do 4 | getLine 5 | s <- getLine 6 | let l = scanl (+) 0 $ map (\c -> if c=='#' then 1 else 0) s 7 | let r = scanr (+) 0 $ map (\c -> if c=='#' then 0 else 1) s 8 | print $ minimum $ zipWith (+) l r 9 | -------------------------------------------------------------------------------- /AtCoder/TOKIOMARINE202006/A.fsx: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tokiomarine2020/tasks/tokiomarine2020_a 2 | //let s = "takahashi" 3 | //s.[0..2] |> printfn "%s" 4 | 5 | [] 6 | let main argv = 7 | let s = stdin.ReadLine() 8 | s.[0..2] |> printfn "%s" 9 | 0 10 | -------------------------------------------------------------------------------- /AtCoder/YAHOOPROCON2019/C1.hs: -------------------------------------------------------------------------------- 1 | import Data.Function ((&)) 2 | main :: IO() 3 | main = do 4 | [k,a,b] <- map read . words <$> getLine :: IO [Int] 5 | print $ solve k a b 6 | 7 | solve :: Int -> Int -> Int -> Int 8 | solve k a b = if 2 int 6 | solve N |> stdout.WriteLine 7 | 8 | solve 2 |> should equal 4 9 | solve 8 |> should equal 64 10 | solve 100 |> should equal 10000 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A02/A02_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36115321 2 | fn main() { 3 | proconio::input!{n: usize, x: usize, a: [usize; n]}; 4 | let r = match a.iter().any(|&v| v == x) { 5 | true => "Yes", 6 | false => "No" 7 | }; 8 | println!("{}", r); 9 | } 10 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A03/A03_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35758121 2 | readIntsLn :: IO [Int] 3 | readIntsLn = fmap read . words <$> getLine 4 | 5 | main :: IO () 6 | main = do 7 | [n, k] <- readIntsLn 8 | ps <- readIntsLn 9 | qs <- readIntsLn 10 | putStrLn $ if k `elem` ((+) <$> ps <*> qs) then "Yes" else "No" 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A04/A04_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/35914503 2 | use proconio::input; 3 | fn main() { 4 | input! {n:isize}; 5 | println!("{:010b}", n); 6 | } 7 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A05/A05_hs_02.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35451993 2 | main :: IO () 3 | main = do 4 | [n, k] <- map read . words <$> getLine 5 | print $ length [0 | a <- [1 .. n], b <- [1 .. n], let c = k - a - b, 1 <= c && c <= n] 6 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A05/A05_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/35014354 2 | use proconio::input; 3 | fn main() { 4 | input! { 5 | n: i64, 6 | k: i64, 7 | } 8 | println!("{}", (1..=n).map(|i| (1..=n).filter(|j| 1<=k-(i+j) && k-(i+j)<=n).count()).sum::()); 9 | } 10 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A11/A11_rs_02.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36143620 2 | #[proconio::fastout] 3 | fn main() { 4 | proconio::input!{n: usize, x: usize, a: [usize; n]} 5 | println!("{}", a.binary_search(&x).unwrap() + 1); 6 | } 7 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A21/A21_py_01.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/tessoku-book/submissions/36746499 2 | (N,),*T=[[*map(int,t.split())]for t in open(0)] 3 | D=eval('[0]*(N+2),'*(N+2)) 4 | B=lambda k:N>k>=0and(l<=T[k][0]<=r)*T[k][1] 5 | for l in range(1,N+1): 6 | for r in range(N,0,-1):D[l][r]=max(D[l][r+1]+B(r),D[l-1][r]+B(l-2)) 7 | print(max(D[i][i]for i in range(N))) 8 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A31/A31_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35373720 2 | tba31 :: Int -> Int 3 | tba31 n = div n 3 + div n 5 - div n 15 4 | 5 | main :: IO () 6 | main = do 7 | n <- readLn 8 | let ans = tba31 n 9 | print ans 10 | 11 | getLnInts :: IO [Int] 12 | getLnInts = map read . words <$> getLine 13 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A31/A31_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36218887 2 | fn main() { 3 | proconio::input!{n: usize} 4 | println!("{}", n / 3 + n / 5 - n / 15); 5 | } 6 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A33/A33_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/37267684 2 | fn main() { 3 | proconio::input!{n: usize, a: [usize; n]} 4 | match a.iter().fold(0, |x, &y| x ^ y) { 5 | 0 => println!("Second"), 6 | _ => println!("First") 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A36/A36_fs_00_01.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | (* 5 | let N,K = 5,10 6 | *) 7 | let solve N K = let n = 2*(N-1) in if n<=K && (K-n)%2=0 then "Yes" else "No" 8 | 9 | let N,K = stdin.ReadLine().Split() |> Array.map int |> (fun x -> x.[0],x.[1]) 10 | solve N K |> stdout.WriteLine 11 | 12 | solve 5 10 |> should equal "Yes" 13 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A36/A36_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35448261 2 | main :: IO () 3 | main = do 4 | li <- getLine 5 | let [n,k] = map read $ words li 6 | let ans = tba36 n k 7 | putStrLn $ if ans then "Yes" else "No" 8 | 9 | tba36 :: Int -> Int -> Bool 10 | tba36 n k = n2 <= k && even (k - n2) 11 | where n2 = 2 * pred n 12 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A36/A36_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/37053 2 | use proconio::input; 3 | 4 | fn main() { 5 | input!{ 6 | n: usize, 7 | k: usize, 8 | } 9 | println!("{}", if k >= 2 * n - 2 && k % 2 == 0{"Yes"} else {"No"}); 10 | } 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A37/A37_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/35435427 2 | use proconio::input; 3 | #[proconio::fastout] 4 | fn main() { 5 | input!{ 6 | n:usize,m:usize,b:usize, 7 | a:[usize;n], 8 | c:[usize;m], 9 | } 10 | println!("{}",a.iter().sum::() * m + c.iter().sum::() * n + b*n*m); 11 | } 12 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A37/A37_rs_02.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36144214 2 | fn main() { 3 | proconio::input!{n: usize, m: usize, b: usize, a: [usize; n], c: [usize; m]} 4 | println!("{}", a.iter().sum::() * m + b * n * m + c.iter().sum::() * n); 5 | } 6 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A40/A40_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36152599 2 | fn main() { 3 | proconio::input!{n: usize, a: [usize; n]} 4 | let mut s = vec![0i64; 101]; 5 | a.iter().for_each(|&v| s[v] += 1); 6 | println!("{}", s.iter().map(|&v| v * (v - 1) * (v - 2) / 6).sum::()); 7 | } 8 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A41/A41_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35453133 2 | main :: IO () 3 | main = do 4 | getLine 5 | s <- getLine 6 | let ans = or $ zipWith3 f s (tail s) (drop 2 s) 7 | 8 | putStrLn $ if ans then "Yes" else "No" 9 | 10 | f a b c = a == b && b == c 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/A41/A41_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/37118190 2 | fn main() { 3 | proconio::input!{_: usize, s: String} 4 | match s.find("RRR").or_else(|| s.find("BBB")) { 5 | Some(_) => println!("Yes"), 6 | None => println!("No") 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B01/B01_cs_01.cs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/37366039 2 | using System; 3 | using System.Linq; 4 | 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | var in1 = Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); 10 | Console.WriteLine(in1.Sum()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B01/B01_fs_00.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | (* 5 | let A,B = 1,2 6 | *) 7 | let solve A B = A+B 8 | let A,B = stdin.ReadLine().Split() |> Array.map int |> (fun x -> x.[0],x.[1]) 9 | solve A B |> stdout.WriteLine 10 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B01/B01_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/37972224 2 | main = interact $ show . sum . map read . words 3 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B01/B01_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36219219 2 | fn main() 3 | { 4 | proconio::input!{a: usize, b: usize} 5 | println!("{}", a + b); 6 | } 7 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B02/B02_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/37972341 2 | import Data.Bool ( bool ) 3 | 4 | main :: IO () 5 | main = do 6 | [a,b] <- map read . words <$> getLine 7 | let ans = any (\x -> gcd 100 x == x) [a..b] 8 | putStrLn $ bool "No" "Yes" ans 9 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B02/B02_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36219253 2 | fn main() { 3 | proconio::input!{l: usize, r: usize} 4 | let r = match (l ..= r).any(|v| 100 % v == 0) { 5 | true => "Yes", 6 | false => "No" 7 | }; 8 | println!("{}", r); 9 | } 10 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B04/B04_cs_01.cs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/37366147 2 | using System; 3 | 4 | class Program 5 | { 6 | static void Main(string[] args) 7 | { 8 | string s = Console.ReadLine(); 9 | int n = Convert.ToInt32(s, 2); 10 | Console.WriteLine(n); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B04/B04_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/36784252 2 | main :: IO () 3 | main = interact $ show . foldl1 ((+) . (2*)) . map (read . return) . filter ('0'<=) 4 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B04/B04_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/35015228 2 | use proconio::input; 3 | fn main() { 4 | input!{ 5 | n:String, 6 | } 7 | println!("{}",i32::from_str_radix(&n, 2).unwrap()); 8 | } 9 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B12/B12_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/37258064 2 | main :: IO () 3 | main = readLn >>= print . sol 4 | 5 | sol :: Floating a => Integer -> a 6 | sol n = u-v where 7 | q = fromInteger n/2.0 8 | d = q^2+1.0/27.0 9 | u = (sqrt d+q)**(1/3) 10 | v = (sqrt d-q)**(1/3) 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B27/B27_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35370501 2 | main :: IO () 3 | main = getLine >>= print . (\(a:b:_) -> lcm a b) . map read . words 4 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B27/B27_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36319564 2 | use num::Integer; 3 | use proconio::input; 4 | 5 | fn main() { 6 | input!{a: u64, b: u64} 7 | println!("{}", a.lcm(&b)); 8 | } 9 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B31/B31_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/37931351 2 | main :: IO () 3 | main = interact $ show . sol . read 4 | 5 | sol n = n `div` 3 + n `div` 5 + n `div` 7 - n `div` 15 - n `div` 21 - n `div` 35 + n `div` 105 6 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B31/B31_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/37413319 2 | fn main() { 3 | proconio::input! { 4 | n: i64 5 | }; 6 | 7 | println!("{}", n / 3 + n / 5 + n / 7 - n / 15 - n / 35 - n / 21 + n / 105); 8 | } 9 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B32/B32_py_01.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/tessoku-book/submissions/34882088 2 | n,k,*A = map(int,open(0).read().split()) 3 | dp = [False]*(n+1) 4 | for i in range(1,n+1): 5 | dp[i] = any(not dp[i-a] for a in A if i >= a) 6 | if dp[n]: 7 | print("First") 8 | else: 9 | print("Second") 10 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B37/B37_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/38273620 2 | main :: IO () 3 | main = sol <$> readLn >>= print 4 | 5 | sol n = f 0 1 n where 6 | f a _ 0 = a 7 | f a d p = f (a + r*(1 + n `mod` d) + d*(s (r-1) + q*s9)) (10*d) q 8 | where (q,r) = quotRem p 10 9 | s n = n*(n+1) `div` 2 10 | s9 = s 9 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B45/B45_fs_00_01.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | (* 5 | let A,B,C = 3L,(-4L),1L 6 | *) 7 | let solve A B C = if A+B+C = 0L then "Yes" else "No" 8 | let A,B,C = stdin.ReadLine().Split() |> Array.map int64 |> (fun x -> x.[0],x.[1],x.[2]) 9 | solve A B C |> stdout.WriteLine 10 | 11 | solve 3L (-4L) 1L |> should equal "Yes" 12 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B45/B45_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35518757 2 | main :: IO () 3 | main = getLine >>= putStrLn . b2yn . (0 ==) . sum . map read . words 4 | 5 | b2yn :: Bool -> [Char] 6 | b2yn True = "Yes" 7 | b2yn _ = "No" 8 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B45/B45_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36312694 2 | fn main() { 3 | proconio::input!{a: i64, b: i64, c: i64} 4 | let r = match a + b + c == 0 { 5 | true => "Yes", 6 | false => "No" 7 | }; 8 | println!("{}", r); 9 | } 10 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B61/B61_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36323155 2 | fn main() { 3 | proconio::input!{n: usize, m: usize, e: [(usize, usize); m]} 4 | let mut g = vec![0; n + 1]; 5 | e.iter().for_each(|&(a, b)| {g[a] += 1; g[b] += 1}); 6 | println!("{}", g.iter().enumerate().max_by(|&a, &b| a.1.cmp(b.1)).unwrap().0); 7 | } 8 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/B65/B65_py_01.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/tessoku-book/submissions/36083255 2 | (n,t),*A=[map(int,s.split())for s in open(0)] 3 | X,*Q=[0]*-~n,[t,0] 4 | G=[[]for _ in X] 5 | for a,b in A:G[a]+=b,;G[b]+=a, 6 | for i,p in Q: 7 | for c in G[i]: 8 | if c!=p:Q+=[c,i], 9 | for i,p in Q[::-1]:X[p]=max(X[p],X[i]+1) 10 | print(*X[1:]) 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C01/C01_fs_00_01.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: FsUnit" 2 | open FsUnit 3 | 4 | (* 5 | let N = 800 6 | *) 7 | let solve N = N |> fun n -> (float n) * 1.1 |> int 8 | let N = stdin.ReadLine() |> int 9 | solve N |> stdout.WriteLine 10 | 11 | solve 800 |> should equal 880 12 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C01/C01_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35952188 2 | main = readLn >>= print . flip div 10 . (11 *) 3 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C01/C01_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36137718 2 | fn main() { 3 | proconio::input!{n: usize} 4 | println!("{}", n + n / 10); 5 | } 6 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C02/C02_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/35952253 2 | import Data.List ( sortBy ) 3 | 4 | main :: IO () 5 | main = getLine >> getLine >>= print . sum . take 2 . sortBy (flip compare) . map read . words 6 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C02/C02_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/36292804 2 | fn main() { 3 | proconio::input!{ 4 | n: usize, 5 | mut a_s: [i32; n] 6 | }; 7 | 8 | a_s.sort(); 9 | println!("{}", a_s[n - 2] + a_s[n - 1]); 10 | } 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C05/C05_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/37660839 2 | use proconio::input; 3 | #[proconio::fastout] 4 | fn main() { 5 | input! { 6 | n:usize, 7 | } 8 | let ans = format!("{:010b}", n - 1); 9 | println!("{}", ans.replace("0", "4").replace("1", "7")); 10 | } 11 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C06/C06_hs_01.hs: -------------------------------------------------------------------------------- 1 | -- https://atcoder.jp/contests/tessoku-book/submissions/39578777 2 | main :: IO () 3 | main = do 4 | n <- readLn 5 | print n 6 | putStr $ unlines $ map (unwords . map show) $ gen n 7 | where gen n = [[x,x+1] | x <- [1..n-1] ] ++ [[n,1]] 8 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C06/C06_rs_01.rs: -------------------------------------------------------------------------------- 1 | // https://atcoder.jp/contests/tessoku-book/submissions/37408230 2 | use proconio::input; 3 | 4 | fn main() { 5 | input! { 6 | n: usize, 7 | }; 8 | println!("{}", n); 9 | for i in 0..n { 10 | println!("{} {}", i + 1, (i + 1) % n + 1); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /AtCoder/tessoku-book/C11/C11_py_01.py: -------------------------------------------------------------------------------- 1 | # https://atcoder.jp/contests/tessoku-book/submissions/38963558 2 | n,k,*a=map(int,open(0).read().split()) 3 | ok,ng=1,10**17 4 | while abs(ok-ng)>1: 5 | mid=(ok+ng)//2 6 | b=sum(i*10**6//mid for i in a) 7 | if b>=k: 8 | ok=mid 9 | else: 10 | ng=mid 11 | print(*[i*10**6//ok for i in a]) 12 | -------------------------------------------------------------------------------- /Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition/hsorig/Dynamic.hs: -------------------------------------------------------------------------------- 1 | module Dynamic(module Table,dynamic) where 2 | import Data.Array ( Ix(range) ) 3 | import Table 4 | 5 | dynamic :: Ix c => (Table entry c -> c -> entry) -> (c,c) -> Table entry c 6 | dynamic compute bnds = t where 7 | t = newTable (map (\coord -> (coord, compute t coord)) (range bnds)) 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition/hsorig/S5_3.hs: -------------------------------------------------------------------------------- 1 | module S5_3 where 2 | import Queue (emptyQueue,enqueue) 3 | test = show (foldr enqueue emptyQueue [1..10]) == "Q [10,9,8,7,6,5,4,3,2,1]" 4 | -------------------------------------------------------------------------------- /Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition/hsorig/S5_9.hs: -------------------------------------------------------------------------------- 1 | module S5_9 where 2 | 3 | import AVLTree ( AVLTree(EmptyAVL, NodeAVL), emptyAVL, addAVL ) 4 | 5 | main = print 6 | $ foldr addAVL emptyAVL [7,6..1] 7 | == NodeAVL 4 (NodeAVL 2 (NodeAVL 1 EmptyAVL EmptyAVL) (NodeAVL 3 EmptyAVL EmptyAVL)) (NodeAVL 6 (NodeAVL 5 EmptyAVL EmptyAVL) (NodeAVL 7 EmptyAVL EmptyAVL)) 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition/hsorig/S6_4.hs: -------------------------------------------------------------------------------- 1 | module S6_4 where 2 | import Sort ( hsort, tsort ) 3 | main :: IO () 4 | main = print $ hsort ex == [1,1,2,3,4,5,8,9] 5 | && tsort ex == hsort ex 6 | where ex = [3,1,4,1,5,9,2,8] 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition/hsorig/S8_1.hs: -------------------------------------------------------------------------------- 1 | module S8_1 where 2 | import DivideAndConquer ( msort, qsort ) 3 | 4 | -- P.155, 8.1 Divide-and-conquer 5 | main :: IO () 6 | main = do 7 | print $ msort l == [1,1,2,3,4,5,9] 8 | print $ qsort l == [1,1,2,3,4,5,9] 9 | where l = [3,1,4,1,5,9,2] 10 | -------------------------------------------------------------------------------- /Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition/hsorig/readme.md: -------------------------------------------------------------------------------- 1 | # Haskell Original Codes 2 | - [Author's site](https://www.iro.umontreal.ca/~lapalme/Algorithms-functional.html) 3 | - [The page where code files exist](https://www.iro.umontreal.ca/~lapalme/AlgoFP/code.html) 4 | -------------------------------------------------------------------------------- /Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition/readme.md: -------------------------------------------------------------------------------- 1 | # Rabhi and Lapalme, Algorithms A Functional Programming Approach written by Haskell 2 | F# version: `../DataStructures/RabhiLapalme/`. 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P074ALDS1_2_D-ShellSort/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 3 | 1 4 | 4 5 | 3 6 | 2 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P082ALDS1_3_A-Stack/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 2 + 3 4 - * 2 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P087ALDS1_3_B-Queue/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 100 2 | p1 150 3 | p2 80 4 | p3 200 5 | p4 350 6 | p5 20 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P095ALDS1_3_C-DoublyLinkedList/sample1.txt: -------------------------------------------------------------------------------- 1 | 7 2 | insert 5 3 | insert 2 4 | insert 3 5 | insert 1 6 | delete 3 7 | insert 6 8 | delete 5 9 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P114ALDS1_3_D/sample1.txt: -------------------------------------------------------------------------------- 1 | \\///\_/\/\\\\/_/\\///__\\\_\\/_\/_/\ 2 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P119ALDS1_4_A-LinearSearch/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1 2 3 4 5 3 | 3 4 | 3 4 1 5 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P122ALDS1_4_B-BinarySearch/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1 2 3 4 5 3 | 3 4 | 3 4 1 5 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P127ALDS1_4_C-Dictionary/sample1.txt: -------------------------------------------------------------------------------- 1 | 6 2 | insert AAA 3 | insert AAC 4 | find AAA 5 | find CCC 6 | insert CCC 7 | find CCC 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P132SortByStdLib/vectorIterator.txt: -------------------------------------------------------------------------------- 1 | 2 0 1 4 2 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P136ALDS1_4_D-Allocation/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 3 2 | 8 3 | 1 4 | 7 5 | 3 6 | 9 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P141Samples/code00.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | g++ -std=gnu++1y -g -O0 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o code00.out code00.cpp 3 | echo "==================" 4 | echo "SAMPLE 1" 5 | echo "ANSWER" 6 | echo "3" 7 | echo "==================" 8 | echo "RESULT" 9 | ./code00.out 10 | echo "==================" 11 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P142ALDS1_5_A-ExhaustiveSearch/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1 5 7 10 21 3 | 4 4 | 2 4 17 8 5 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P146ALDS1_5_C-KochCurve/sample1.txt: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P151ALDS1_5_B-MergeSort/sample1.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 8 5 9 2 6 3 7 1 10 4 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P158ALDS1_6_B-Partition/sample1.txt: -------------------------------------------------------------------------------- 1 | 12 2 | 13 19 9 5 12 8 7 4 21 2 6 11 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P163ALDS1_6_3-QuickSort/sample1.txt: -------------------------------------------------------------------------------- 1 | 6 2 | D 3 3 | H 2 4 | D 1 5 | S 3 6 | D 2 7 | C 1 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P249ALDS1_10_A-FibonacciNumber/sample1.txt: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P253ALDS1_10_C-LongestCommonSubsequence/sample1.txt: -------------------------------------------------------------------------------- 1 | 3 2 | abcbdab 3 | bdcaba 4 | abc 5 | abc 6 | abc 7 | bc 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P257ALDS1_10_B-MatrixChainMultiplication/sample1.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 30 35 3 | 35 15 4 | 15 5 5 | 5 10 6 | 10 20 7 | 20 25 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P269ALDS1_11_A-Graph/sample1.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 2 4 3 | 2 1 4 4 | 3 0 5 | 4 1 3 6 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P273ALDS1_11_B-DepthFirstSearch/sample1.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 1 2 2 3 3 | 2 2 3 4 4 | 3 1 5 5 | 4 1 6 6 | 5 1 6 7 | 6 0 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P282ALDS1_11_C-BreadthFIrstSearch/sample1.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 2 4 3 | 2 1 4 4 | 3 0 5 | 4 1 3 6 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P287ALDS1_11_D-ConnectedComponents/sample1.txt: -------------------------------------------------------------------------------- 1 | 10 9 2 | 0 1 3 | 0 2 4 | 3 4 5 | 5 7 6 | 5 6 7 | 6 7 8 | 6 8 9 | 7 8 10 | 8 9 11 | 3 12 | 0 1 13 | 5 9 14 | 1 3 15 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P296ALDS1_12_A-MinimumSpanningTree/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 2 | -1 2 3 1 -1 3 | 2 -1 -1 4 -1 4 | 3 -1 -1 1 1 5 | 1 4 1 -1 3 6 | -1 -1 1 3 -1 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P302ALDS1_12_B-SingleSourceShortestPath1/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 3 2 3 3 1 1 2 3 | 1 2 0 2 3 4 4 | 2 3 0 3 3 1 4 1 5 | 3 4 2 1 0 1 1 4 4 3 6 | 4 2 2 1 3 3 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P309ALDS1_12_C-SingleSourceShortestPath2/sample1.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 3 2 3 3 1 1 2 3 | 1 2 0 2 3 4 4 | 2 3 0 3 3 1 4 1 5 | 3 4 2 1 0 1 1 4 4 3 6 | 4 2 2 1 3 3 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/P324DSL_2_C-RangeSearch-kDTree/sample1.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 2 1 3 | 2 2 4 | 4 2 5 | 6 2 6 | 3 3 7 | 5 4 8 | 2 9 | 2 4 0 4 10 | 4 10 2 5 11 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/040.txt: -------------------------------------------------------------------------------- 1 | 25 36 4 55 71 18 0 71 89 65 2 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/046_00.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 5 3 | 3 4 | 1 5 | 3 6 | 4 7 | 3 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/046_01.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | 3 4 | 2 5 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/055.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 5 2 4 6 1 3 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/060.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 3 2 4 1 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/065.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 5 6 4 2 1 3 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/070.txt: -------------------------------------------------------------------------------- 1 | 5 2 | H4 C9 S4 D2 C3 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/074.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 3 | 1 4 | 4 5 | 3 6 | 2 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | RUN apk update && \ 3 | apk add --no-cache make gcc libc-dev g++ 4 | 5 | ARG HOMEDIR="/home/cpp" 6 | ENV HOME ${HOMEDIR} 7 | 8 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/cpp/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | cpp: 4 | build: . 5 | container_name: cpp 6 | working_dir: '/home/cpp' 7 | volumes: 8 | - .:/home/cpp 9 | tty: true 10 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/fsharp/040.fsx: -------------------------------------------------------------------------------- 1 | let input = [|25;36;4;55;71;18;0;71;89;65|] 2 | input |> Array.sort |> Array.rev |> Array.take 3 |> printfn "%A" 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/haskell/.gitignore: -------------------------------------------------------------------------------- 1 | .stack-work/ 2 | *~ -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/haskell/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM haskell:latest 2 | 3 | ARG HOMEDIR="/home/hs" 4 | ENV HOME ${HOMEDIR} 5 | 6 | #RUN curl -sSL https://get.haskellstack.org/ | sh 7 | # stackインストール 8 | RUN stack upgrade 9 | RUN stack --version 10 | # stack の初期設定 11 | RUN stack setup 12 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/haskell/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/haskell/app/040.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Data.List 4 | 5 | lst = [25, 36, 4, 55, 71, 18, 0, 71, 89, 65] 6 | 7 | main :: IO () 8 | main = print $ take 3 $ reverse $ sort lst 9 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/haskell/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Lib 4 | 5 | main :: IO () 6 | main = someFunc 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/haskell/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | hs: 4 | build: . 5 | container_name: sh 6 | working_dir: '/home/hs' 7 | volumes: 8 | - .:/home/hs 9 | tty: true 10 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/haskell/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/haskell/test/Spec.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = putStrLn "Test suite not yet implemented" 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/julia/040.jl: -------------------------------------------------------------------------------- 1 | input = [25, 36, 4, 55, 71, 18, 0, 71, 89, 65] 2 | print(sort(input, rev=true)[begin:begin+2]') 3 | -------------------------------------------------------------------------------- /Book-AlgorithmsAndDataStructuresForProgrammingContests/template/sample1.txt: -------------------------------------------------------------------------------- 1 | 25 36 4 55 71 18 0 71 89 65 2 | -------------------------------------------------------------------------------- /Book-Bird.Gibbons-Algorithm_Design_with_Haskell/Ex14.hs: -------------------------------------------------------------------------------- 1 | module Ex14 where 2 | import Sec1406 hiding (build) 3 | -- P.361 Exercise14.12, P.364 Answer14.12 4 | build = endstep . foldr step [] . zip (map Leaf [1..]) 5 | endstep :: [Pair] -> Tree Label 6 | endstep [(t,_)] = t 7 | endstep (x:y:xs) = endstep (insert (join x y) xs) 8 | -------------------------------------------------------------------------------- /Book-Bird.Gibbons-Algorithm_Design_with_Haskell/README.md: -------------------------------------------------------------------------------- 1 | # Bird, Gibbons, Algorithm Design with Haskell 2 | ## Links 3 | - [Book site](http://www.cs.ox.ac.uk/publications/books/adwh/) 4 | - [2.5 Chapter notes](http://stackoverflow.com/questions/24484348/) 5 | 6 | ## TODO 7 | - Fix errors. 8 | - Make F# codes. 9 | -------------------------------------------------------------------------------- /Book-Bird.Gibbons-Algorithm_Design_with_Haskell/Sec0905.hs: -------------------------------------------------------------------------------- 1 | -- P.219 9.5 Single-source shortest paths 2 | module Sec0905 where 3 | -------------------------------------------------------------------------------- /Book-IntroductionToComputation-HaskellLogicAndAutomata/hsorig/AbstractSetAsList_MyModule: -------------------------------------------------------------------------------- 1 | 2 | 3 | 404 Not Found 4 | 5 |

Not Found

6 |

The requested URL /dts/intro-to-computation/code/AbstractSetAsList_MyModule was not found on this server.

7 | 8 | -------------------------------------------------------------------------------- /Book-IntroductionToComputation-HaskellLogicAndAutomata/hsorig/Main.hs: -------------------------------------------------------------------------------- 1 | -- D. Sannella. M Fourman, H. Peng and P. Wadler 2 | -- Introduction to Computation: Haskell, Logic and Automata 3 | -- Undergraduate Topics in Computer Science, Springer (2021) 4 | -- ISBN 978-3-030-76907 5 | 6 | module Main where 7 | main :: IO () 8 | main = putStrLn "Hello World!" 9 | -------------------------------------------------------------------------------- /Book-IntroductionToComputation-HaskellLogicAndAutomata/hsorig/readme.md: -------------------------------------------------------------------------------- 1 | # README 2 | Codes are from [here](https://www.intro-to-computation.com/code/). 3 | -------------------------------------------------------------------------------- /Book-IntroductionToComputation-HaskellLogicAndAutomata/readme.md: -------------------------------------------------------------------------------- 1 | # README 2 | - [Book, springer.com](https://link.springer.com/book/10.1007/978-3-030-76908-6) 3 | - [support site](https://www.intro-to-computation.com/) 4 | -------------------------------------------------------------------------------- /Book-Okasaki-Purely_Functional_Data_Structures/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | - [Okasaki, Purely Functional Data Structure](https://www.cambridge.org/core/books/purely-functional-data-structures/0409255DA1B48FA731859AC72E34D494) 3 | -------------------------------------------------------------------------------- /Book-Okasaki-Purely_Functional_Data_Structures/hs/CatenableDeque.hs: -------------------------------------------------------------------------------- 1 | module CatenableDeque (CatenableDeque(..)) where 2 | import Prelude hiding (head,tail,last,init,(++)) 3 | import Deque 4 | 5 | class Deque d => CatenableDeque d where 6 | (++) :: d a -> d a -> d a 7 | -------------------------------------------------------------------------------- /Book-Okasaki-Purely_Functional_Data_Structures/hs/Deque.hs: -------------------------------------------------------------------------------- 1 | module Deque (Deque(..)) where 2 | import Prelude hiding (head,tail,last,init) 3 | class Deque q where 4 | empty :: q a 5 | isEmpty :: q a -> Bool 6 | cons :: a -> q a -> q a 7 | head :: q a -> a 8 | tail :: q a -> q a 9 | snoc :: q a -> a -> q a 10 | last :: q a -> a 11 | init :: q a -> q a 12 | -------------------------------------------------------------------------------- /Book-Okasaki-Purely_Functional_Data_Structures/hs/FiniteMap.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiParamTypeClasses #-} 2 | module FiniteMap (FiniteMap(..)) where 3 | -- 多引数型クラスが使えることを前提とする! 4 | class FiniteMap m k where 5 | empty :: m k a 6 | bind :: k -> a -> m k a -> m k a 7 | lookup :: k -> m k a -> Maybe a 8 | -------------------------------------------------------------------------------- /Book-Okasaki-Purely_Functional_Data_Structures/hs/Heap.hs: -------------------------------------------------------------------------------- 1 | module Heap (Heap(..)) where 2 | class Heap h where 3 | empty :: Ord a => h a 4 | isEmpty :: Ord a => h a -> Bool 5 | insert :: Ord a => a -> h a -> h a 6 | merge :: Ord a => h a -> h a -> h a 7 | findMin :: Ord a => h a -> a 8 | deleteMin :: Ord a => h a -> h a 9 | -------------------------------------------------------------------------------- /Book-Okasaki-Purely_Functional_Data_Structures/hs/Queue.hs: -------------------------------------------------------------------------------- 1 | module Queue (Queue(..)) where 2 | import Prelude hiding (head,tail) 3 | class Queue q where 4 | empty :: q a 5 | isEmpty :: q a -> Bool 6 | snoc :: q a -> a -> q a 7 | head :: q a -> a 8 | tail :: q a -> q a 9 | -------------------------------------------------------------------------------- /Book-Okasaki-Purely_Functional_Data_Structures/hs/Set.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiParamTypeClasses #-} 2 | module Set (Set(..)) where 3 | -- 多引数型クラスが使えることを前提とする! 4 | class Set s a where 5 | empty :: s a 6 | insert :: a -> s a -> s a 7 | member :: a -> s a -> Bool 8 | -------------------------------------------------------------------------------- /Book-Okasaki-Purely_Functional_Data_Structures/hs/Sortable.hs: -------------------------------------------------------------------------------- 1 | module Sortable (Sortable(..)) where 2 | class Sortable s where 3 | empty :: Ord a => s a 4 | add :: Ord a => a -> s a -> s a 5 | sort :: Ord a => s a -> [a] 6 | -------------------------------------------------------------------------------- /Book-Yoneda-Math_Algorithm/readme.md: -------------------------------------------------------------------------------- 1 | # README 2 | - [本, PDF](https://direct.gihyo.jp/view/item/000000002544) 3 | - [正誤表](https://gihyo.jp/book/2022/978-4-297-12521-9/support#supportApology) 4 | - [GitHub](https://github.com/E869120/math-algorithm-book) 5 | - [自動採点システム: アルゴリズムと数学 演習問題集](https://atcoder.jp/contests/math-and-algorithm) 6 | -------------------------------------------------------------------------------- /DataStructures/RabhiLapalme/SetTreeRepresentations.fsx: -------------------------------------------------------------------------------- 1 | // Rabhi-Lapalme P.95, 5.5.2 Tree representations 2 | // See 5.7 (binary search tree) and 5.9 (AVL tree) 3 | -------------------------------------------------------------------------------- /DataStructures/RabhiLapalme/TableByArray.fsx: -------------------------------------------------------------------------------- 1 | // TODO Rabhi-Lapalme, P.99 2 | -------------------------------------------------------------------------------- /DataStructures/RabhiLapalme/TableByList.fsx: -------------------------------------------------------------------------------- 1 | // Rabhi-lapalme, P.98, 5.6.2 List implementation 2 | // TODO 3 | //module TableByList = 4 | //type Table<'a, 'b> = {Table: [('b, 'a)]} 5 | -------------------------------------------------------------------------------- /DataStructures/RabhiLapalme/readme.md: -------------------------------------------------------------------------------- 1 | # Rabhi Lapalme 2 | Original: `../../Book-AlgorithmsAFunctionalProgrammingApproachSecondEdition/` 3 | -------------------------------------------------------------------------------- /MyLectureJP/.gitignore: -------------------------------------------------------------------------------- 1 | *.ipynb 2 | -------------------------------------------------------------------------------- /MyLectureJP/001_introduction.fsx: -------------------------------------------------------------------------------- 1 | // # イントロダクション 2 | -------------------------------------------------------------------------------- /phasetr.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("{:?}", "TEST"); 3 | } 4 | --------------------------------------------------------------------------------