Codeforces Round 162 (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
264 Codeforces Round 162 (Div. 1) FINISHED False 7200 373136399 Jan. 20, 2013, 1 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2955 ) C Choosing Balls PROGRAMMING dp 2200

B'There are n balls. They are arranged in a row. Each ball has a color (for convenience an integer) and an integer value. The color of the i-th ball is ci and the value of the i-th ball is vi. Squirrel Liss chooses some balls and makes a new sequence without changing the relative order of the balls. She wants to maximize the value of this sequence. The value of the sequence is defined as the sum of following values for each ball (where a and b are given constants): You are given q queries. Each query contains two integers ai and bi. For each query find the maximal value of the sequence she can make when a xe2 x80 x89= xe2 x80 x89ai and b xe2 x80 x89= xe2 x80 x89bi. Note that the new sequence can be empty, and the value of an empty sequence is defined as zero. The first line contains two integers n and q (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105; 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89500). The second line contains n integers: v1, xe2 x80 x89v2, xe2 x80 x89..., xe2 x80 x89vn (|vi| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The third line contains n integers: c1, xe2 x80 x89c2, xe2 x80 x89..., xe2 x80 x89cn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ci xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). The following q lines contain the values of the constants a and b for queries. The i-th of these lines contains two integers ai and bi (|ai|, xe2 x80 x89|bi| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). In each line integers are separated by single spaces. For each query, output a line containing an integer -- the answer to the query. The i-th line contains the answer to the i-th query in the input order. Please, do not write 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. In the first example, to achieve the maximal value: Note that there may be other ways to achieve the maximal value.'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
29282204 regmsif C Aug. 8, 2017, 9:22 a.m. OK D TESTS 42 3648 7168000 2200
2979616 kaolavinh1417 C Jan. 21, 2013, 2:32 p.m. OK Delphi TESTS 42 2390 2048000 2200
2979609 kaolavinh1417 C Jan. 21, 2013, 2:30 p.m. OK Delphi TESTS 42 3109 2048000 2200
5997814 Nik_Storm_2010 C March 11, 2014, 4:31 p.m. OK Delphi TESTS 42 3462 3276800 2200
2997901 AleksanderBalobanov C Jan. 23, 2013, 3:30 p.m. OK Delphi TESTS 42 3578 7577600 2200
3004824 Alex_2oo8 C Jan. 24, 2013, 6:14 p.m. OK Delphi TESTS 42 3781 1740800 2200
2969238 Furko C Jan. 20, 2013, 2:01 p.m. OK Delphi TESTS 42 3796 24064000 2200
5827559 Misha100896 C Jan. 28, 2014, 6:43 p.m. OK Delphi TESTS 42 4086 2048000 2200
2980084 vilcheuski C Jan. 21, 2013, 3:56 p.m. OK Delphi TESTS 42 4281 3584000 2200
2973114 vilcheuski C Jan. 20, 2013, 5:02 p.m. OK Delphi TESTS 42 4812 3584000 2200
2968007 vlad107 C Jan. 20, 2013, 1:43 p.m. OK FPC TESTS 42 2109 7987200 2200
3019296 doanminhdragon C Jan. 28, 2013, 11:43 a.m. OK FPC TESTS 42 2515 1740800 2200
2998658 ngotrungtuong C Jan. 23, 2013, 5:44 p.m. OK FPC TESTS 42 2776 1740800 2200
2975023 con_nha_ngheo C Jan. 20, 2013, 8:09 p.m. OK FPC TESTS 42 4250 2560000 2200
2978020 kaolavinh1417 C Jan. 21, 2013, 11:32 a.m. OK FPC TESTS 42 4390 2150400 2200
3199025 ig_dug C Feb. 26, 2013, 1:51 p.m. OK FPC TESTS 42 4437 2560000 2200
2975590 hxywtc C Jan. 20, 2013, 11:54 p.m. OK FPC TESTS 42 4953 1638400 2200
3620852 ZeroPointer C April 25, 2013, 2:05 p.m. OK GNU C TESTS 42 1731 1638400 2200
3583351 atpec C April 21, 2013, 4:10 a.m. OK GNU C TESTS 42 2140 2457600 2200
16384572 TsReaper C Feb. 27, 2016, 2:15 p.m. OK GNU C TESTS 42 2246 3174400 2200
37446290 spehar.luka C April 18, 2018, 7:13 p.m. OK GNU C TESTS 42 2370 4915200 2200
37445682 spehar.luka C April 18, 2018, 6:40 p.m. OK GNU C TESTS 42 2526 5734400 2200
37442488 kokili98 C April 18, 2018, 3:57 p.m. OK GNU C TESTS 42 2682 5222400 2200
37446076 spehar.luka C April 18, 2018, 7:02 p.m. OK GNU C TESTS 42 3056 4915200 2200
37420005 tatomirovic C April 17, 2018, 9:03 p.m. OK GNU C TESTS 42 3056 4915200 2200
37419957 tatomirovic C April 17, 2018, 9 p.m. OK GNU C TESTS 42 3118 4915200 2200
37419947 tatomirovic C April 17, 2018, 8:59 p.m. OK GNU C TESTS 42 3182 4915200 2200
4926425 liuaohanjsj C Oct. 29, 2013, 4:40 a.m. OK GNU C++ TESTS 42 1092 1638400 2200
2969308 evgentu C Jan. 20, 2013, 2:02 p.m. OK GNU C++ TESTS 42 1250 2048000 2200
2976592 liympanda C Jan. 21, 2013, 5:19 a.m. OK GNU C++ TESTS 42 1390 3174400 2200
3412819 Slayer_ C March 27, 2013, 4:54 p.m. OK GNU C++ TESTS 42 1406 1536000 2200
3074841 vjudge4 C Feb. 5, 2013, 1:50 p.m. OK GNU C++ TESTS 42 1421 1536000 2200
3135935 enrevol C Feb. 16, 2013, 9:19 a.m. OK GNU C++ TESTS 42 1421 1740800 2200
3135925 enrevol C Feb. 16, 2013, 9:15 a.m. OK GNU C++ TESTS 42 1421 1740800 2200
3070141 ZrbStu C Feb. 4, 2013, 9:43 a.m. OK GNU C++ TESTS 42 1437 1638400 2200
3135966 enrevol C Feb. 16, 2013, 9:29 a.m. OK GNU C++ TESTS 42 1437 1740800 2200
2969894 mzry1992 C Jan. 20, 2013, 2:11 p.m. OK GNU C++ TESTS 42 1468 1638400 2200
4909960 yutaka1999 C Oct. 27, 2013, 7:49 a.m. OK GNU C++0x TESTS 42 1045 1536000 2200
2975016 BryantMark C Jan. 20, 2013, 8:08 p.m. OK GNU C++0x TESTS 42 1390 1536000 2200
2974863 BryantMark C Jan. 20, 2013, 7:47 p.m. OK GNU C++0x TESTS 42 1404 1536000 2200
2974944 BryantMark C Jan. 20, 2013, 7:58 p.m. OK GNU C++0x TESTS 42 1406 1536000 2200
2974855 BryantMark C Jan. 20, 2013, 7:46 p.m. OK GNU C++0x TESTS 42 1406 1536000 2200
2968829 Archon.JK C Jan. 20, 2013, 1:55 p.m. OK GNU C++0x TESTS 42 1453 1536000 2200
3015307 s-quark C Jan. 27, 2013, 7:49 a.m. OK GNU C++0x TESTS 42 1484 2457600 2200
3104370 Edvard C Feb. 11, 2013, 8:16 p.m. OK GNU C++0x TESTS 42 1703 1638400 2200
3085384 cylixstar C Feb. 9, 2013, 5 a.m. OK GNU C++0x TESTS 42 1716 1740800 2200
3702942 kraskevich C May 11, 2013, 3:40 p.m. OK GNU C++0x TESTS 42 1747 1638400 2200
37436622 ksendzo C April 18, 2018, 12:50 p.m. OK GNU C11 TESTS 42 2400 4915200 2200
37421093 VukVukovic C April 17, 2018, 10:47 p.m. OK GNU C11 TESTS 42 2558 5734400 2200
37209733 FilipVesovic C April 11, 2018, 7:45 a.m. OK GNU C11 TESTS 42 2774 5734400 2200
37409229 Edvvin C April 17, 2018, 3:33 p.m. OK GNU C11 TESTS 42 2962 5324800 2200
20422676 mjhun C Sept. 6, 2016, 5:26 p.m. OK GNU C++11 TESTS 42 1714 1638400 2200
11543445 zld3794955 C June 12, 2015, 12:25 p.m. OK GNU C++11 TESTS 42 1776 2048000 2200
19097337 asvikr C July 13, 2016, 11:20 p.m. OK GNU C++11 TESTS 42 1808 1638400 2200
11008246 geniucos C May 5, 2015, 6:36 p.m. OK GNU C++11 TESTS 42 1840 1433600 2200
15086197 last_one C Dec. 29, 2015, 2:37 p.m. OK GNU C++11 TESTS 42 1872 2867200 2200
45683269 NRK7 C Nov. 13, 2018, 4:32 p.m. OK GNU C++11 TESTS 42 1902 2457600 2200
13306755 marcoskwkm C Sept. 29, 2015, 11:20 p.m. OK GNU C++11 TESTS 42 1902 2560000 2200
26321554 petrescu C April 12, 2017, 3:55 p.m. OK GNU C++11 TESTS 42 1902 3891200 2200
20301208 .tx C Aug. 31, 2016, 10:55 a.m. OK GNU C++11 TESTS 42 1934 1740800 2200
55063693 SoiMae C June 4, 2019, 1:48 a.m. OK GNU C++11 TESTS 42 1964 2457600 2200
40157662 zhongzero C July 10, 2018, 4:45 a.m. OK GNU C++14 TESTS 42 1840 1638400 2200
20422706 mjhun C Sept. 6, 2016, 5:28 p.m. OK GNU C++14 TESTS 42 1872 1638400 2200
54419690 Arg_007 C May 20, 2019, 2:42 p.m. OK GNU C++14 TESTS 42 1872 1638400 2200
58875164 baohiep C Aug. 15, 2019, 5:26 p.m. OK GNU C++14 TESTS 42 1902 2048000 2200
42500373 Sorting C Sept. 5, 2018, 4:39 p.m. OK GNU C++14 TESTS 42 1902 2764800 2200
49521337 gur_chella C Feb. 6, 2019, 8:12 a.m. OK GNU C++14 TESTS 42 1902 3174400 2200
25565202 srinu37 C March 17, 2017, 6:28 a.m. OK GNU C++14 TESTS 42 1902 3481600 2200
38200631 ivanzuki C May 13, 2018, 8:22 p.m. OK GNU C++14 TESTS 42 1902 5017600 2200
63241650 boatinw99 C Oct. 23, 2019, 1:36 p.m. OK GNU C++14 TESTS 42 1934 2048000 2200
50214669 arshia_119 C Feb. 20, 2019, 3:28 a.m. OK GNU C++14 TESTS 42 1934 3993600 2200
44468580 ruslanjan C Oct. 18, 2018, 4:40 a.m. OK GNU C++17 TESTS 42 1870 2150400 2200
40157677 vjudge1 C July 10, 2018, 4:46 a.m. OK GNU C++17 TESTS 42 1934 1638400 2200
45322357 terminator C Nov. 5, 2018, 11:15 a.m. OK GNU C++17 TESTS 42 1964 2662400 2200
44066806 minhducsun2OO2 C Oct. 10, 2018, 9:50 a.m. OK GNU C++17 TESTS 42 1994 4812800 2200
63980000 AK18 C Nov. 1, 2019, 9:56 a.m. OK GNU C++17 TESTS 42 2026 2457600 2200
46374518 Overrated C Nov. 29, 2018, 5:52 p.m. OK GNU C++17 TESTS 42 2058 2457600 2200
50186229 Bation_King C Feb. 19, 2019, 3:50 p.m. OK GNU C++17 TESTS 42 2058 2457600 2200
50186534 vjudge4 C Feb. 19, 2019, 3:52 p.m. OK GNU C++17 TESTS 42 2058 2457600 2200
58695398 shifanyiakioi C Aug. 13, 2019, 5:46 a.m. OK GNU C++17 TESTS 42 2058 2662400 2200
50580504 igba C Feb. 27, 2019, 9 p.m. OK GNU C++17 TESTS 42 2090 2457600 2200
65825532 its_aks_ulure C Nov. 27, 2019, 12:23 p.m. OK Java 11 TESTS 42 3524 0 2200
2970011 Egor C Jan. 20, 2013, 2:13 p.m. OK Java 6 TESTS 42 1609 204800 2200
2973970 uwi C Jan. 20, 2013, 5:55 p.m. OK Java 6 TESTS 42 2090 204800 2200
2974324 emo C Jan. 20, 2013, 6:37 p.m. OK Java 6 TESTS 42 2187 0 2200
2973743 emo C Jan. 20, 2013, 5:38 p.m. OK Java 6 TESTS 42 2234 307200 2200
3042348 santjuan C Jan. 31, 2013, 10:05 p.m. OK Java 6 TESTS 42 2421 307200 2200
2978836 todo C Jan. 21, 2013, 2:11 p.m. OK Java 6 TESTS 42 2546 102400 2200
2974473 m.radwan C Jan. 20, 2013, 6:57 p.m. OK Java 6 TESTS 42 2593 307200 2200
2970303 hs484 C Jan. 20, 2013, 2:18 p.m. OK Java 6 TESTS 42 2667 307200 2200
3287743 tyuan73 C March 11, 2013, 5:15 a.m. OK Java 6 TESTS 42 2796 409600 2200
3287729 tyuan73 C March 11, 2013, 5:11 a.m. OK Java 6 TESTS 42 2839 307200 2200
2966501 cerealguy C Jan. 20, 2013, 1:25 p.m. OK Java 7 TESTS 42 1625 0 2200
3015352 jiangzhijie C Jan. 27, 2013, 8:02 a.m. OK Java 7 TESTS 42 2000 204800 2200
2969710 tanzaku C Jan. 20, 2013, 2:09 p.m. OK Java 7 TESTS 42 2093 0 2200
2968077 ivan.metelsky C Jan. 20, 2013, 1:44 p.m. OK Java 7 TESTS 42 2125 102400 2200
2967112 Petr C Jan. 20, 2013, 1:32 p.m. OK Java 7 TESTS 42 2312 102400 2200
3770791 sayuan C May 26, 2013, 7:27 a.m. OK Java 7 TESTS 42 2375 102400 2200
2973245 ant.ermilov C Jan. 20, 2013, 5:12 p.m. OK Java 7 TESTS 42 2484 0 2200
2969728 OgieKako C Jan. 20, 2013, 2:09 p.m. OK Java 7 TESTS 42 2593 0 2200
2968071 niyaznigmatul C Jan. 20, 2013, 1:44 p.m. OK Java 7 TESTS 42 2593 0 2200
3001028 _jte_ C Jan. 24, 2013, 8:39 a.m. OK Java 7 TESTS 42 2828 204800 2200
31707790 admiral_1995 C Oct. 25, 2017, 11:57 a.m. OK Java 8 TESTS 42 2120 0 2200
40996627 jugjeet_singh C July 31, 2018, 4:23 a.m. OK Java 8 TESTS 42 2714 0 2200
39261573 amnesiac_dusk C June 15, 2018, 8:58 a.m. OK Java 8 TESTS 42 2744 0 2200
46545161 ankurdua15 C Dec. 3, 2018, 2:09 p.m. OK Java 8 TESTS 42 2808 0 2200
37145157 parth_15 C April 10, 2018, 1:08 p.m. OK Java 8 TESTS 42 2838 20684800 2200
68335798 O_E C Jan. 6, 2020, 9:47 p.m. OK Java 8 TESTS 42 3118 204800 2200
29933867 catler C Aug. 31, 2017, 2:55 a.m. OK Java 8 TESTS 42 3182 0 2200
24860858 Wrong_Answer_Exceeded C Feb. 21, 2017, 4:15 a.m. OK Java 8 TESTS 42 3212 22118400 2200
46879945 spar5h C Dec. 10, 2018, 6:58 p.m. OK Java 8 TESTS 42 3306 0 2200
49528962 dmitriy0712 C Feb. 6, 2019, 12:56 p.m. OK Java 8 TESTS 42 3338 0 2200
26779863 og.kostya C May 1, 2017, 6:12 a.m. OK MS C# TESTS 42 3586 14848000 2200
11717416 vjudge4 C June 23, 2015, 4:36 a.m. OK MS C# TESTS 42 3962 29388800 2200
6365633 Mosyagin C April 15, 2014, 12:06 p.m. OK MS C# TESTS 42 4148 16486400 2200
6365584 Mosyagin C April 15, 2014, 12:01 p.m. OK MS C# TESTS 42 4396 16384000 2200
3082540 izban C Feb. 8, 2013, 4:55 a.m. OK MS C++ TESTS 42 1843 2252800 2200
2971519 MikhailRubinchik.ru C Jan. 20, 2013, 2:38 p.m. OK MS C++ TESTS 42 1918 26521600 2200
2984179 alexander-nsk94 C Jan. 22, 2013, 2:40 p.m. OK MS C++ TESTS 42 2046 2662400 2200
2973057 agul C Jan. 20, 2013, 4:59 p.m. OK MS C++ TESTS 42 2046 2662400 2200
2972438 DAle C Jan. 20, 2013, 2:54 p.m. OK MS C++ TESTS 42 2109 2048000 2200
2968130 al13n C Jan. 20, 2013, 1:44 p.m. OK MS C++ TESTS 42 2140 1740800 2200
3399964 lxgsbqylbk C March 24, 2013, 12:09 p.m. OK MS C++ TESTS 42 2156 1638400 2200
2968742 Shef C Jan. 20, 2013, 1:53 p.m. OK MS C++ TESTS 42 2218 16793600 2200
2968868 SergeyRogulenko C Jan. 20, 2013, 1:55 p.m. OK MS C++ TESTS 42 2230 1638400 2200
2968619 Milanin C Jan. 20, 2013, 1:51 p.m. OK MS C++ TESTS 42 2230 2252800 2200
61332496 duchuy291199 C Sept. 26, 2019, 3:25 p.m. OK MS C++ 2017 TESTS 42 4896 3276800 2200
61343927 pajenegod C Sept. 27, 2019, 2:42 a.m. OK PyPy 2 TESTS 42 4116 13619200 2200
3011870 ixxa C Jan. 26, 2013, 11:53 a.m. OK Scala TESTS 42 2687 3276800 2200
3011883 ixxa C Jan. 26, 2013, 11:56 a.m. OK Scala TESTS 42 3281 3276800 2200
3012001 ixxa C Jan. 26, 2013, 12:17 p.m. OK Scala TESTS 42 3421 3379200 2200
11273656 Amr_Hassan C May 26, 2015, 5:29 a.m. OK Scala TESTS 42 4428 3379200 2200

remove filters

Back to search problems