This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""" | |
" general | |
""""""""""""""""""""" | |
set number | |
set tabstop=2 | |
set laststatus=2 | |
set t_Co=256 | |
set expandtab | |
set noswapfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch(i%4): | |
case 0: | |
thinca | |
case 1: | |
kyubuns | |
case 2: | |
supermomonga | |
case 3: | |
aomoriringo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from uzumaki import * | |
>>> [uzumaki(x) for x in range(20)] | |
[(0, 0), (1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1), (2, -1), (2, 0), (2, 1), (2, 2), (1, 2), (0, 2), (-1, 2), (-2, 2), (-2, 1), (-2, 0), (-2, -1)] | |
>>> uzumaki(1000000000) | |
(1683, -15811) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x27[32;01m * x27[39;49;00mPackage: dev-lang/R-3.1.2 | |
x27[32;01m * x27[39;49;00mRepository: gentoo | |
x27[32;01m * x27[39;49;00mMaintainer: calchan@gentoo.org sci-mathematics@gentoo.org | |
x27[32;01m * x27[39;49;00mUSE: abi_x86_64 amd64 elibc_glibc kernel_linux nls openmp readline userland_GNU | |
x27[32;01m * x27[39;49;00mFEATURES: preserve-libs sandbox userpriv usersandbox | |
x27[32;01m*x27[0m Using following Fortran compiler: | |
x27[32;01m*x27[0m F77: x86_64-pc-linux-gnu-gfortran | |
x27[32;01m*x27[0m FC: x86_64-pc-linux-gnu-gfortran | |
x27[32;01m*x27[0m x86_64-pc-linux-gnu-gfortran has OPENMP support | |
>>> Unpacking source... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:name = 'World' | |
echo "\nHello" . s:name | |
function! Isdigit(str) | |
return match(a:str, '^[+-]\?\d\+$') != -1 | |
endfunction | |
let g:bigint = {'num': [], 'sign': 1} | |
let g:nodeMaxDigit = 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:bigint = {'num': [], 'sign': 1} | |
let g:nodeMaxDigit = 8 | |
let g:nodeMaxNum = 100000000 | |
function! Isdigit(str) | |
return match(a:str, '^[+-]\?\d\+$') != -1 | |
endfunction | |
function! StringToBigint(str) | |
if Isdigit(a:str) != 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reltime: 54.894354 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ./bigint.vim | |
function! Fib(n) abort | |
let [a,b,i] = [FromString("0"),FromString("1"),0] | |
while i < a:n | |
let [a,b,i] = [b,BigAdd(a,b),i+1] | |
endwhile | |
return ToString(a) | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Require: https://github.com/vim-jp/vital.vim | |
let s:big = vital#of('vital').import('Data.BigNum') | |
function! P003() | |
let l:num = s:big.from_string("600851475143") | |
let l:primes = Factorize(l:num) | |
for i in l:primes | |
echo s:big.to_string(i) | |
endfor | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--http://projecteuler.net/problem=1 | |
--If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. | |
--Find the sum of all the multiples of 3 or 5 below 1000. | |
main = do | |
print $ sum [ x | x<-init[1..1000], x`mod`==0 || x`mod`5==0 ] |
OlderNewer