Codeforces Round 536 (Div. 2)

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
1106 Codeforces Round 536 (Div. 2) FINISHED False 9600 182885099 Jan. 31, 2019, 12:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6763 ) B Lunar New Year and Food Ordering PROGRAMMING data structures implementation 1500

B'Lunar New Year is approaching, and Bob is planning to go for a famous restaurant -- "Alice 's". The restaurant "Alice 's" serves n kinds of food. The cost for the i -th kind is always c_i . Initially, the restaurant has enough ingredients for serving exactly a_i dishes of the i -th kind. In the New Year 's Eve, m customers will visit Alice 's one after another and the j -th customer will order d_j dishes of the t_j -th kind of food. The (i + 1) -st customer will only come after the i -th customer is completely served. Suppose there are r_i dishes of the i -th kind remaining (initially r_i = a_i ). When a customer orders 1 dish of the i -th kind, the following principles will be processed. If the customer doesn 't leave after the d_j dishes are served, the cost for the customer will be the sum of the cost for these d_j dishes. Please determine the total cost for each of the m customers. The first line contains two integers n and m ( 1 <= q n, m <= q 10^5 ), representing the number of different kinds of food and the number of customers, respectively. The second line contains n positive integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10^7 ), where a_i denotes the initial remain of the i -th kind of dishes. The third line contains n positive integers c_1, c_2, ldots, c_n ( 1 <= q c_i <= q 10^6 ), where c_i denotes the cost of one dish of the i -th kind. The following m lines describe the orders of the m customers respectively. The j -th line contains two positive integers t_j and d_j ( 1 <= q t_j <= q n , 1 <= q d_j <= q 10^7 ), representing the kind of food and the number of dishes the j -th customer orders, respectively. Print m lines. In the j -th line print the cost for the j -th customer. In the first sample, 5 customers w'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
49403361 neha_556 B Feb. 3, 2019, 3:38 p.m. OK Clang++17 Diagnostics TESTS 64 482 21094400 1500
49536002 affu_503 B Feb. 6, 2019, 4 p.m. OK Clang++17 Diagnostics TESTS 64 482 21094400 1500
51612353 essay B March 21, 2019, 11:02 a.m. OK Clang++17 Diagnostics TESTS 64 498 3174400 1500
49298438 ruban B Feb. 1, 2019, 12:58 a.m. OK Delphi TESTS 64 389 200601600 1500
49321643 luogu_bot2 B Feb. 1, 2019, 12:33 p.m. OK FPC TESTS 64 421 2560000 1500
49321340 bcr_233 B Feb. 1, 2019, 12:27 p.m. OK FPC TESTS 64 436 2560000 1500
52326544 chaorenhaha B April 5, 2019, 1:16 a.m. OK FPC TESTS 64 452 4812800 1500
49263654 TShT B Jan. 31, 2019, 1:27 p.m. OK FPC TESTS 64 452 43212800 1500
49276391 PhuongPeu B Jan. 31, 2019, 2:39 p.m. OK FPC TESTS 64 467 6041600 1500
68994356 kaiboy B Jan. 17, 2020, 4:36 p.m. OK GNU C11 TESTS 64 468 1228800 1500
49271435 rainboy B Jan. 31, 2019, 2:10 p.m. OK GNU C11 TESTS 64 468 4608000 1500
49683381 geeyiiz B Feb. 10, 2019, 5:07 a.m. OK GNU C11 TESTS 64 483 1638400 1500
49263797 Horcrux1729 B Jan. 31, 2019, 1:28 p.m. OK GNU C11 TESTS 64 546 37068800 1500
49298080 qjzTreeZ B Feb. 1, 2019, 12:39 a.m. OK GNU C++11 TESTS 64 62 1638400 1500
49322623 M_sea B Feb. 1, 2019, 12:55 p.m. OK GNU C++11 TESTS 64 62 1638400 1500
49444706 ChthollyNotaSeniorious B Feb. 4, 2019, 1:37 a.m. OK GNU C++11 TESTS 64 62 1638400 1500
49298889 Zechariah_2001 B Feb. 1, 2019, 1:22 a.m. OK GNU C++11 TESTS 64 62 3174400 1500
49297582 Minamoto B Feb. 1, 2019, 12:08 a.m. OK GNU C++11 TESTS 64 62 6553600 1500
49324271 vjudge5 B Feb. 1, 2019, 1:29 p.m. OK GNU C++11 TESTS 64 77 1228800 1500
49940947 xukaiqi0616 B Feb. 15, 2019, 9:36 a.m. OK GNU C++11 TESTS 64 77 1228800 1500
49309656 GKxx B Feb. 1, 2019, 7:16 a.m. OK GNU C++11 TESTS 64 77 1433600 1500
49272060 GKxx B Jan. 31, 2019, 2:14 p.m. OK GNU C++11 TESTS 64 77 5017600 1500
49266884 Qihoo360 B Jan. 31, 2019, 1:46 p.m. OK GNU C++11 TESTS 64 77 5017600 1500
49623888 tokitsukaze B Feb. 8, 2019, 10:52 a.m. OK GNU C++14 TESTS 64 78 4915200 1500
49353674 interestingLSY B Feb. 2, 2019, 9:57 a.m. OK GNU C++14 TESTS 64 93 4505600 1500
49353678 HatsuneMikuo B Feb. 2, 2019, 9:57 a.m. OK GNU C++14 TESTS 64 93 4505600 1500
49473443 evenharder B Feb. 4, 2019, 6:14 p.m. OK GNU C++14 TESTS 64 109 1433600 1500
49296465 naoya_t B Jan. 31, 2019, 11:23 p.m. OK GNU C++14 TESTS 64 124 15769600 1500
49288369 GM_Targeted B Jan. 31, 2019, 6:28 p.m. OK GNU C++14 TESTS 64 124 20480000 1500
49310682 cherish_lin B Feb. 1, 2019, 7:45 a.m. OK GNU C++14 TESTS 64 139 1433600 1500
49452876 TheRedLegend B Feb. 4, 2019, 8:25 a.m. OK GNU C++14 TESTS 64 139 2457600 1500
49277051 Silent_hr B Jan. 31, 2019, 2:44 p.m. OK GNU C++14 TESTS 64 139 5222400 1500
49468712 abhishek_990 B Feb. 4, 2019, 4:11 p.m. OK GNU C++14 TESTS 64 140 1433600 1500
49902486 .tx B Feb. 14, 2019, 10:07 a.m. OK GNU C++17 TESTS 64 93 2969600 1500
49348593 Mynesis B Feb. 2, 2019, 7:05 a.m. OK GNU C++17 TESTS 64 124 3276800 1500
49298950 HumHumMonster B Feb. 1, 2019, 1:25 a.m. OK GNU C++17 TESTS 64 124 3481600 1500
49269473 mohamedeltair B Jan. 31, 2019, 2 p.m. OK GNU C++17 TESTS 64 124 5222400 1500
49267960 MochaLatte B Jan. 31, 2019, 1:52 p.m. OK GNU C++17 TESTS 64 124 10956800 1500
49531855 zekun B Feb. 6, 2019, 2:09 p.m. OK GNU C++17 TESTS 64 139 2252800 1500
66098434 thtsshz_bgwrswh B Dec. 1, 2019, 8:11 a.m. OK GNU C++17 TESTS 64 139 2355200 1500
49267148 gaelim B Jan. 31, 2019, 1:47 p.m. OK GNU C++17 TESTS 64 139 8499200 1500
57071317 cjnlbq B July 15, 2019, 2:44 a.m. OK GNU C++17 TESTS 64 140 1228800 1500
49343165 aakk B Feb. 2, 2019, 2:42 a.m. OK GNU C++17 TESTS 64 140 1433600 1500
49286066 life_is_not_bed_of_roses B Jan. 31, 2019, 5:47 p.m. OK Go TESTS 64 451 15257600 1500
49269502 dongy B Jan. 31, 2019, 2 p.m. OK Go TESTS 64 732 15360000 1500
49266674 2008061626 B Jan. 31, 2019, 1:45 p.m. OK Go TESTS 64 763 19865600 1500
49284821 gksato B Jan. 31, 2019, 5:29 p.m. OK Haskell TESTS 64 217 57651200 1500
49284399 gksato B Jan. 31, 2019, 5:23 p.m. OK Haskell TESTS 64 280 59699200 1500
49263180 bazinga84 B Jan. 31, 2019, 1:25 p.m. OK Java 8 TESTS 64 202 20889600 1500
49313990 revanthreddy85 B Feb. 1, 2019, 9:26 a.m. OK Java 8 TESTS 64 217 0 1500
49562700 tsumit023 B Feb. 7, 2019, 1:24 p.m. OK Java 8 TESTS 64 218 0 1500
49263930 xodiac B Jan. 31, 2019, 1:29 p.m. OK Java 8 TESTS 64 218 20684800 1500
49272981 KharYusuf B Jan. 31, 2019, 2:19 p.m. OK Java 8 TESTS 64 218 20992000 1500
49279506 revanthreddy85 B Jan. 31, 2019, 3:07 p.m. OK Java 8 TESTS 64 218 21913600 1500
49299397 aman28rwt B Feb. 1, 2019, 1:47 a.m. OK Java 8 TESTS 64 233 0 1500
49605258 Heisen_Berg B Feb. 7, 2019, 7:08 p.m. OK Java 8 TESTS 64 249 1433600 1500
49262810 prakhar897 B Jan. 31, 2019, 1:23 p.m. OK Java 8 TESTS 64 249 20684800 1500
49292768 manish_98 B Jan. 31, 2019, 8:14 p.m. OK Java 8 TESTS 64 264 8192000 1500
49945384 glider.g B Feb. 15, 2019, 11:48 a.m. OK Kotlin TESTS 64 1278 8396800 1500
49363941 Quaternion B Feb. 2, 2019, 2:09 p.m. OK Kotlin TESTS 64 1278 10547200 1500
49287745 spookywooky B Jan. 31, 2019, 6:16 p.m. OK Kotlin TESTS 64 1496 25702400 1500
55674580 og.kostya B June 17, 2019, 9:40 a.m. OK Mono C# TESTS 64 139 5734400 1500
55202129 camypaper B June 6, 2019, 11:02 a.m. OK Mono C# TESTS 64 218 22118400 1500
49277254 mircea85 B Jan. 31, 2019, 2:46 p.m. OK Mono C# TESTS 64 233 34816000 1500
63931920 m1_k3 B Oct. 31, 2019, 2:33 p.m. OK Mono C# TESTS 64 265 17203200 1500
49270734 Zvigintsev B Jan. 31, 2019, 2:06 p.m. OK Mono C# TESTS 64 327 25395200 1500
49399564 selpo B Feb. 3, 2019, 2:04 p.m. OK Mono C# TESTS 64 327 34099200 1500
49267036 keymoon B Jan. 31, 2019, 1:47 p.m. OK Mono C# TESTS 64 358 47923200 1500
49328851 krark B Feb. 1, 2019, 3:17 p.m. OK Mono C# TESTS 64 701 29491200 1500
49329165 krark B Feb. 1, 2019, 3:26 p.m. OK Mono C# TESTS 64 702 29491200 1500
63931664 m1_k3 B Oct. 31, 2019, 2:28 p.m. OK Mono C# TESTS 64 842 11980800 1500
51641691 vjudge2 B March 21, 2019, 4:42 p.m. OK MS C++ TESTS 64 109 12083200 1500
49682765 vjudge1 B Feb. 10, 2019, 4:27 a.m. OK MS C++ TESTS 64 124 1638400 1500
51474997 vjudge3 B March 19, 2019, 8:52 a.m. OK MS C++ TESTS 64 124 2048000 1500
60635327 vjudge5 B Sept. 15, 2019, 1:32 p.m. OK MS C++ TESTS 64 124 2048000 1500
51612461 vjudge2 B March 21, 2019, 11:05 a.m. OK MS C++ TESTS 64 124 3993600 1500
49389489 vjudge1 B Feb. 3, 2019, 8:58 a.m. OK MS C++ TESTS 64 139 3174400 1500
53049642 vjudge1 B April 20, 2019, 1:57 p.m. OK MS C++ TESTS 64 139 3276800 1500
49389518 vjudge5 B Feb. 3, 2019, 8:59 a.m. OK MS C++ TESTS 64 139 3481600 1500
65707434 vjudge4 B Nov. 25, 2019, 1:03 p.m. OK MS C++ TESTS 64 139 3584000 1500
49270552 dkyun B Jan. 31, 2019, 2:05 p.m. OK MS C++ TESTS 64 139 5939200 1500
51378687 petko_mitkov B March 16, 2019, 3:14 p.m. OK MS C++ 2017 TESTS 64 171 3276800 1500
49647374 Lxyzzz B Feb. 9, 2019, 5:33 a.m. OK MS C++ 2017 TESTS 64 171 7475200 1500
49301412 Ruben_tao B Feb. 1, 2019, 3:16 a.m. OK MS C++ 2017 TESTS 64 186 1638400 1500
56973235 2462478392 B July 13, 2019, 11:10 a.m. OK MS C++ 2017 TESTS 64 187 3174400 1500
49277462 skycrazy B Jan. 31, 2019, 2:48 p.m. OK MS C++ 2017 TESTS 64 187 4608000 1500
49309805 hwangganzi B Feb. 1, 2019, 7:20 a.m. OK MS C++ 2017 TESTS 64 187 5017600 1500
49278250 hwangganzi B Jan. 31, 2019, 2:55 p.m. OK MS C++ 2017 TESTS 64 202 8499200 1500
49276571 GU_GUGU B Jan. 31, 2019, 2:41 p.m. OK MS C++ 2017 TESTS 64 217 6553600 1500
63281457 AleksanderBalobanov B Oct. 24, 2019, 8:50 a.m. OK MS C++ 2017 TESTS 64 249 8089600 1500
49369852 aeremin B Feb. 2, 2019, 4:48 p.m. OK MS C++ 2017 TESTS 64 280 6041600 1500
49327850 ssdh233 B Feb. 1, 2019, 2:51 p.m. OK Node.js TESTS 64 1232 39424000 1500
49318350 mayakin B Feb. 1, 2019, 11:05 a.m. OK PHP TESTS 64 763 27340800 1500
49270474 kabeer27 B Jan. 31, 2019, 2:05 p.m. OK PyPy 2 TESTS 64 608 43110400 1500
49267043 pavankatta B Jan. 31, 2019, 1:47 p.m. OK PyPy 2 TESTS 64 811 43417600 1500
49268410 c1729 B Jan. 31, 2019, 1:54 p.m. OK PyPy 2 TESTS 64 811 52838400 1500
49263321 frederika B Jan. 31, 2019, 1:26 p.m. OK PyPy 2 TESTS 64 966 39014400 1500
49296191 gatsko B Jan. 31, 2019, 11:02 p.m. OK PyPy 2 TESTS 64 1886 10547200 1500
49357714 bkalra92 B Feb. 2, 2019, 12:01 p.m. OK PyPy 3 TESTS 64 858 12595200 1500
53669488 syzymon B May 2, 2019, 12:25 p.m. OK PyPy 3 TESTS 64 889 28876800 1500
49514295 Stephan B Feb. 6, 2019, midnight OK PyPy 3 TESTS 64 920 16691200 1500
49514233 Stephan B Feb. 5, 2019, 11:53 p.m. OK PyPy 3 TESTS 64 935 16793600 1500
49292322 adshin21 B Jan. 31, 2019, 7:58 p.m. OK PyPy 3 TESTS 64 935 36966400 1500
49269235 k3rnel-pan1c B Jan. 31, 2019, 1:59 p.m. OK PyPy 3 TESTS 64 951 37888000 1500
49269321 nik-in-au B Jan. 31, 2019, 1:59 p.m. OK PyPy 3 TESTS 64 1028 51200000 1500
49389415 bkalra92 B Feb. 3, 2019, 8:55 a.m. OK PyPy 3 TESTS 64 1076 16691200 1500
49274976 nikeshthapa255 B Jan. 31, 2019, 2:30 p.m. OK PyPy 3 TESTS 64 1559 37990400 1500
59694414 kopok2 B Aug. 30, 2019, 7:51 a.m. OK PyPy 3 TESTS 64 1591 31948800 1500
49856872 candle B Feb. 13, 2019, 7:39 a.m. OK Python 2 TESTS 64 982 24883200 1500
49278896 jhoelD B Jan. 31, 2019, 3:01 p.m. OK Python 2 TESTS 64 1045 20889600 1500
68991128 soumyasarkar1998 B Jan. 17, 2020, 3:13 p.m. OK Python 2 TESTS 64 1138 12390400 1500
49263564 ashashwat B Jan. 31, 2019, 1:27 p.m. OK Python 2 TESTS 64 1325 19148800 1500
49297609 eugalt B Feb. 1, 2019, 12:09 a.m. OK Python 3 TESTS 64 951 14540800 1500
49289215 amirah B Jan. 31, 2019, 6:46 p.m. OK Python 3 TESTS 64 982 26316800 1500
49267318 satyamcse B Jan. 31, 2019, 1:48 p.m. OK Python 3 TESTS 64 982 158105600 1500
49288973 amirah B Jan. 31, 2019, 6:41 p.m. OK Python 3 TESTS 64 1013 26214400 1500
49292304 adshin21 B Jan. 31, 2019, 7:57 p.m. OK Python 3 TESTS 64 1028 19660800 1500
49354436 honey_314 B Feb. 2, 2019, 10:20 a.m. OK Python 3 TESTS 64 1075 25600000 1500
49363459 shnk B Feb. 2, 2019, 1:57 p.m. OK Python 3 TESTS 64 1076 15462400 1500
49266194 EA5 B Jan. 31, 2019, 1:42 p.m. OK Python 3 TESTS 64 1076 16384000 1500
49296176 eugalt B Jan. 31, 2019, 11:01 p.m. OK Python 3 TESTS 64 1091 14540800 1500
49283932 jQk3r B Jan. 31, 2019, 5:17 p.m. OK Python 3 TESTS 64 1170 19456000 1500
49266295 rahdpp B Jan. 31, 2019, 1:42 p.m. OK Ruby TESTS 64 872 40448000 1500
49283483 Ser_Gay B Jan. 31, 2019, 5:10 p.m. OK Ruby TESTS 64 1060 35532800 1500
49678360 Yellowboy B Feb. 9, 2019, 9:39 p.m. OK Ruby TESTS 64 1357 31539200 1500
49452462 ancv1990 B Feb. 4, 2019, 8:07 a.m. OK Rust TESTS 64 78 5427200 1500
49633444 kobae964 B Feb. 8, 2019, 5:24 p.m. OK Rust TESTS 64 249 6656000 1500
49398813 ancv1990 B Feb. 3, 2019, 1:42 p.m. OK Rust TESTS 64 1107 3072000 1500
49267369 yakamoto B Jan. 31, 2019, 1:48 p.m. OK Scala TESTS 64 592 34406400 1500

remove filters

Back to search problems