問題 D: Maximum Average Sets - AtCoder Beginner Contest 057 | AtCoder N(1 <= N <= 50)個の品物が与えられ、それぞれの品物には価値Vi(1 <= i <= N)が設定されている。A個以上、B以下の品物を取ることが出来る時、選択した品物の価値の最大の平均値と、…
問題 C: Digits in Multiplication - AtCoder Beginner Contest 057 | AtCoder 整数N(1 <= N <= 1010)が与えられ、A * B = Nを満たすA, BについてF(A, B)の値が最小となるものを出力する問題。ここで、F(A, B)とはAとBの桁数を比べ小さい方の桁数を返り値す…
Introduction Here is the article of the last time class. keita-matsushita.hatenablog.com Matrix Expression of Graphs and Paths Graphs can be expressed by matrixes. Below matrixes express above the graph. Incidence matrix (接続行列) Cols re…
はじめに 前回の記事はこちら 【Deep Learning お勉強 #2】パーセプトロンを実装してみよう - マツシタケイタの技術ブログ(勉強中) 今回はニューラルネットワークについて触れる。 パーセプトロンからニューラルネットワークへ 復習も兼ねてパーセプトロンの…
はじめに この記事はパーセプトロンを実際に簡単な例を使って実装してみようというもの。 パーセプトロン自体の説明は以下の記事を参照。 keita-matsushita.hatenablog.com 論理回路をパーセプトロンで表現する 以下のテーブルはANDゲートの真偽値表である。…
はじめに 『ゼロから作るDeep Learning』という本を読み、得た知識などをメモとしてを書き記す。 また、この記事はパーセプトロンというアルゴリズムについてまとめる。 どうやら、パーセプトロンというものは、ディープラーニングの起源となるアルゴリズム…
グラフとは何か グラフは以下のコンポーネントで成り立つ。 節点、頂点: 対象物(スイッチ、ルータ) Node, Vertex: Objectives(Switch, Router) 枝、辺: 接点間の関係(伝送路) Branch, Edge: Relation among nodes(Transmission lines) つまり、グラフとは節…
ソースコード シングルトンを使って実装する。 参考 stackoverflow.com
B - 2点間距離の最大と最小 ( Maximum and Minimum ) B: 2点間距離の最大と最小 ( Maximum and Minimum ) - AtCoder Regular Contest 004 | AtCoder N + 1個(0 ~ N)点がx,y平面上にある時、i番目の点とi+1番目の点との距離が与えられる(0 <= i < N)。 この時…
A - 2点間距離の最大値 ( The longest distance ) A: 2点間距離の最大値 ( The longest distance ) - AtCoder Regular Contest 004 | AtCoder N個のx,y座標が与えられ、任意の2つの点の距離が最大となる値を出力する問題 解法 与えられる点の数がN(2 <= N <…
APIKitとは GitHub - ishkawa/APIKit: Type-safe networking abstraction layer that associates request type with response type. Himotokiとは GitHub - ikesyo/Himotoki: A type-safe JSON decoding library purely written in Swift 単一のモデルをデコ…
ポートベースVLANとタグベースVLAN VLANとは、物理的にには1つのネットワークを理論的に複数のネットワークに分ける技術。 営業部が入居するオフィスに、経理部も同居することになった時、LAN配線は既存のもの使いながら、営業部と経理部とであたかも別の2…
可変長サブネットマスクとCIDR 可変長サブネットマスク サブネット毎に、サビネットマスクの長さを変えることができる技術。サブネットマスクの長さを自由に変えられるようになると、サブネット毎に接続するコンピュータ数を柔軟に決める事ができる。 CIDR …
TCP/IP コンピュータネットワークで広く用いられている通信プロトコル。TCP(Transmission Control Protocol)とIP(Internet Protocol)と呼ばれるプロトコルのセット。 TCP/IPのレイヤー構成 アプリケーション層 ... 具体的な通信サービスを実現する トランス…
ネットワークとは ネットワークの働きは「アプリ同士が何かを行うためにデータをやり取りできるようにしてやること」。 それを実現するために、データを配送するためのルールや、使用する機器や通信媒体、サービス毎に決められたデータの形式や手順を覚えれ…
Problem leetcode.com 与えられたInt型の配列numsの要素の内、3つ選んだ要素の和がtargetに最も近い値を見つける問題。 Solution 全列挙によるO(N3)の解法 配列の全ての3つの要素の和を算出し、その中から一番targetに近い値を見つける事で問題を解くこと…
Problem discuss.leetcode.com Solution This problem can be solved by using HashMap effectively. First, we store each sum of range from 0 to i (0 <= i < N). While we traverse the array, we check if the (sum - k) is stored in HashMap. If the …
Problem https://leetcode.com/problems/alien-dictionary/?tab=Description Solution This problem can be solved by using Topological Sort.
Problem leetcode.com Source Code
Problem leetcode.com Source Code
Problem leetcode.com Solution This problem can be solve by DFS with depth of tree. In my code, lists.size() == depth means that the traversing depth changes. Source Code
Problem leetcode.com Solution This problem can be solved effectively by using bit manipulation. We can manage the count of appearance of each letters. Lower case letters are transformed to Integer within 26. This takes 0(N2) time. Source C…
クラウドにおける可用性とは 「可用性(Availability)」とはシステムが継続して稼働できる能力の事。システムを稼働しているサーバーや、データを保存しておくデータベースが1つで設計されている場合、その1つが落ちた場合にシステムが止まってしまう。これ…
Problem leetcode.com 与えられた配列において、任意の3点の和がゼロとなる組合せを全て取得する問題。 Solution この問題は以下のように解くことができる。 任意の3点をstart, middle, endと置く(start < middle < end) startを固定し、middle = start + …
問題 D: Mixing Experiment - AtCoder Beginner Contest 054 | AtCoder 解き方 全列挙を考える 全列挙する場合、i番目の薬品を購入する場合としない場合を2パターンをN回行うので、計算量はO(2N)となりNは最大40なので間に合わない。 動的計画法を使う dp(i…
どの部分の要素を既に使用したかをbitを用いて管理する
Problem www.hackerrank.com This problem is that we calculate median of array the range is from 0 to ith. Solution By using Two Priority Queues: minHeap and maxHeap, we can solve this problem. The roles of them are following. minHeap : To s…
What is Trie Tree Trie Tree is one of the tree structure to search element. The feature of this tree that each node dose not have element information, but also each edge has element information. Trie tree is used to search String like dict…
What is Heap Reference www.youtube.com Heap is the tree structure that has two following restrictions. Binary Tree Parent node is smaller or bigger than children nodes. Heap is good at controlling the relation about small and large. So hea…