Skip to content

Instantly share code, notes, and snippets.

View ria3100's full-sized avatar

Ria ria3100

View GitHub Profile
@ria3100
ria3100 / cloud-init-util.py
Last active November 21, 2021 07:45
python3.9-cloud-init-util.py
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yahoo-inc.com>
#
# This file is part of cloud-init. See LICENSE file for license information.
@ria3100
ria3100 / config.js
Created June 26, 2019 03:08
hyper.js config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@ria3100
ria3100 / reversi.py
Last active April 26, 2016 07:51
AtCoder C - オセロ
# coding: utf-8
# http://abc035.contest.atcoder.jp/tasks/abc035_c
N, Q = map(int, input().split())
piece = 0b0
for _ in range(Q):
l, r = map(int, input().split())
tmp = ['1' if l <= x <= r else '0' for x in range(1, N+1)]
@ria3100
ria3100 / zundoko.py
Created March 18, 2016 03:06
ズンドコキヨシ
'''
[‘ズン’, ‘ドコ’]のいずれかをランダムで出力し続け
どこかで「ズンズンズンズンドコ」に一致したら「キヨシ」を出力して終了する問題
twitterで先頭に
@paiza_run python3:
を含めツイート出来るバイト数にする。
'''
# coding: utf-8
@ria3100
ria3100 / crease.py
Last active May 29, 2017 09:06
紙を折った回数Nに応じて山折り、谷折りの数をカウントする
# coding: utf-8
'''
紙を上記のように折る回数Nが与えられるので
紙を折って広げたあとの山折り谷折りの折り目を計算する
プログラムを作成してください。
http://paiza.hatenablog.com/entry/2016/02/15/ITエンジニアを目指す学生が、就活を有利に進める
'''
'''
@ria3100
ria3100 / fiveballs.py
Created February 5, 2016 05:06
5つの玉を並べて隣り合うものの和が1〜21になる組み合わせを答える問題
# coding: utf-8
'''
「さて 、では 、もう一つ問題を出そう 。
五つのビリヤ ードの玉を 、真珠のネックレスのように 、リングにつなげてみるとしよう 。
玉には 、それぞれナンバが書かれている 。
さて 、この五つの玉のうち 、幾つ取っても良いが 、隣どうし連続したものしか取れないとしよう 。
一つでも 、二つでも 、五つ全部でも良い 。しかし 、離れているものは取れない 。
この条件で取った玉のナンバを足し合わせて 、 1から 2 1までのすべての数ができるようにしたい 。
さあ 、どのナンバの玉を 、どのように並べて 、ネックレスを作れば良いかな ?」
@ria3100
ria3100 / main.py
Last active October 2, 2017 21:43
Paiza:長テーブルのうなぎ屋 (paizaランク B 相当)
# coding: utf-8
# Paiza Lerning 長テーブルのうなぎ屋 (paizaランク B 相当)
# https://paiza.jp/learning/long-table
n, m = map(int, input().split())
seat = 0
for i in range(m):
a, b = map(int, input().split())
@ria3100
ria3100 / Main.hs
Created December 16, 2015 09:49
Haskell FizzBuzz
fizzbuzz :: Int -> String
fizzbuzz n
| n `mod` 15 == 0 = "fizzbuzz"
| n `mod` 3 == 0 = "fizz"
| n `mod` 5 == 0 = "buzz"
| otherwise = show n
main = do
print $ map fizzbuzz [1..30]