Upgrade to Pro — share decks privately, control downloads, hide ads and more …

dfs1.pdf

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for mizti mizti
January 10, 2013
600

 dfs1.pdf

Avatar for mizti

mizti

January 10, 2013
Tweet

Transcript

  1. 問題2.細菌コロニーを数えろ • Input: 入力は下記のようなデータセットの連続で与えられます。 w h c 1,1 c 1,2

    ... c 1,w c 2,1 c 2,2 ... c 2,w ... c h,1 c h,2 ... c hw w, hはともに入力の幅と高さを表す40以下の正整数であり、 その後にw × h個のc y,x が並びます。 c y,x は0または1であり、 0は細菌がいないことを、1は細菌が居ることを表します。 隣合う数字同士は半角スペース一つで区切られます。 入力の終わりではw, hがともに0として与えられます。 • Output: 各データセットに対し,コロニーの個数を1行に出力してください。 それ以外の余 計な文字を含んではいけません。
  2. できたら、 [email protected] まで送付お願いします。 Sample Input Sample Output 1 1 0

    2 2 1 1 1 0 3 3 1 0 1 0 1 0 1 0 1 6 4 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 5 2 問題2.細菌コロニーを数えろ