<PREV Problem:
NEXT>
Solved by 183 users: ...
UserDateAttemptTimeCMSC
abortmozga.ru22 jul 2009C++600.15224 
MasterYoda28 jul 2009C++1100.08242 
MasterYoda28 jul 2009C++1200.08242 
abortmozga.ru22 jul 2009C++700.15245 
MasterYoda28 jul 2009C++900.08256 
abortmozga.ru22 jul 2009C++500.15263 
abortmozga.ru22 jul 2009C++300.15270 
MasterYoda28 jul 2009C++1000.08275 
fetetriste22 feb 2010Java600.97286 
abortmozga.ru22 jul 2009C++200.14289 
MasterYoda28 jul 2009C++700.08292 
mak_kbtu23 feb 2010Java200.91302 
mak_kbtu23 feb 2010Java300.91302 
wInuX26 aug 2008Java200.62305 
Tulegenov_Amir06 aug 2007C++1200.14321 
Woland11 may 2010Java900.98325 
Tulegenov_Amir26 jul 2007C++1100.14330 
ethanhunt13 aug 2007C++1600.10334 
Tulegenov_Amir26 jul 2007C++900.14334 
ethanhunt13 aug 2007C++1500.10337 
ethanhunt14 jun 2007C++1200.10338 
Woland11 may 2010Java800.97338 
ethanhunt14 jun 2007C1300.09341 
olzhas_kbtu24 feb 2010Java3401.05351 
Tulegenov_Amir26 jul 2007C++700.12355 
Philip_PV15 jul 2008C200.14358 
Languages
C++
136
C
22
FPC
14
Java
9
Kylix
3
Ruby
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Picture segments

Time limit = 3

Input is BMP-file.

Your program should count number of segments in the picture. Segment is connected domain of unique colored pixels. Two pixels are connected if they have common side. Each pixel in the interior of image has 4 connected pixels.

Picture in input has simple format — BMP picture with 24bit color, no compression used.

Samples of programs, working with such BMP pictures

Input Read from standard input BMP file. It's size less than 2 Mbytes. Height and width of the picture less than 1025.

Output Output to standard output number of segments.

PS:
Redirecting binary file to standard input works properly in Linux. If you use Windows then read from file while debugging your program. But before submiting change input stream(file) to standard input.

Input#1

Output#1
15

Author:
Pasha Agapov & Fedya Chelnokov

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 190ms

SW soft NIX
ID = 35.168.111.191