Skip to content

Instantly share code, notes, and snippets.

View kitayuta's full-sized avatar

Yutaka Kitamura kitayuta

View GitHub Profile
@kitayuta
kitayuta / riscv_fib.c
Created October 4, 2016 10:31
$ riscv64-unknown-elf-gcc -S riscv_fib.c
unsigned int fib(unsigned int n)
{
if (n < 2) return n;
else return fib(n - 1) + fib(n - 2);
}
library IEEE;
use IEEE.std_logic_1164.all;
use work.types.all;
entity clock_tb is
end clock_tb;
architecture behavioral of clock_tb is
signal clk : std_logic;
@kitayuta
kitayuta / is_topology.rb
Last active December 11, 2015 23:11
部分集合の族が位相であるか判定するやつ
require 'set'
class Array
def subsets
(0..self.length).flat_map {|n| self.combination(n).to_a}
end
end
def is_topology(x, o)
o.to_a.subsets.all? do |osets|
#include <string>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <unistd.h>
using namespace std;
const string token="yazawa",base="http://not-522.appspot.com/coderunner/";
string query(string url) {
@kitayuta
kitayuta / draw.py
Created October 4, 2014 13:44
Code Formula 2014 本選 F問題 ビジュアライザ
import pygame
from pygame.locals import *
import sys
ssize=(750,750)
pygame.init()
screen=pygame.display.set_mode(ssize)
rs=[]
while True:
screen.fill((255,255,255))
@kitayuta
kitayuta / coqex_3
Last active August 29, 2015 14:00
coqex_3
Coq演習 第3回
@kitayuta
kitayuta / coqex_2
Created April 19, 2014 14:58
coqex_2
Coq演習 第2回
@kitayuta
kitayuta / coqex_1
Last active August 29, 2015 13:59
coqex_1
Coq演習 第1回
#include <cstdio>
#include <algorithm>
#include <vector>
#include <climits>
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
using namespace std;
const int INF=INT_MAX/2;
vector<int> dstmp;
#include <cstdio>
#include <set>
using namespace std;
#define MP make_pair
typedef pair<int,int> P;
typedef pair<P,P> PP;
typedef long long ll;
int vx[]={1,0,-1,0},vy[]={0,1,0,-1};
char ban[1005][1005];