Codeforces Round 501 (Div. 3)

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
1015 Codeforces Round 501 (Div. 3) FINISHED False 7200 198775499 July 31, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3628 ) E2 Stars Drawing (Hard Edition) PROGRAMMING binary search dp greedy 2000

B'A star is a figure of the following type: an asterisk character '* ' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star must be a positive number (i.e. rays of length 0 are not allowed). Let 's consider empty cells are denoted by '. ', then the following figures are stars: You are given a rectangular grid of size n x m consisting only of asterisks '* ' and periods (dots) '. '. Rows are numbered from 1 to n , columns are numbered from 1 to m . Your task is to draw this grid using any number of stars or find out that it is impossible. Stars can intersect, overlap or even coincide with each other. The number of stars in the output can 't exceed n cdot m . Each star should be completely inside the grid. You can use stars of same and arbitrary sizes. In this problem, you do not need to minimize the number of stars. Just find any way to draw the given grid with at most n cdot m stars. The first line of the input contains two integers n and m ( 3 <= n, m <= 1000 ) -- the sizes of the given grid. The next n lines contains m characters each, the i -th line describes the i -th row of the grid. It is guaranteed that grid consists of characters '* ' and '. ' only. If it is impossible to draw the given grid using stars only, print "-1". Otherwise in the first line print one integer k ( 0 <= k <= n cdot m ) -- the number of stars needed to draw the given grid. The next k lines should contain three integers each -- x_j , y_j and s_j , where x_j is the row index of the central star character, y_j is the column index of the central star character and s_j is the size of the star. Each star should be completely inside the grid. In the first example the output is also correct. '...

Tutorials

60949

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41542825 rr_ E2 Aug. 13, 2018, 1:44 a.m. OK D TESTS 46 717 97075200 2000
41091220 ruban E2 Aug. 1, 2018, 4:45 p.m. OK Delphi TESTS 46 483 132608000 2000
41508021 kokarev E2 Aug. 11, 2018, 10:44 p.m. OK GNU C TESTS 46 436 60211200 2000
41573632 stdio2016 E2 Aug. 14, 2018, 2 a.m. OK GNU C TESTS 46 482 9011200 2000
41231112 170104100115 E2 Aug. 5, 2018, 3:06 a.m. OK GNU C++ TESTS 46 389 29286400 2000
41677265 veilman E2 Aug. 17, 2018, 8:44 a.m. OK GNU C++ TESTS 46 389 37376000 2000
41126043 swunHJ E2 Aug. 2, 2018, 2:18 p.m. OK GNU C++ TESTS 46 405 42496000 2000
41677396 vjudge4 E2 Aug. 17, 2018, 8:49 a.m. OK GNU C++ TESTS 46 405 44236800 2000
41128491 xingdapai E2 Aug. 2, 2018, 3:40 p.m. OK GNU C++ TESTS 46 405 44236800 2000
41294348 shuai_hui E2 Aug. 7, 2018, 6:15 a.m. OK GNU C++ TESTS 46 405 48230400 2000
41109720 SFD_Cle E2 Aug. 2, 2018, 6:14 a.m. OK GNU C++ TESTS 46 420 37068800 2000
41306562 H_Love_J E2 Aug. 7, 2018, 1:24 p.m. OK GNU C++ TESTS 46 420 48230400 2000
41414394 201612201402013 E2 Aug. 10, 2018, 12:57 a.m. OK GNU C++ TESTS 46 421 33792000 2000
41796670 vjudge1 E2 Aug. 18, 2018, 5:02 p.m. OK GNU C++ TESTS 46 421 48537600 2000
55236408 Umi E2 June 7, 2019, 8:41 a.m. OK GNU C++11 TESTS 46 124 44134400 2000
67181625 MoQianXue E2 Dec. 19, 2019, 12:03 a.m. OK GNU C++11 TESTS 46 124 47513600 2000
56515267 vjudge2 E2 July 4, 2019, 12:25 p.m. OK GNU C++11 TESTS 46 327 48537600 2000
61761402 luogu_bot5 E2 Oct. 3, 2019, 7:13 a.m. OK GNU C++11 TESTS 46 342 21196800 2000
58518973 Frame233 E2 Aug. 10, 2019, 2:54 a.m. OK GNU C++11 TESTS 46 342 22220800 2000
49447168 wdyd2004 dreamr E2 Feb. 4, 2019, 4:17 a.m. OK GNU C++11 TESTS 46 342 25088000 2000
44340559 caoyue E2 Oct. 15, 2018, 3:01 a.m. OK GNU C++11 TESTS 46 342 25395200 2000
44433390 bj80ljh E2 Oct. 17, 2018, 8:45 a.m. OK GNU C++11 TESTS 46 342 44236800 2000
62107649 WA_A_PLAYER E2 Oct. 8, 2019, 11:18 a.m. OK GNU C++11 TESTS 46 342 44953600 2000
45881344 hohomu E2 Nov. 17, 2018, 2:04 p.m. OK GNU C++11 TESTS 46 342 48230400 2000
67550827 wleung_bvg E2 Dec. 24, 2019, 4:10 p.m. OK GNU C++14 TESTS 46 233 36352000 2000
45587324 euzmin E2 Nov. 12, 2018, 9:49 a.m. OK GNU C++14 TESTS 46 280 17408000 2000
69165066 vjudge5 E2 Jan. 20, 2020, 3:10 a.m. OK GNU C++14 TESTS 46 280 25190400 2000
45443257 myx12345 E2 Nov. 8, 2018, 12:11 p.m. OK GNU C++14 TESTS 46 280 49664000 2000
46304951 introverted E2 Nov. 28, 2018, 9:31 a.m. OK GNU C++14 TESTS 46 295 29696000 2000
50290035 SsSsoOoOoOo E2 Feb. 21, 2019, 4:58 p.m. OK GNU C++14 TESTS 46 296 44544000 2000
51552311 Jason_YJie E2 March 20, 2019, 1:54 a.m. OK GNU C++14 TESTS 46 311 44544000 2000
45515082 Hahahahahahahhahaha E2 Nov. 10, 2018, 2:42 p.m. OK GNU C++14 TESTS 46 311 44544000 2000
66637695 refatm452 E2 Dec. 11, 2019, 1:34 p.m. OK GNU C++14 TESTS 46 311 45158400 2000
45514637 Hahahahahahahhahaha E2 Nov. 10, 2018, 2:41 p.m. OK GNU C++14 TESTS 46 312 32563200 2000
41095900 ReaLNero1 E2 Aug. 1, 2018, 7:31 p.m. OK GNU C++17 TESTS 46 187 46182400 2000
41093836 2kan E2 Aug. 1, 2018, 6:08 p.m. OK GNU C++17 TESTS 46 187 46182400 2000
42138577 hnust_yuanquan E2 Aug. 27, 2018, 2:44 a.m. OK GNU C++17 TESTS 46 202 55193600 2000
54074428 m1sch3f E2 May 13, 2019, 6:40 p.m. OK GNU C++17 TESTS 46 234 34201600 2000
52675253 wcl95716 E2 April 13, 2019, 9:17 a.m. OK GNU C++17 TESTS 46 280 33382400 2000
52592178 K0u1e E2 April 11, 2019, 6:31 a.m. OK GNU C++17 TESTS 46 296 25600000 2000
46277819 endereye E2 Nov. 27, 2018, 11:48 a.m. OK GNU C++17 TESTS 46 296 33484800 2000
56606117 Yzm007 E2 July 6, 2019, 4:45 a.m. OK GNU C++17 TESTS 46 296 35430400 2000
56608276 Yzm007 E2 July 6, 2019, 6:02 a.m. OK GNU C++17 TESTS 46 296 37478400 2000
56731082 forestj E2 July 9, 2019, 1:24 a.m. OK GNU C++17 TESTS 46 296 44236800 2000
42093278 Marii E2 Aug. 25, 2018, 2:31 p.m. OK Go TESTS 46 623 90931200 2000
41736160 synapse E2 Aug. 18, 2018, 2:32 a.m. OK Go TESTS 46 1153 55398400 2000
41736305 synapse E2 Aug. 18, 2018, 2:37 a.m. OK Go TESTS 46 1170 55500800 2000
41529665 tusupov E2 Aug. 12, 2018, 1:49 p.m. OK Go TESTS 46 2916 43110400 2000
69823930 GiantTornado E2 Jan. 30, 2020, 8:41 a.m. OK Java 11 TESTS 46 763 105267200 2000
62667799 saurabhs1206 E2 Oct. 16, 2019, 8:30 a.m. OK Java 8 TESTS 46 358 118784000 2000
41120403 antkhorin E2 Aug. 2, 2018, 11:39 a.m. OK Java 8 TESTS 46 373 17612800 2000
48766525 hongquanntct E2 Jan. 22, 2019, 7:38 p.m. OK Java 8 TESTS 46 374 86016000 2000
42019254 barakraganosungam E2 Aug. 24, 2018, 8:11 a.m. OK Java 8 TESTS 46 374 108953600 2000
55544085 O_E E2 June 13, 2019, 11:21 p.m. OK Java 8 TESTS 46 389 126464000 2000
41098499 4mda4mda E2 Aug. 1, 2018, 9:57 p.m. OK Java 8 TESTS 46 498 38604800 2000
47490098 kusomushi E2 Dec. 25, 2018, 11:34 a.m. OK Java 8 TESTS 46 499 70860800 2000
41132136 T_36_mouse E2 Aug. 2, 2018, 6:04 p.m. OK Java 8 TESTS 46 530 17100800 2000
41092445 tusharjape007 E2 Aug. 1, 2018, 5:23 p.m. OK Java 8 TESTS 46 576 73420800 2000
52284273 mikkk E2 April 3, 2019, 6:47 p.m. OK Java 8 TESTS 46 608 57548800 2000
41664383 Mosyagin E2 Aug. 16, 2018, 8:56 p.m. OK Mono C# TESTS 46 748 120422400 2000
62159975 NEvOl E2 Oct. 8, 2019, 5:55 p.m. OK Mono C# TESTS 46 873 108646400 2000
62160188 NEvOl E2 Oct. 8, 2019, 5:59 p.m. OK Mono C# TESTS 46 889 108544000 2000
62163500 NEvOl E2 Oct. 8, 2019, 7:07 p.m. OK Mono C# TESTS 46 904 108544000 2000
44811787 NEvOl E2 Oct. 24, 2018, 6:41 p.m. OK Mono C# TESTS 46 967 107315200 2000
41195161 jainchethan87 E2 Aug. 3, 2018, 11:49 p.m. OK Mono C# TESTS 46 1013 162918400 2000
41664365 Mosyagin E2 Aug. 16, 2018, 8:54 p.m. OK Mono C# TESTS 46 2667 58675200 2000
41151303 Mickey-snow E2 Aug. 3, 2018, 9:01 a.m. OK Mono C# TESTS 46 2792 76492800 2000
41158107 user3301 E2 Aug. 3, 2018, 1:29 p.m. OK Mono C# TESTS 46 2869 48844800 2000
41541514 MenOfPassion E2 Aug. 13, 2018, 12:18 a.m. OK MS C++ TESTS 46 436 50892800 2000
41273477 wuli_zhaojing_ya E2 Aug. 6, 2018, 11:54 a.m. OK MS C++ TESTS 46 592 28672000 2000
46102954 Houbunsha E2 Nov. 23, 2018, 7:14 a.m. OK MS C++ TESTS 46 1076 32870400 2000
41568954 _mactep E2 Aug. 13, 2018, 7:33 p.m. OK MS C++ TESTS 46 1184 33996800 2000
49529581 vjudge3 E2 Feb. 6, 2019, 1:13 p.m. OK MS C++ TESTS 46 1528 17100800 2000
42301015 vjudge1 E2 Aug. 31, 2018, 7:43 a.m. OK MS C++ TESTS 46 1622 14336000 2000
51419789 vjudge3 E2 March 17, 2019, 3:54 p.m. OK MS C++ TESTS 46 1637 23654400 2000
41092598 rkill E2 Aug. 1, 2018, 5:27 p.m. OK MS C++ TESTS 46 1731 47923200 2000
42305470 vjudge3 E2 Aug. 31, 2018, 10:55 a.m. OK MS C++ TESTS 46 1871 52531200 2000
42305497 vjudge1 E2 Aug. 31, 2018, 10:56 a.m. OK MS C++ TESTS 46 1918 52633600 2000
58361702 Yanhui E2 Aug. 6, 2019, 1:09 a.m. OK MS C++ 2017 TESTS 46 483 50176000 2000
58419858 yorky E2 Aug. 7, 2019, 7:13 a.m. OK MS C++ 2017 TESTS 46 1777 70348800 2000
54982075 Skeef79 E2 June 2, 2019, 1:41 p.m. OK MS C++ 2017 TESTS 46 2823 22732800 2000
50995102 pajenegod E2 March 8, 2019, 2:58 a.m. OK PyPy 2 TESTS 46 483 78336000 2000
41289234 orailly E2 Aug. 7, 2018, 12:56 a.m. OK PyPy 3 TESTS 46 1574 112537600 2000
45673430 r57shell E2 Nov. 13, 2018, 11:54 a.m. OK PyPy 3 TESTS 46 2277 200396800 2000
56771278 titia E2 July 9, 2019, 10:09 p.m. OK PyPy 3 TESTS 46 2292 229580800 2000
41132929 Stephan E2 Aug. 2, 2018, 6:35 p.m. OK PyPy 3 TESTS 46 2776 190566400 2000
52501603 aleonov E2 April 8, 2019, 4:23 p.m. OK Python 3 TESTS 46 2854 97382400 2000
41661912 leoniduvk E2 Aug. 16, 2018, 6:43 p.m. OK Rust TESTS 46 483 54169600 2000
46452210 yakamoto E2 Dec. 1, 2018, 4 p.m. OK Scala TESTS 46 826 26726400 2000

remove filters

Back to search problems