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 |
---|---|---|---|---|---|---|
243 | Codeforces Round 150 (Div. 1) | FINISHED | False | 7800 | 384359387 | Nov. 16, 2012, 3:30 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 222 ) | D | Cubes | PROGRAMMING | data structures dp geometry two pointers | 2700 |
B"One day Petya got a set of wooden cubes as a present from his mom. Petya immediately built a whole city from these cubes. The base of the city is an n xe2 x80 x89 xc3 x97 xe2 x80 x89n square, divided into unit squares. The square's sides are parallel to the coordinate axes, the square's opposite corners have coordinates (0, xe2 x80 x890) and (n, xe2 x80 x89n). On each of the unit squares Petya built a tower of wooden cubes. The side of a wooden cube also has a unit length. After that Petya went an infinitely large distance away from his masterpiece and looked at it in the direction of vector v xe2 x80 x89= xe2 x80 x89(vx, xe2 x80 x89vy, xe2 x80 x890). Petya wonders, how many distinct cubes are visible from this position. Help him, find this number. Each cube includes the border. We think that a cube is visible if there is a ray emanating from some point p, belonging to the cube, in the direction of vector xe2 x80 x89- xe2 x80 x89v, that doesn't contain any points, belonging to other cubes. The first line contains three integers n, vx and vy (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89103, |vx|, xe2 x80 x89|vy| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|104|, |vx| xe2 x80 x89+ xe2 x80 x89|vy| xe2 x80 x89> xe2 x80 x890). Next n lines contain n integers each: the j-th integer in the i-th line aij (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89aij xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i, xe2 x80 x89j xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) represents the height of the cube tower that stands on the unit square with opposite corners at points (i xe2 x80 x89- xe2 x80 x891, xe2 x80 x89j xe2 x80 x89- xe2 x80 x891) and (i, xe2 x80 x89j). Print a single integer -- the number of visible cubes. Please, do not use the %lld specifier to read or write 64-bit integers in xd0 xa1++. It is preferred to use the cin, cout streams or the %I64d specifier."... |
Editorial for Codeforces Round #150 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
10295497 | wjy | D | March 16, 2015, 1:03 a.m. | OK | GNU C++ | TESTS | 40 | 404 | 62566400 | 2700 | |
29251284 | owen_creeper | D | Aug. 7, 2017, 2:17 a.m. | OK | GNU C++ | TESTS | 40 | 1028 | 267059200 | 2700 | |
25138916 | dwjshift | D | March 2, 2017, 2:29 a.m. | OK | GNU C++ | TESTS | 40 | 1184 | 31334400 | 2700 | |
18823735 | Philipsweng | D | June 30, 2016, 12:44 p.m. | OK | GNU C++ | TESTS | 40 | 1434 | 262963200 | 2700 | |
25867396 | vjudge1 | D | March 28, 2017, 7:21 a.m. | OK | GNU C++ | TESTS | 40 | 1464 | 33792000 | 2700 | |
8769944 | zyh | D | Nov. 21, 2014, 12:50 a.m. | OK | GNU C++ | TESTS | 40 | 1528 | 52121600 | 2700 | |
18815450 | TooEasy | D | June 30, 2016, 3:20 a.m. | OK | GNU C++ | TESTS | 40 | 1590 | 92467200 | 2700 | |
6293999 | nsoi_gui | D | April 7, 2014, 10:36 a.m. | OK | GNU C++ | TESTS | 40 | 1714 | 134963200 | 2700 | |
9421116 | Lazycal | D | Jan. 13, 2015, 3:51 a.m. | OK | GNU C++ | TESTS | 40 | 1778 | 44851200 | 2700 | |
18822720 | vjudge4 | D | June 30, 2016, 11:38 a.m. | OK | GNU C++ | TESTS | 40 | 1870 | 36249600 | 2700 | |
2588704 | BSBandme | D | Nov. 19, 2012, 2:45 p.m. | OK | GNU C++0x | TESTS | 40 | 484 | 80179200 | 2700 | |
9098376 | zshi | D | Dec. 13, 2014, 5 a.m. | OK | GNU C++0x | TESTS | 40 | 3430 | 167833600 | 2700 | |
6465389 | nju_v_o_f | D | April 25, 2014, 7:20 a.m. | OK | GNU C++0x | TESTS | 40 | 3710 | 151552000 | 2700 | |
9280266 | equation314 | D | Dec. 27, 2014, 2:56 a.m. | OK | GNU C++0x | TESTS | 40 | 3774 | 144281600 | 2700 | |
2588350 | OpalDshawn | D | Nov. 19, 2012, 12:56 p.m. | OK | GNU C++0x | TESTS | 40 | 3812 | 121446400 | 2700 | |
9280218 | equation314 | D | Dec. 27, 2014, 2:46 a.m. | OK | GNU C++0x | TESTS | 40 | 3960 | 208384000 | 2700 | |
2588340 | OpalDshawn | D | Nov. 19, 2012, 12:53 p.m. | OK | GNU C++0x | TESTS | 40 | 4171 | 121446400 | 2700 | |
2697364 | konstantanter | D | Dec. 5, 2012, 1:59 p.m. | OK | GNU C++0x | TESTS | 40 | 4421 | 151552000 | 2700 | |
2574124 | watashi | D | Nov. 16, 2012, 6:09 p.m. | OK | GNU C++0x | TESTS | 40 | 4468 | 151552000 | 2700 | |
2697369 | konstantanter | D | Dec. 5, 2012, 1:59 p.m. | OK | GNU C++0x | TESTS | 40 | 4875 | 151552000 | 2700 | |
40990497 | ReaLNero1 | D | July 30, 2018, 11:59 p.m. | OK | GNU C++11 | TESTS | 40 | 498 | 80179200 | 2700 | |
44069571 | ywwyww | D | Oct. 10, 2018, 11:10 a.m. | OK | GNU C++11 | TESTS | 40 | 1994 | 57548800 | 2700 | |
18814570 | AcrossTheSky | D | June 30, 2016, 2:10 a.m. | OK | GNU C++11 | TESTS | 40 | 2120 | 33177600 | 2700 | |
18815024 | matthew99 | D | June 30, 2016, 2:49 a.m. | OK | GNU C++11 | TESTS | 40 | 2120 | 94105600 | 2700 | |
14124066 | cly753 | D | Nov. 7, 2015, 12:43 p.m. | OK | GNU C++11 | TESTS | 40 | 2494 | 60108800 | 2700 | |
14124048 | cly753 | D | Nov. 7, 2015, 12:42 p.m. | OK | GNU C++11 | TESTS | 40 | 2524 | 60108800 | 2700 | |
26443455 | vjudge3 | D | April 17, 2017, 1:58 a.m. | OK | GNU C++11 | TESTS | 40 | 2558 | 42393600 | 2700 | |
17129005 | freebsdx | D | April 2, 2016, 11:26 a.m. | OK | GNU C++11 | TESTS | 40 | 2652 | 42393600 | 2700 | |
11731492 | miskcoo | D | June 24, 2015, 5:55 a.m. | OK | GNU C++11 | TESTS | 40 | 2714 | 44032000 | 2700 | |
55061409 | SoiMae | D | June 3, 2019, 11:13 p.m. | OK | GNU C++11 | TESTS | 40 | 2744 | 56729600 | 2700 | |
56794365 | ugly2333 | D | July 10, 2019, 11:56 a.m. | OK | GNU C++14 | TESTS | 40 | 1404 | 41574400 | 2700 | |
25163384 | dujvet | D | March 3, 2017, 6:04 a.m. | OK | GNU C++14 | TESTS | 40 | 1808 | 150323200 | 2700 | |
67271623 | ElangBondol | D | Dec. 20, 2019, 8:33 a.m. | OK | GNU C++14 | TESTS | 40 | 2058 | 108748800 | 2700 | |
56183273 | Scut82 | D | June 28, 2019, 2:20 a.m. | OK | GNU C++14 | TESTS | 40 | 2712 | 121446400 | 2700 | |
23662126 | Ali.Pi | D | Jan. 9, 2017, 7:57 a.m. | OK | GNU C++14 | TESTS | 40 | 2962 | 62054400 | 2700 | |
56795582 | djq_cpp | D | July 10, 2019, 12:24 p.m. | OK | GNU C++14 | TESTS | 40 | 4022 | 132710400 | 2700 | |
21234395 | RVS | D | Oct. 6, 2016, 12:40 p.m. | OK | GNU C++14 | TESTS | 40 | 4054 | 76185600 | 2700 | |
56796830 | little_waxberry | D | July 10, 2019, 12:50 p.m. | OK | GNU C++14 | TESTS | 40 | 4148 | 162918400 | 2700 | |
21234430 | RVS | D | Oct. 6, 2016, 12:41 p.m. | OK | GNU C++14 | TESTS | 40 | 4242 | 76185600 | 2700 | |
36310938 | Dalgerok | D | March 15, 2018, 7:19 p.m. | OK | GNU C++14 | TESTS | 40 | 4398 | 116326400 | 2700 | |
66214806 | hjk1030 | D | Dec. 3, 2019, 8:27 a.m. | OK | GNU C++17 | TESTS | 40 | 2246 | 55808000 | 2700 | |
50997643 | ruo | D | March 8, 2019, 5:01 a.m. | OK | GNU C++17 | TESTS | 40 | 2650 | 64307200 | 2700 | |
56796619 | ppc_qjd | D | July 10, 2019, 12:45 p.m. | OK | GNU C++17 | TESTS | 40 | 3742 | 219340800 | 2700 | |
56809090 | vjudge4 | D | July 10, 2019, 3:12 p.m. | OK | GNU C++17 | TESTS | 40 | 4646 | 96358400 | 2700 | |
62963942 | -is-this-fft- | D | Oct. 20, 2019, 3:11 a.m. | OK | GNU C++17 | TESTS | 40 | 4648 | 142438400 | 2700 | |
2572942 | Egor | D | Nov. 16, 2012, 5:18 p.m. | OK | Java 6 | TESTS | 40 | 4140 | 65945600 | 2700 | |
10198279 | PlayLikeNeverB4 | D | March 7, 2015, 9:37 p.m. | OK | Java 7 | TESTS | 40 | 4240 | 127897600 | 2700 | |
2828453 | FattyPenguin | D | Dec. 26, 2012, 10:02 a.m. | OK | Java 7 | TESTS | 40 | 4421 | 155033600 | 2700 | |
2865180 | seen | D | Jan. 2, 2013, 4:15 a.m. | OK | MS C++ | TESTS | 40 | 1921 | 64819200 | 2700 | |
3132215 | RAD | D | Feb. 15, 2013, 11:38 a.m. | OK | MS C++ | TESTS | 40 | 2781 | 71577600 | 2700 |
Back to search problems