##課題2 研究室配属決定問題
###Q.
80名の学生が8つの研究室に配属される。学生が希望順位を申請し,できるだけ希望を叶える配属先を決定する最適解探索問題と考える時,これを全数探索(全ての場合の評価値を計算)する場合の候補数の数を,研究室の定員が10名丁度とする場合と,定員数に制限がない場合(1研究室に80名が集中しても可)について,それぞれ計算せよ
また、毎秒1,000万回評価値を計算できる計算機でどれくらいの時間(もしくは日数や年数)がかかるかをそれぞれ計算せよ
###A.
定員数10とする場合
(aCb) は a個 から b個 を取る組み合わせの数
(80C10) * (70C10) * ... * (10C10)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[uplatex]{jsarticle} | |
\begin{document} | |
吾輩は猫である。名前はまだ無い。 | |
どこで生れたかとんと見当がつかぬ。 | |
何でも薄暗いじめじめした所で | |
ニャーニャー泣いていた事だけは記憶している。 | |
吾輩はここで始めて人間というものを見た。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import json | |
from pprint import pprint | |
from urllib.request import urlopen | |
# | |
def main(): | |
names = "hokkaidou,aomori,iwate,miyagi,akita,yamagata,fukushima,ibaraki,tochigi,gunma,saitama,chiba,tokyo,kanagawa,iigata,toyama,ishikawa,fukui,yamanashi,agano,gifu,shizuoka,aichi,mie,shiga,kyoto,osaka,hyogo,ara,wakayama,tottori,shimane,okayama,hiroshima,yamaguchi,tokushima,kagawa,ehime,kochi,fukuoka,saga,agasaki,kumamoto,oita,miyazaki,kagoshima,okinawa".split(",") | |
names = "tokyo".split(",") | |
# json_data = '{"request":{"type":"json","url":"http:\/\/animemap.net\/time\/table\/hokkaidou\/","updated":"2015-01-10 21:26:06"},"response":{"item":{"title":"\u8266\u968a\u3053\u308c\u304f\u3057\u3087\u3093 -\u8266\u3053\u308c-","url":"http:\/\/animemap.net\/time\/title\/1984\/","time":"26:23","station":"\u5317\u6d77\u9053\u653e\u9001","state":"new","next":"2015-01-10","episode":"?","cable":"0","today":"1","week":"\u571f\u66dc\u65e5"}}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from urllib.request import urlopen | |
from bs4 import BeautifulSoup | |
import sys | |
import os | |
import re | |
''' | |
コンテストトップページの URL を渡すと実行ディレクトリ以下に | |
問題ごとのディレクトリ作成, 問題ページの入力例をファイル出力する | |
ex.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// シリアルポート bps[ビット/秒]で初期化 | |
#define BAUD_BPS 115200 | |
#define LED_PIN 13 | |
void setup(){ | |
pinMode(LED_PIN, OUTPUT); | |
Serial.begin(BAUD_BPS); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys, time | |
from random import choice | |
def main(): | |
match_print_interaction('名前は?', '高橋洸人') | |
match_print_interaction('ニックネーム?', 'えるざっぷ') | |
match_print_interaction('好きなものは?', ['アニメ', 'マイクラ']) | |
match_print_interaction('好きな言語は?', ['PHP', 'Python']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$err = isset($_GET['e']); | |
$ny = date('Y'); | |
$nm = date('n'); | |
ini_set('display_errors', '1'); | |
error_reporting(E_ALL); | |
$room_codes = array( | |
'岩井研11階' => '8011107B0', | |
'岩井研14階' => '801140600', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>text-shadow inset</title> | |
<style> | |
.row { | |
display: -webkit-flex; | |
display: -moz-flex; | |
display: -ms-flex; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from selenium import webdriver | |
import config as cfg | |
import time | |
import sys | |
def clearText(driver, s): | |
driver.find_element_by_css_selector(s).clear() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def main(): | |
im = cv2.imread("./co2.png") | |
w = 32 | |
h = 32 | |
size = (w, h) | |
im2 = cv2.resize(im, size, cv2.cv.CV_INTER_CUBIC) | |