English summary of “Chainer Advent Calendar 2016″

I will summarize Chainer Advent Calendar 2016, to introduce what kind of deep learning projects are going on in Japan. Chainer Deep learning framework, chainer, is developed by Japanese company Preferred Networks and the community is quite active in Japan. Since interesting projects are presented and discussed, I would like to introduce them by summarizing it in English. Advent Calendar In Japan, there is a popular programming blog website called Qiita, and the “Advent Calendar” in Qiita is an event that interested people can join and write a blog for specific theme during Dec 1 to Dec 25. Advent Calendar 2016 Chainer Advent Calendar 2016 If you want to read the […]

Continue reading →

python print, string manipulation summary

  Version difference python 3.x: print() is function and not a keyword anymore. () must be used.

python 2.x: print is considered as a keyword, so () is not necessary.

The above syntax cannot be used in python 3! But you can use future module import if you want to use print as a function for python 3 compatibility.

Summary: It is better to use print() for future compatibility from now on. Ref: What is __future__ in Python used for and how/when to use it, and how it works __future__ モジュールについて Single quotation and double quotation for string There is no difference between ‘word’ and “word” in […]

Continue reading →

AtCoder Grand Contest 007 review

Link AGC 007 top page Editorial I felt you need more invetiveness/creativeness in this contest, and it was difficult.  A – Shik and Stone Problem Compared to ARC (regular contest), it is slightly difficult even from problem A. The most elegant solution is to just check the number of ‘#’ is equal to \(W+H-1\) or not as explained in Editorial. However, I could not notice it so I checked that we can actually go using only right or down or not.

  B – Construct Sequences Problem You need to come up with one construction method which satisfies the 3 conditions. Editorial way is much more easier than below […]

Continue reading →

AtCoder Regular Contest 063 review

Link ARC 063 top page Editorial C – 一次元リバーシ / 1D Reversi Problem  

D – 高橋君と見えざる手 / An Invisible Hand Problem I didn’t notice that there is a restriction that each \(A_i \) is different. So it took time for implementation.

  E – 木と整数 / Integers on a Tree Problem Follow editorial.


Continue reading →

Codeforces Round #378 Div. 2 review

Link Codeforces Round #378 Div. 2 (Contest 733) A. Grasshopper And the String Link: Problem Category: Implementation Even this is a first problem, I get wrong answer for first time submission. It is necessary to consider a corner case at the “end of the text”. Some other solution is inserting extra ‘A’ at the end of text so that you can handle it in the same way. (ex. latte0119’s solution)  

B. Parade Link: Problem Category: math Below implementation is a little bit optimized solution for not to use memory of \(O(N)\), but use \( O(1) \). But in the contest, it is better to consider solve it as fast as possible rather […]

Continue reading →

Codeforces Round #377 Div. 2 review

Link Codeforces Round #377 Div. 2 (Contest 732) A. Buy a Shovel Problem It can be paid without change if the change is 0 or \(r\).

B. Cormen — The Best Friend Of a Man Problem At day \(i\), dog need to walk \( k-a[i-1] \) times.

C. Sanatorium Problem Basic idea to the solution is not difficult, just check all the popssibility of what time start eating (enter room) and what time end eating (exit room). But the corner case handling makes this problem difficult and I cannot answer correctly in one time. Rather than below, more elegant/ short code solution can be found at pekempey’s solution.

D. Exams […]

Continue reading →

AtCoder Regular Contest 062 review

Link ARC 062 top page Editorial C – AtCoDeerくんと選挙速報 / AtCoDeer and Election Report Problem

  D – AtCoDeerくんと変なじゃんけん / AtCoDeer and Rock-Paper Problem

  E – AtCoDeerくんと立方体づくり / Building Cubes with AtCoDeer Problem   Implementation based on Editorial.


Continue reading →

Topcoder SRM 699 Div2 review

Single Round Match 699 Sponsored by Cisco Statistics – Problem Editorial   Div II Level One: UpDownHiking Idea is same with editorial.

  Div II Level Two: LastDigit Category: Arithmetric The approach is different from editorial which uses binary search.

  Div II Level Three: FromToDivisibleDiv2 Category: Arithmetric, graph I couldn’t solve it in contest, so I just followed editorial for my practice.


Continue reading →

Codeforces Round #374 Div. 2 review

Link Codeforces Round #374 Div. 2 (Contest 721) Editorial A. One-dimensional Japanese Crossword Problem Just count consecutive ‘B’ in the sequence.

B. Passwords Problem This is also easy, just count the number for each string length. You even don’t need to process any string manipulation.

C. Journey Problem I felt it is difficult than problem D. During the contest, I tried to solve it by DFS but I got TLE.

To get answer, we can use DP (dynamic programming) to reduce computational complexity as \( O(mn) \).

D. Maxim and Array Problem Basic strategy to get minimum product is as follows, 1. If the product is positive, […]

Continue reading →

Codeforces Round #373 Div. 2 review

Link Codeforces Round #373 Div. 2 (Contest 719) A. Vitya in the Countryside Problem Basically, check last 2 character to determine its direction is “UP” or “DOWN”. Special case comes when the last number is 0 or 15, in that case the direction changes and you can determine the direction without looking second last character.

B. Anatoly and Cockroaches Problem We can consider 2 patterns for final alignment. Pattern 0 is to align “rbrbrb…” and pattern 1 is to align “brbrbr…”. We will compare the original alignment and final alignment. For each position i, we need to change the color to… Case A: r to b Case B: b to r If […]

Continue reading →