ハノイでハノイの塔書いた

ICPCアジア地区ハノイ大会のためにハノイに来ています

f:id:piroz95:20181128203539j:plain
空港についたときの写真(見えないがNOI BAIターミナルの看板がある)

ハノイの塔

ハノイに現物はないらしい。

public class Hanoi {

	public static void main(String[] args) {
		hanoi(3, 0, 2, 1);
	}

	public static void hanoi(int n, int from, int to, int other) {
		if (n == 1) {
			move(from, to);
			return;
		}
		hanoi(n-1, from, other, to);
		move(from, to);
		hanoi(n-1, other, to, from);
	}

	public static void move(int from, int to) {
		System.out.println(from + "->" + to);
	}

}
0->2
0->1
2->1
0->2
1->0
1->2
0->2

体調を崩した

やばい

先々週くらいのCODE FESTIVALの話

まともな参加記を書けず。
今年で(少なくとも選手としては)最後の参加になるんですが、無事5年間連続出場&5着のパーカーゲットを果たせたのは嬉しかった。
今回も入賞できなかったので賞金は一度ももらえることなく終わった。残念。