Skip to content

Instantly share code, notes, and snippets.

View stmtk1's full-sized avatar

Motoki saito stmtk1

View GitHub Profile
fn main() {
println!("{}", (0_u128..).into_iter().fold(0, |a, b| a + b));
}
def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
def main():
print("input three integers:")
a = int(input())
b = int(input())
c = int(input())
@stmtk1
stmtk1 / .zshrc
Last active July 26, 2019 02:40
my zshrc
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/Users/saitoumotoki/.zshrc'
autoload -Uz compinit
prev_main = """
#include <iostream>
#include <list>
#include <iterator>
using namespace std;
list<char> a;
list<char>::iterator itr;
class Peano
def self.method_num
instance_methods(false)
.map{ |a| a.to_s}
.filter{ |a| /\Anum\d+\Z/ =~ a }
.size
end
def self.increment
num = self.method_num + 1
const WIDTH = 1000;
const HEIGHT = 700;
let bullets = [];
for(let i = 0; i < 100; ++i){
const mergin = 10;
let x = Math.random() * (WIDTH - mergin * 2) + mergin;
let y = Math.random() * (HEIGHT - mergin * 2) + mergin;
bullets.push({x: x, y: y});
}
const LPAREN = /^\s*\(/;
const RPAREN = /^\s*\)/;
const SPACES = /^\s+/;
const PLUS = /^\s*\+/;
const MINUS = /^\s*\-/;
const MULTI = /^\s*\*/;
const DEVIDE = /^\s*\//;
const NUMBER = /^\s*\d+(\.\d+)?/;
const END = /^\s*$/;
import java.io.InputStream;
import java.io.IOException;
class MyScanner{
InputStream stream;
public MyScanner(){
stream = System.in;
}
public int nextInt(){
@stmtk1
stmtk1 / a.sh
Created February 5, 2019 07:10
bash a.bash
<?php
// Your code here!
const STDIN = fopen('php://stdin', 'r');
class LinkedList {
public $next, $prev, $value;
public function __construct(){
$this->next = null;
$this->prev = null;