2012-09-10から1日間の記事一覧

AOJ0118

AOJ

問題:Property Distribution やるだけ問題。 再帰苦手なので再帰で書いた。 入力がw,hの順じゃなくてh,wの順でWAした。 #include<iostream> using namespace std; int dx[] = {0,0,1,-1}; int dy[] = {1,-1,0,0}; int dfs( char f[110][110] ,char c, int x , int y ) </iostream>…

AOJ0114

AOJ

問題:Electro-Fly mod取ってぐるぐる循環する奴が1周回るのにどれだけかかるかを求める問題。 愚直なループだとTLEするので、x,y,z別に求めてそれの最小公倍数で良い。 O(1)で求める解法ありそうだけどしらん。 #include<iostream> using namespace std; template<class t> t gc</class></iostream>…