Codeforces Global Round 14

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
1515 Codeforces Global Round 14 FINISHED False 10800 117300262 May 2, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 295 ) I Phoenix and Diamonds PROGRAMMING binary search data structures sortings

B"Phoenix wonders what it is like to rob diamonds from a jewelry store! There are n types of diamonds. The i -th type has weight w_i and value v_i . The store initially has a_i diamonds of the i -th type. Each day, for q days, one of the following will happen: Of course, since Phoenix is a law-abiding citizen, this is all a thought experiment and he never actually robs any diamonds from the store. This means that queries of type 3 do not affect the diamonds in the store. The first line contains two integers n and q ( 1 <= n <= 2 cdot 10^5 ; 1 <= q <= 10^5 ) -- the number of types of diamonds and number of days, respectively. The next n lines describe each type of diamond. The i -th line will contain three integers a_i , w_i , and v_i ( 0 <= a_i <= 10^5 ; 1 <= w_i, v_i <= 10^5 ) -- the initial number of diamonds of the i -th type, the weight of diamonds of the i -th type, and the value of diamonds of the i -th type, respectively. The next q lines contain the queries. For each query, the first integer of each line is t ( 1 <= t <= 3 ) -- the type of query. If t=1 , then two integers k_i , d_i follow ( 1 <= k_i <= 10^5 ; 1 <= d_i <= n ). This means that a new shipment of k_i diamonds arrived, each of type d_i . If t=2 , then two integers k_i , d_i follow ( 1 <= k_i <= 10^5 ; 1 <= d_i <= n ). This means that the store has sold k_i diamonds, each of type d_i . It is guaranteed that the store had the diamonds before they sold them. If t=3 , an integer c_i will follow ( 1 <= c_i <= 10^{18} ) -- the weight capacity of Phoenix's bag. It is guaranteed that there is at least one query where t=3 . Print the answer for each query of the third type ( t=3 ). For the first query where t=3 , Phoenix can fit 2 "...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
114963572 rainboy I May 2, 2021, 7:15 p.m. OK GNU C11 TESTS 71 1309 244326400
114978837 Dev.Zaki I May 3, 2021, 1:47 a.m. OK GNU C++11 TESTS 71 2011 800563200
114965912 01aglupal I May 2, 2021, 7:51 p.m. OK GNU C++17 TESTS 71 935 279449600
114963659 rainboy I May 2, 2021, 7:16 p.m. OK GNU C++17 TESTS 71 1590 244326400
114955428 ksun48 I May 2, 2021, 5:25 p.m. OK GNU C++17 TESTS 71 2667 355020800
114960373 Golovanov399 I May 2, 2021, 6:48 p.m. OK GNU C++17 TESTS 71 3525 145203200
114985566 ti20_ntson I May 3, 2021, 3:55 a.m. OK GNU C++17 TESTS 71 4164 401408000
114952479 yhx-12243 I May 2, 2021, 5:13 p.m. OK GNU C++17 (64) TESTS 71 1216 12800000
114963635 rainboy I May 2, 2021, 7:16 p.m. OK GNU C++17 (64) TESTS 71 1357 244326400
114993104 sh1194 I May 3, 2021, 5:28 a.m. OK GNU C++17 (64) TESTS 71 1496 12800000
114993296 sh1194 I May 3, 2021, 5:30 a.m. OK GNU C++17 (64) TESTS 71 1700 12800000
114971820 rainboy I May 2, 2021, 9:58 p.m. OK GNU C++17 (64) TESTS 71 1715 231628800
114971724 Benq I May 2, 2021, 9:55 p.m. OK GNU C++17 (64) TESTS 71 3618 401612800

remove filters

Back to search problems