Skip to content

Instantly share code, notes, and snippets.

View niyarin's full-sized avatar
💣

Akira Inoue niyarin

💣
View GitHub Profile
@niyarin
niyarin / 2385.py
Last active August 29, 2015 14:02
t,w = raw_input().split(" ")
T,W = int(t),int(w)
apple_data = []
for i in range(int(T)):
apple_data.append(input()-1)
note= [[-1 for j in range(T) ] for i in range(W + 1)]
n = input()
note = [[-1 for i in range(n)] for j in range(n)]
data = []
for i in range(n):
data.append(raw_input().split(" "))
print data
def Foo(x,y):
n = input()
cow_list = []
def eated_flower(list,time,cnt=0):
num = 0
for l in list:
num += l[1 + cnt] * time
return num
c2 = []
while True:
to_dic = {}
path_dic = {}
N = input()
if N==0:
break
@niyarin
niyarin / aoj_1174.py
Last active August 29, 2015 14:03
aoj_1174.py
def Search_friend(fr,pos,cl):
if pos[0] > W - 1 or pos[1] > H - 1 or pos[0] < 0 or pos[1] < 0:
return []
if note[pos[0]][pos[1]] == id:
return []
temp = []
if pos in fr :
@niyarin
niyarin / aoj_1188.cpp
Last active August 29, 2015 14:03
aoj_1188
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(void){
int nest,len;
string S;
(define (caar x) (car (car x )))
(define (cadr x) (car (cdr x )))
(define (cdar x) (cdr (car x )))
(define (cddr x) (cdr (cdr x )))
(define (caaar x) (car (caar x)))
(define (cdaar x) (cdr (caar x)))
(define (caadr x) (car (cadr x)))
(define (cdadr x) (cdr (cadr x)))
(define (cadar x) (car (cdar x)))
(define (cddar x) (cdr (cdar x)))
(define decorate #f)
(let ((pos-seed 1)
(shape-seed 1))
(set! decorate
(lambda (leaves)
(for-each
(lambda (_)
(set! pos-seed (modulo (+ (* pos-seed 3) 7) 26))
(set! shape-seed (modulo (+ shape-seed 1) 3))
(if (< pos-seed (string-length leaves))
@niyarin
niyarin / gen-graph.scm
Last active February 4, 2017 11:57
雑に重み付き有向グラフを生成するやつ
;雑にグラフを生成する
(import (scheme base)(scheme write)(srfi 1)(srfi 27))
(random-source-randomize! default-random-source)
;乱数のリストを生成する
(define (generate-random-integer-list len max-number)
(let loop ((i len))
@niyarin
niyarin / a.scm
Last active April 17, 2017 07:45
(import (scheme base)(scheme write)(scheme cxr)(srfi 1))
(define sample-input
'((x = a * b)
(y = x + c)
(d = a * b)
(e = d - c)
(e = d + c)))