2014-04-29から1日間の記事一覧

UVa11012 Cosmic Cabbages

UVa

問題 http://uva.onlinejudge.org/external/110/11012.html概要 三次元の座標が与えられる。2点間のマンハッタン距離の最大値を求めよ。制約 テストケース 0 点の数 2 解法 人の解説を聞いてコードを見て書いた。まだ良くわかってない。 #include <bits/stdc++.h> using na</bits/stdc++.h>…

UVa11545 Avoiding Jungle in the Dark

UVa

問題 http://uva.onlinejudge.org/external/115/11545.html概要 "S...****................***.D" とかいう感じの道を最短時間で進めという問題。 1マスを1時間で移動することが出来る。 夜は '*' の道を通ることは出来ない。あるマスにいるというのは、そ…

UVa11231 Black and white painting

UVa

問題 http://uva.onlinejudge.org/external/112/11231.html概要 大きな市松模様のうち、8×8の市松模様はいくつあるか。解法 (実はまだよく分かってない) #include <bits/stdc++.h> using namespace std; int countChessBoard(int n, int m) { n -= 7, m -= 7; if(n < 1 </bits/stdc++.h>…