Skip to content

Instantly share code, notes, and snippets.

View kira924age's full-sized avatar

Akira Kunishige kira924age

View GitHub Profile
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from PIL import Image
gif0 = Image.open('fuga-0.gif')
gif1 = Image.open('fuga-1.gif')
gif2 = Image.open('fuga-2.gif')
gif3 = Image.open('fuga-3.gif')
gif4 = Image.open('fuga-4.gif')
@kira924age
kira924age / bin2hex.py
Created August 28, 2014 17:01
2進数文字列を16進数文字列に変換する。(format(int(hoge, 2), 'x')が使えないとき用)
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
argv = sys.argv
argc = len(argv)
if argc != 2:
print 'Usage: python bin2hex.py [file_name]'
@kira924age
kira924age / hex.c
Last active November 22, 2022 15:32
Hexdump and Reverse Hexdump by C and Python.
#include <stdio.h>
int main(int argc, char *argv[])
{
int n;
unsigned long long int count = 0;
FILE *fp;
if(argc != 2){
puts("Usage: hex [file_name]");
@kira924age
kira924age / caesar.c
Last active August 29, 2015 14:01
Just rot Alphabet.
#include <stdio.h>
#define key 13
int main()
{
char c;
while(scanf("%c",&c) != EOF){
if('A' <= c && c <= 'Z' ){
if((c+key) > 'Z')
c += (key%26-26);
@kira924age
kira924age / typing_cui_01.c
Last active August 29, 2015 14:01
簡単なタイピングゲーム
#include <time.h>
#include <conio.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#define Qnumber 20
int main(){
@kira924age
kira924age / ARC022_B.c
Last active January 2, 2016 07:34
尺取法
/*http://arc022.contest.atcoder.jp/tasks/arc022_2*/
#include <stdio.h>
#define max(a, b) ((a > b) ? a : b)
int main(){
int N, A[100001], S[100001]={0};
int ans=0, r=0, l;
scanf("%d", &N);
@kira924age
kira924age / gojoho.c
Last active January 2, 2016 06:39
拡張版ユークリッドの互除法 84x + 11y = 1 (y > 0)
#include <stdio.h>
int main()
{
int L = 84, e = 11;
int x, x2, y, y2, z, z2, q;
int tmp;
x = 1;
y = 0;
@kira924age
kira924age / case2.c
Last active December 27, 2015 00:08
標準入出力の場合
#include <stdio.h>
int main()
{
int L, a, b, c, d;
int M, N;
scanf("%d\n%d\n%d\n%d\n%d\n",&L, &a, &b, &c, &d);
M = a/c;
N = b/d;
if(a % c != 0)
@kira924age
kira924age / case1.c
Last active December 26, 2015 23:59
ファイルの入出力の場合
#include <stdioh.h>
#include <stdlib.h>
int main()
{
FILE *infile, *outfile;
int L, a, b, c, d;
int M, N;
infile = fopen("in1.txt","r");