Codeforces Round 122 (Div. 1)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
193 Codeforces Round 122 (Div. 1) FINISHED False 7200 393085799 June 3, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4014 ) A Cutting Figure PROGRAMMING constructive algorithms graphs trees 1700

B'You 've gotten an n xe2 x80 x89 xc3 x97 xe2 x80 x89m sheet of squared paper. Some of its squares are painted. Let 's mark the set of all painted squares as A. Set A is connected. Your task is to find the minimum number of squares that we can delete from set A to make it not connected. A set of painted squares is called connected, if for every two squares a and b from this set there is a sequence of squares from the set, beginning in a and ending in b, such that in this sequence any square, except for the last one, shares a common side with the square that follows next in the sequence. An empty set and a set consisting of exactly one square are connected by definition. The first input line contains two space-separated integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8950) -- the sizes of the sheet of paper. Each of the next n lines contains m characters -- the description of the sheet of paper: the j-th character of the i-th line equals either "#", if the corresponding square is painted (belongs to set A), or equals "." if the corresponding square is not painted (does not belong to set A). It is guaranteed that the set of all painted squares A is connected and isn 't empty. On the first line print the minimum number of squares that need to be deleted to make set A not connected. If it is impossible, print -1. In the first sample you can delete any two squares that do not share a side. After that the set of painted squares is not connected anymore. The note to the second sample is shown on the figure below. To the left there is a picture of the initial set of squares. To the right there is a set with deleted squares. The deleted squares are marked with crosses. '...

Tutorials

Editoral Codeforces Round #122

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
1769272 TarasSavitskyi A June 7, 2012, 11:38 a.m. OK Delphi TESTS 65 30 9625600 1700
1769201 TarasSavitskyi A June 7, 2012, 11:03 a.m. OK Delphi TESTS 65 30 9625600 1700
1759162 Golovanov399 A June 3, 2012, 4:55 p.m. OK Delphi TESTS 65 90 3072000 1700
1760647 Depool A June 3, 2012, 5:29 p.m. OK Delphi TESTS 65 90 9420800 1700
1760961 Sereja A June 3, 2012, 5:43 p.m. OK Delphi TESTS 65 90 9420800 1700
1803781 ruban A June 15, 2012, 4:31 a.m. OK Delphi TESTS 65 160 9420800 1700
1762020 Ramp A June 3, 2012, 7:41 p.m. OK Delphi TESTS 65 170 9420800 1700
1754079 tourist A June 3, 2012, 3:36 p.m. OK Delphi TESTS 65 170 9420800 1700
3921389 Misha100896 A June 19, 2013, 4:47 p.m. OK Delphi TESTS 65 171 0 1700
1756085 Timur_Keks A June 3, 2012, 3:59 p.m. OK Delphi TESTS 65 250 9420800 1700
1783330 Saimon_Saret A June 11, 2012, 9:23 a.m. OK FPC TESTS 65 130 1228800 1700
2067817 vilcheuski A Aug. 29, 2012, 8:09 p.m. OK FPC TESTS 65 140 716800 1700
1761935 Omelianenko A June 3, 2012, 7:11 p.m. OK FPC TESTS 65 140 1126400 1700
1758844 Oryshych A June 3, 2012, 4:48 p.m. OK FPC TESTS 65 140 1126400 1700
1802128 zanoes A June 14, 2012, 8:15 a.m. OK FPC TESTS 65 170 1228800 1700
4265194 Nik_Storm_2010 A Aug. 11, 2013, 10 a.m. OK FPC TESTS 65 186 204800 1700
1757865 alexej A June 3, 2012, 4:27 p.m. OK FPC TESTS 65 190 1331200 1700
1762499 hnivhnivt8695 A June 4, 2012, 2:35 a.m. OK FPC TESTS 65 200 1126400 1700
1762416 object022 A June 4, 2012, 1:27 a.m. OK FPC TESTS 65 200 1126400 1700
20224750 ice_tea A Aug. 29, 2016, 7:39 a.m. OK FPC TESTS 65 218 102400 1700
1773774 vjudge2 A June 9, 2012, 3:58 p.m. OK GNU C TESTS 65 30 1638400 1700
38937968 Nikhil_Medam A June 4, 2018, 8:01 a.m. OK GNU C TESTS 65 30 3379200 1700
4281811 helloworld123 A Aug. 15, 2013, 11:29 a.m. OK GNU C TESTS 65 124 102400 1700
3404624 cpy A March 25, 2013, 2:06 p.m. OK GNU C TESTS 65 140 102400 1700
3404595 cpy A March 25, 2013, 1:56 p.m. OK GNU C TESTS 65 140 102400 1700
1757645 kawatea A June 3, 2012, 4:23 p.m. OK GNU C TESTS 65 140 1433600 1700
2905914 noh4h_ss A Jan. 11, 2013, 6:33 p.m. OK GNU C++ TESTS 65 15 102400 1700
4168635 guotj A July 26, 2013, 8:56 a.m. OK GNU C++ TESTS 65 15 204800 1700
3411060 cpy A March 27, 2013, 9:50 a.m. OK GNU C++ TESTS 65 15 204800 1700
13075809 Tanzir5 A Sept. 17, 2015, 8:08 p.m. OK GNU C++ TESTS 65 30 204800 1700
1937197 tomasz.kociumaka A July 24, 2012, 7:49 p.m. OK GNU C++ TESTS 65 30 1536000 1700
1799761 istepura A June 13, 2012, 8:34 a.m. OK GNU C++ TESTS 65 30 1536000 1700
1768257 Alisafe A June 6, 2012, 8:34 p.m. OK GNU C++ TESTS 65 30 1638400 1700
1995170 wo_ A Aug. 9, 2012, 12:21 p.m. OK GNU C++ TESTS 65 30 1638400 1700
1838562 davidmg A June 29, 2012, 2:54 p.m. OK GNU C++ TESTS 65 30 1638400 1700
1786592 dorellin A June 11, 2012, 11:26 p.m. OK GNU C++ TESTS 65 30 1638400 1700
7920057 aliasadiiii A Sept. 23, 2014, 8:53 a.m. OK GNU C++0x TESTS 65 30 204800 1700
9863882 stefanzzz A Feb. 15, 2015, 8:06 p.m. OK GNU C++0x TESTS 65 124 0 1700
7733520 peterpan A Sept. 10, 2014, 8:46 a.m. OK GNU C++0x TESTS 65 124 204800 1700
9219322 mohamed.essam A Dec. 21, 2014, 9:29 p.m. OK GNU C++0x TESTS 65 154 409600 1700
5175814 2011330300713 A Nov. 20, 2013, 11:12 a.m. OK GNU C++0x TESTS 65 156 0 1700
8843500 M.Mahdi A Nov. 25, 2014, 8:27 a.m. OK GNU C++0x TESTS 65 156 102400 1700
1762122 hex539 A June 3, 2012, 8:36 p.m. OK GNU C++0x TESTS 65 160 1536000 1700
1764748 Shapo A June 4, 2012, 6:42 p.m. OK GNU C++0x TESTS 65 170 1536000 1700
10130166 SaDDaS A March 3, 2015, 9 a.m. OK GNU C++0x TESTS 65 186 204800 1700
6972176 himanshubhardwaj169 A June 27, 2014, 10:02 p.m. OK GNU C++0x TESTS 65 186 307200 1700
18241908 mangojunior A June 4, 2016, 9:28 a.m. OK GNU C11 TESTS 65 312 2150400 1700
18244739 mangojunior A June 4, 2016, 2:18 p.m. OK GNU C11 TESTS 65 312 2252800 1700
18051689 mangojunior A May 24, 2016, 6:56 a.m. OK GNU C11 TESTS 65 342 2150400 1700
20535836 Theodor1000 A Sept. 11, 2016, 4:12 p.m. OK GNU C++11 TESTS 65 30 0 1700
27336454 ale A May 25, 2017, 12:32 p.m. OK GNU C++11 TESTS 65 30 204800 1700
15149408 Amirnasr A Jan. 1, 2016, 3:07 p.m. OK GNU C++11 TESTS 65 30 204800 1700
32327186 Mikaeel A Nov. 15, 2017, 8:35 a.m. OK GNU C++11 TESTS 65 30 204800 1700
15217766 hyoussef A Jan. 6, 2016, 8:29 p.m. OK GNU C++11 TESTS 65 30 307200 1700
19426748 gbuenoandrade A July 26, 2016, 4:58 p.m. OK GNU C++11 TESTS 65 30 307200 1700
11610115 MaGaroo A June 16, 2015, 5:14 p.m. OK GNU C++11 TESTS 65 30 409600 1700
15184535 Batman A Jan. 4, 2016, 6:40 p.m. OK GNU C++11 TESTS 65 30 409600 1700
19111121 PMichalak A July 14, 2016, 3:42 p.m. OK GNU C++11 TESTS 65 30 1228800 1700
26742406 _franz_ A April 29, 2017, 7:19 a.m. OK GNU C++11 TESTS 65 30 2252800 1700
29958972 parthlathiya A Aug. 31, 2017, 9 p.m. OK GNU C++14 TESTS 65 30 204800 1700
32336560 sad A Nov. 15, 2017, 3:54 p.m. OK GNU C++14 TESTS 65 30 307200 1700
32292557 Jester A Nov. 13, 2017, 7:04 p.m. OK GNU C++14 TESTS 65 30 409600 1700
35806024 Hepic_Antony_Skarlatos A March 1, 2018, 8:29 a.m. OK GNU C++14 TESTS 65 30 2048000 1700
35443580 Kolyadavydenko A Feb. 18, 2018, 10:57 a.m. OK GNU C++14 TESTS 65 30 2457600 1700
33791881 nitesh_gupta A Dec. 29, 2017, 6:50 p.m. OK GNU C++14 TESTS 65 30 4710400 1700
35442507 snovis007 A Feb. 18, 2018, 10:07 a.m. OK GNU C++14 TESTS 65 30 5324800 1700
31729547 shaheen_bd A Oct. 26, 2017, 6 a.m. OK GNU C++14 TESTS 65 30 12697600 1700
42186317 SAKIB_ALAMIN A Aug. 27, 2018, 9:36 p.m. OK GNU C++14 TESTS 65 60 409600 1700
29201850 nunes A Aug. 4, 2017, 6:36 p.m. OK GNU C++14 TESTS 65 60 2252800 1700
47163965 coder_h A Dec. 17, 2018, 11:33 a.m. OK GNU C++17 TESTS 65 62 204800 1700
64364332 davooddkareshki A Nov. 6, 2019, 12:36 p.m. OK GNU C++17 TESTS 65 62 409600 1700
50451822 willingtonortiz A Feb. 24, 2019, 4:43 p.m. OK GNU C++17 TESTS 65 62 409600 1700
50409719 vjudge5 A Feb. 24, 2019, 1:07 a.m. OK GNU C++17 TESTS 65 62 409600 1700
55654882 Aleksandr_Stark A June 16, 2019, 4:40 p.m. OK GNU C++17 TESTS 65 62 512000 1700
52595395 hp1999 A April 11, 2019, 8:40 a.m. OK GNU C++17 TESTS 65 62 512000 1700
56456937 kanishk779 A July 3, 2019, 4:36 a.m. OK GNU C++17 TESTS 65 62 512000 1700
60507512 tfg A Sept. 13, 2019, 10:57 p.m. OK GNU C++17 TESTS 65 62 512000 1700
54718044 _MGH_ A May 27, 2019, 2:35 p.m. OK GNU C++17 TESTS 65 62 614400 1700
48563750 roll_no_1 A Jan. 19, 2019, 8:34 a.m. OK GNU C++17 TESTS 65 62 716800 1700
66817637 zhanyi_xiaolu A Dec. 14, 2019, 6:22 a.m. OK Java 11 TESTS 65 654 0 1700
1761968 yarrr A June 3, 2012, 7:20 p.m. OK Java 6 TESTS 65 90 43110400 1700
1758333 SergeyLazarev A June 3, 2012, 4:36 p.m. OK Java 6 TESTS 65 230 43417600 1700
1756761 EriKKo A June 3, 2012, 4:10 p.m. OK Java 6 TESTS 65 310 43110400 1700
1760984 uwi A June 3, 2012, 5:44 p.m. OK Java 6 TESTS 65 310 43212800 1700
1764073 coderbd A June 4, 2012, 1:31 p.m. OK Java 6 TESTS 65 330 43417600 1700
1764084 AlexanderBolshakov A June 4, 2012, 1:33 p.m. OK Java 6 TESTS 65 340 43212800 1700
1755227 Kornacker A June 3, 2012, 3:48 p.m. OK Java 6 TESTS 65 340 43212800 1700
1763678 mukku A June 4, 2012, 11:18 a.m. OK Java 6 TESTS 65 360 43315200 1700
1756470 ArtemKadeev A June 3, 2012, 4:05 p.m. OK Java 6 TESTS 65 360 43520000 1700
5970526 alibaba A March 9, 2014, 6:19 p.m. OK Java 6 TESTS 65 372 0 1700
1761964 yarrr A June 3, 2012, 7:19 p.m. OK Java 7 TESTS 65 110 44851200 1700
5590335 upsolving A Dec. 31, 2013, 7:48 a.m. OK Java 7 TESTS 65 124 0 1700
10452489 mkirsche A March 25, 2015, 9:18 p.m. OK Java 7 TESTS 65 186 0 1700
3322249 lawsonh A March 15, 2013, 5:03 p.m. OK Java 7 TESTS 65 218 102400 1700
1761209 jiangzhijie A June 3, 2012, 5:52 p.m. OK Java 7 TESTS 65 310 44851200 1700
1764506 bloops A June 4, 2012, 4:38 p.m. OK Java 7 TESTS 65 380 44851200 1700
1766482 ant.ermilov A June 5, 2012, 6:11 p.m. OK Java 7 TESTS 65 390 44851200 1700
1901619 phantom11 A July 15, 2012, 8:01 p.m. OK Java 7 TESTS 65 390 45158400 1700
5586201 upsolving A Dec. 30, 2013, 6:47 p.m. OK Java 7 TESTS 65 436 0 1700
1763288 littlepanda A June 4, 2012, 8:54 a.m. OK Java 7 TESTS 65 440 45056000 1700
52652471 vaibhavpulastya A April 12, 2019, 5:16 p.m. OK Java 8 TESTS 65 248 0 1700
36430545 ShafinKhadem A March 20, 2018, 11:06 a.m. OK Java 8 TESTS 65 248 20787200 1700
39725368 KulikAlex A June 27, 2018, 6:45 p.m. OK Java 8 TESTS 65 280 0 1700
48544294 Naman_123 A Jan. 18, 2019, 6:26 p.m. OK Java 8 TESTS 65 280 0 1700
53010548 Verdusk A April 19, 2019, 11:54 a.m. OK Java 8 TESTS 65 280 204800 1700
35832909 spar5h A March 2, 2018, 10:50 a.m. OK Java 8 TESTS 65 280 21196800 1700
53968532 prem_cse A May 10, 2019, 7:05 p.m. OK Java 8 TESTS 65 436 0 1700
68679233 mj101 A Jan. 12, 2020, 8:29 p.m. OK Java 8 TESTS 65 436 0 1700
35831715 bhishma A March 2, 2018, 9:54 a.m. OK Java 8 TESTS 65 528 20684800 1700
24093411 zodiacleo A Jan. 24, 2017, 2:27 p.m. OK Java 8 TESTS 65 528 20992000 1700
1808229 EarlOfDitches A June 18, 2012, 5:49 a.m. OK Mono C# TESTS 65 190 11878400 1700
1767848 romario A June 6, 2012, 3:41 p.m. OK Mono C# TESTS 65 300 10035200 1700
1767857 romario A June 6, 2012, 3:45 p.m. OK Mono C# TESTS 65 300 10035200 1700
1775518 yechencheng A June 10, 2012, 2:47 p.m. OK Mono C# TESTS 65 440 11878400 1700
1766832 romario A June 6, 2012, 2:23 a.m. OK Mono C# TESTS 65 560 10035200 1700
1754541 it4.kp A June 3, 2012, 3:41 p.m. OK Mono C# TESTS 65 630 14745600 1700
1756675 AlphaStream A June 3, 2012, 4:08 p.m. OK Mono C# TESTS 65 1830 16179200 1700
23810310 og.kostya A Jan. 14, 2017, 4:20 p.m. OK MS C# TESTS 65 154 13926400 1700
23810279 og.kostya A Jan. 14, 2017, 4:19 p.m. OK MS C# TESTS 65 810 13926400 1700
5660836 Aleksandr_Stark A Jan. 11, 2014, 5:25 p.m. OK MS C++ TESTS 65 30 204800 1700
1765620 vagnard A June 5, 2012, 10:45 a.m. OK MS C++ TESTS 65 30 1638400 1700
1758160 Simplex A June 3, 2012, 4:33 p.m. OK MS C++ TESTS 65 30 1638400 1700
26705356 robinyu A April 27, 2017, 3:09 p.m. OK MS C++ TESTS 65 30 12288000 1700
37667710 andrewting A April 27, 2018, 4:54 p.m. OK MS C++ TESTS 65 62 3686400 1700
1758507 agul A June 3, 2012, 4:40 p.m. OK MS C++ TESTS 65 90 1433600 1700
1763707 NlogN A June 4, 2012, 11:28 a.m. OK MS C++ TESTS 65 90 1433600 1700
1755511 ksjuchi A June 3, 2012, 3:51 p.m. OK MS C++ TESTS 65 90 1536000 1700
1754560 pperm A June 3, 2012, 3:41 p.m. OK MS C++ TESTS 65 90 1536000 1700
11336353 alex-kozinov A May 28, 2015, 5:19 p.m. OK MS C++ TESTS 65 92 102400 1700
29211243 Ostkaka A Aug. 5, 2017, 6:32 a.m. OK PyPy 2 TESTS 65 1776 30515200 1700
32789834 yugle7 A Nov. 29, 2017, 8:22 p.m. OK PyPy 3 TESTS 65 1122 32051200 1700
32790198 yugle7 A Nov. 29, 2017, 8:43 p.m. OK PyPy 3 TESTS 65 1152 31539200 1700
4097339 kachayev A July 18, 2013, 6:41 a.m. OK Python 2 TESTS 65 78 3891200 1700
1758889 nab A June 3, 2012, 4:49 p.m. OK Python 2 TESTS 65 80 5734400 1700

remove filters

Back to search problems