MemSQL Start[c]UP 3.0 - Round 2 (onsite finalists)

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
865 MemSQL Start[c]UP 3.0 - Round 2 (onsite finalists) FINISHED False 10800 225032099 Sept. 30, 2017, 5:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5729 ) D Buy Low Sell High PROGRAMMING constructive algorithms data structures greedy 2300

B"You can perfectly predict the price of a certain stock for the next N days. You would like to profit on this knowledge, but only want to transact one share of stock per day. That is, each day you will either buy one share, sell one share, or do nothing. Initially you own zero shares, and you cannot sell shares when you don't own any. At the end of the N days you would like to again own zero shares, but want to have as much money as possible. Input begins with an integer N (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89N xe2 x80 x89 xe2 x89 xa4 xe2 x80 x893 xc2 xb7105), the number of days. Following this is a line with exactly N integers p1, xe2 x80 x89p2, xe2 x80 x89..., xe2 x80 x89pN (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106). The price of one share of stock on the i-th day is given by pi. Print the maximum amount of money you can end up with at the end of N days. In the first example, buy a share at 5, buy another at 4, sell one at 9 and another at 12. Then buy at 2 and sell at 10. The total profit is xe2 x80 x89- xe2 x80 x895 xe2 x80 x89- xe2 x80 x894 xe2 x80 x89+ xe2 x80 x899 xe2 x80 x89+ xe2 x80 x8912 xe2 x80 x89- xe2 x80 x892 xe2 x80 x89+ xe2 x80 x8910 xe2 x80 x89= xe2 x80 x8920. "...

Tutorials

MemSQL Start[c]UP 3.0 Round 2 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
32452548 hochocmai D Nov. 19, 2017, 9:32 a.m. OK FPC TESTS 29 78 2764800 2300
65027893 ptmaiphuong91 D Nov. 15, 2019, 8:33 a.m. OK FPC TESTS 29 93 1228800 2300
64510788 hello327 D Nov. 8, 2019, 8:45 a.m. OK FPC TESTS 29 93 1228800 2300
64510540 tan12341 D Nov. 8, 2019, 8:40 a.m. OK FPC TESTS 29 93 2662400 2300
32613830 ThuanPhongnbk D Nov. 24, 2017, 8:04 a.m. OK FPC TESTS 29 93 2764800 2300
46296370 hp2k1 D Nov. 28, 2018, 3:17 a.m. OK FPC TESTS 29 93 3993600 2300
64510542 BigSister0602 D Nov. 8, 2019, 8:40 a.m. OK FPC TESTS 29 93 5017600 2300
46295881 colen D Nov. 28, 2018, 2:32 a.m. OK FPC TESTS 29 108 4812800 2300
64511492 BC_Khanh D Nov. 8, 2019, 8:59 a.m. OK FPC TESTS 29 109 2662400 2300
64512104 ptmaiphuong91 D Nov. 8, 2019, 9:11 a.m. OK FPC TESTS 29 109 80384000 2300
33155639 vjudge1 D Dec. 12, 2017, 1:06 p.m. OK GNU C++ TESTS 29 46 3276800 2300
33155165 vjudge1 D Dec. 12, 2017, 12:49 p.m. OK GNU C++ TESTS 29 46 4300800 2300
35597965 M_sy D Feb. 23, 2018, 1:33 p.m. OK GNU C++ TESTS 29 61 5222400 2300
39533272 pufanyi D June 23, 2018, 6 a.m. OK GNU C++ TESTS 29 62 6144000 2300
39534311 yyhhenry D June 23, 2018, 7 a.m. OK GNU C++ TESTS 29 62 6348800 2300
39534259 zhoudong D June 23, 2018, 6:58 a.m. OK GNU C++ TESTS 29 62 6348800 2300
39534244 zhoudong D June 23, 2018, 6:57 a.m. OK GNU C++ TESTS 29 62 6348800 2300
39533258 sxd666 D June 23, 2018, 6 a.m. OK GNU C++ TESTS 29 62 6348800 2300
39533235 luogu_bot4 D June 23, 2018, 5:59 a.m. OK GNU C++ TESTS 29 62 6348800 2300
39534301 luogu_bot2 D June 23, 2018, 7 a.m. OK GNU C++ TESTS 29 62 15872000 2300
45411424 Mirach D Nov. 7, 2018, 12:14 p.m. OK GNU C++11 TESTS 29 46 2457600 2300
45411052 luogu_bot5 D Nov. 7, 2018, 12:04 p.m. OK GNU C++11 TESTS 29 46 2457600 2300
52080989 White_Devil D March 31, 2019, 12:10 p.m. OK GNU C++11 TESTS 29 46 3072000 2300
59789293 luogu_bot5 D Aug. 31, 2019, 6:39 a.m. OK GNU C++11 TESTS 29 46 3174400 2300
59787214 luogu_bot3 D Aug. 31, 2019, 6:06 a.m. OK GNU C++11 TESTS 29 46 3174400 2300
59626090 RoseKey D Aug. 28, 2019, 4 p.m. OK GNU C++11 TESTS 29 46 3174400 2300
59405353 Thomastine D Aug. 24, 2019, 1:42 p.m. OK GNU C++11 TESTS 29 46 3174400 2300
58651856 Itsuka__Shido D Aug. 12, 2019, 7:46 a.m. OK GNU C++11 TESTS 29 46 3174400 2300
58226071 sunny_fei D Aug. 3, 2019, 2:31 p.m. OK GNU C++11 TESTS 29 46 3174400 2300
51976067 whymhe D March 29, 2019, 2:21 p.m. OK GNU C++11 TESTS 29 46 3174400 2300
30877942 LiChenKoh D Sept. 30, 2017, 5:52 p.m. OK GNU C++14 TESTS 29 46 7577600 2300
45094919 q234rty D Oct. 30, 2018, 11:24 a.m. OK GNU C++14 TESTS 29 46 14438400 2300
45466799 TiChuot97 D Nov. 9, 2018, 6:31 a.m. OK GNU C++14 TESTS 29 93 3174400 2300
31895912 Indriya D Oct. 30, 2017, 2:03 p.m. OK GNU C++14 TESTS 29 93 3174400 2300
31797389 dheeraj_1997 D Oct. 27, 2017, 1:42 p.m. OK GNU C++14 TESTS 29 93 3174400 2300
68229944 arnold518 D Jan. 5, 2020, 8:49 a.m. OK GNU C++14 TESTS 29 93 4403200 2300
30913273 Nero D Oct. 1, 2017, 3:54 p.m. OK GNU C++14 TESTS 29 93 4403200 2300
30957600 GoogleBot D Oct. 3, 2017, 4:23 a.m. OK GNU C++14 TESTS 29 93 6348800 2300
30979668 KyRillos_BoshRa D Oct. 3, 2017, 10:32 p.m. OK GNU C++14 TESTS 29 93 8704000 2300
31147837 NetSlayer D Oct. 8, 2017, 3:13 p.m. OK GNU C++14 TESTS 29 108 3174400 2300
55104527 chongryong D June 5, 2019, 12:37 a.m. OK GNU C++17 TESTS 29 108 7168000 2300
58145846 tranquanghuy D Aug. 1, 2019, 9:10 p.m. OK GNU C++17 TESTS 29 109 2355200 2300
64317713 JovanB D Nov. 5, 2019, 2:37 p.m. OK GNU C++17 TESTS 29 109 3174400 2300
62028041 Anachor D Oct. 6, 2019, 9:25 p.m. OK GNU C++17 TESTS 29 109 3174400 2300
59120161 vjudge2 D Aug. 20, 2019, 4:40 a.m. OK GNU C++17 TESTS 29 109 3174400 2300
59120134 vjudge5 D Aug. 20, 2019, 4:38 a.m. OK GNU C++17 TESTS 29 109 3174400 2300
58860882 spectaclehong D Aug. 15, 2019, 11:34 a.m. OK GNU C++17 TESTS 29 109 3174400 2300
57305646 jyf111 D July 19, 2019, 3:31 a.m. OK GNU C++17 TESTS 29 109 3174400 2300
53099418 sagami D April 21, 2019, 3:29 p.m. OK GNU C++17 TESTS 29 109 3174400 2300
49034013 vjudge3 D Jan. 27, 2019, 1:40 a.m. OK GNU C++17 TESTS 29 109 3481600 2300
30978484 tyuan73 D Oct. 3, 2017, 8:45 p.m. OK Java 8 TESTS 29 186 0 2300
30978290 tyuan73 D Oct. 3, 2017, 8:34 p.m. OK Java 8 TESTS 29 187 0 2300
31409967 PrakharJain D Oct. 16, 2017, 12:49 p.m. OK Java 8 TESTS 29 233 26931200 2300
43497478 hongquanntct D Sept. 27, 2018, 3:26 p.m. OK Java 8 TESTS 29 264 13107200 2300
39193255 reyad D June 12, 2018, 1:50 p.m. OK Java 8 TESTS 29 265 4608000 2300
44718393 vjudge1 D Oct. 23, 2018, 12:49 a.m. OK Java 8 TESTS 29 295 28057600 2300
31926096 habanera D Oct. 31, 2017, 3:36 p.m. OK Java 8 TESTS 29 499 20582400 2300
45245326 AkramKhan D Nov. 3, 2018, 1:38 p.m. OK Java 8 TESTS 29 670 3174400 2300
31038581 vjudge5 D Oct. 5, 2017, 3:12 p.m. OK Java 8 TESTS 29 748 3891200 2300
32453769 wangh98 D Nov. 19, 2017, 10:32 a.m. OK Java 8 TESTS 29 763 25907200 2300
31614540 lionvs13 D Oct. 22, 2017, 9:59 p.m. OK MS C# TESTS 29 296 49459200 2300
56949421 vjudge5 D July 13, 2019, 1:22 a.m. OK MS C++ TESTS 29 78 2150400 2300
44316591 vjudge4 D Oct. 14, 2018, 12:27 p.m. OK MS C++ TESTS 29 93 4505600 2300
38973515 scorpiowf D June 5, 2018, 4:03 p.m. OK MS C++ TESTS 29 93 5632000 2300
61253679 vjudge1 D Sept. 25, 2019, 9:15 a.m. OK MS C++ TESTS 29 93 14131200 2300
51221611 vjudge3 D March 12, 2019, 12:39 p.m. OK MS C++ TESTS 29 234 2150400 2300
64784287 vjudge4 D Nov. 13, 2019, 8:32 a.m. OK MS C++ TESTS 29 249 2150400 2300
51221490 vjudge3 D March 12, 2019, 12:37 p.m. OK MS C++ TESTS 29 249 2150400 2300
32310485 marszed D Nov. 14, 2017, 12:03 p.m. OK MS C++ TESTS 29 327 14131200 2300
32310635 marszed D Nov. 14, 2017, 12:08 p.m. OK MS C++ TESTS 29 342 14131200 2300
43457495 GTmac D Sept. 26, 2018, 3:38 p.m. OK PyPy 2 TESTS 29 498 19353600 2300
59795619 rostyslav D Aug. 31, 2019, 8:34 a.m. OK PyPy 3 TESTS 29 561 25600000 2300
31062185 johnnylu305 D Oct. 6, 2017, 10:09 a.m. OK Python 2 TESTS 29 1996 16486400 2300
32510286 RocketshipToaster D Nov. 20, 2017, 8:11 p.m. OK Python 3 TESTS 29 483 20992000 2300

remove filters

Back to search problems