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 |
---|---|---|---|---|---|---|
1728 | Educational Codeforces Round 135 (Rated for Div. 2) | FINISHED | False | 7200 | 74532263 | Sept. 8, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1780 ) | E | Red-Black Pepper | PROGRAMMING | binary search brute force greedy math number theory sortings ternary search |
B"Monocarp is going to host a party for his friends. He prepared n dishes and is about to serve them. First, he has to add some powdered pepper to each of them -- otherwise, the dishes will be pretty tasteless. The i -th dish has two values a_i and b_i -- its tastiness with red pepper added or black pepper added, respectively. Monocarp won't add both peppers to any dish, won't add any pepper multiple times, and won't leave any dish without the pepper added. Before adding the pepper, Monocarp should first purchase the said pepper in some shop. There are m shops in his local area. The j -th of them has packages of red pepper sufficient for x_j servings and packages of black pepper sufficient for y_j servings. Monocarp goes to exactly one shop, purchases multiple (possibly, zero) packages of each pepper in such a way that each dish will get the pepper added once, and no pepper is left. More formally, if he purchases x red pepper packages and y black pepper packages, then x and y should be non-negative and x cdot x_j + y cdot y_j should be equal to n . For each shop, determine the maximum total tastiness of the dishes after Monocarp buys pepper packages only in this shop and adds the pepper to the dishes. If it's impossible to purchase the packages in the said way, print -1. The first line contains a single integer n ( 1 <= n <= 3 cdot 10^5 ) -- the number of dishes. The i -th of the next n lines contains two integers a_i and b_i ( 1 <= a_i, b_i <= 10^9 ) -- the tastiness of the i -th dish with red pepper added or black pepper added, respectively. The next line contains a single integer m ( 1 <= m <= 3 cdot 10^5 ) -- the number of shops. The j -th of the next m lines contains two integers x_j and y_j ( 1 <= x_j, y_j <= n ) -- the number of servings the red and the black pepper pack"... |
106805 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
171436897 | Tdyx | E | Sept. 8, 2022, 6:14 p.m. | OK | C# 8 | TESTS | 41 | 452 | 40652800 | ||
171426729 | dlalswp25 | E | Sept. 8, 2022, 4:47 p.m. | OK | GNU C++14 | TESTS | 41 | 358 | 7270400 | ||
171427392 | dlalswp25 | E | Sept. 8, 2022, 4:51 p.m. | OK | GNU C++14 | TESTS | 41 | 374 | 7270400 | ||
171428420 | youhuo | E | Sept. 8, 2022, 4:57 p.m. | OK | GNU C++14 | TESTS | 41 | 404 | 4812800 | ||
171446910 | CK2021 | E | Sept. 8, 2022, 8:39 p.m. | OK | GNU C++14 | TESTS | 56 | 436 | 20070400 | ||
171433737 | Mifafa | E | Sept. 8, 2022, 5:42 p.m. | OK | GNU C++14 | TESTS | 41 | 452 | 14336000 | ||
171456671 | Daniel777 | E | Sept. 9, 2022, 12:59 a.m. | OK | GNU C++14 | TESTS | 66 | 467 | 6041600 | ||
171427116 | Ace_02 | E | Sept. 8, 2022, 4:49 p.m. | OK | GNU C++14 | TESTS | 41 | 483 | 4812800 | ||
171427618 | rfpermen | E | Sept. 8, 2022, 4:52 p.m. | OK | GNU C++14 | TESTS | 41 | 483 | 7987200 | ||
171453489 | omeganot | E | Sept. 8, 2022, 11:26 p.m. | OK | GNU C++14 | TESTS | 56 | 483 | 8396800 | ||
171461299 | FascTide | E | Sept. 9, 2022, 2:53 a.m. | OK | GNU C++14 | TESTS | 66 | 499 | 6041600 | ||
171433412 | Bobocan | E | Sept. 8, 2022, 5:39 p.m. | OK | GNU C++17 | TESTS | 41 | 155 | 2969600 | ||
171430525 | Bobocan | E | Sept. 8, 2022, 5:13 p.m. | OK | GNU C++17 | TESTS | 41 | 171 | 2969600 | ||
171431880 | bkifhr7 | E | Sept. 8, 2022, 5:25 p.m. | OK | GNU C++17 | TESTS | 41 | 373 | 4812800 | ||
171432509 | serotonin | E | Sept. 8, 2022, 5:31 p.m. | OK | GNU C++17 | TESTS | 41 | 374 | 4812800 | ||
171432040 | serotonin | E | Sept. 8, 2022, 5:26 p.m. | OK | GNU C++17 | TESTS | 41 | 374 | 4812800 | ||
171431470 | toolist | E | Sept. 8, 2022, 5:21 p.m. | OK | GNU C++17 | TESTS | 41 | 389 | 19148800 | ||
171436301 | KrK | E | Sept. 8, 2022, 6:08 p.m. | OK | GNU C++17 | TESTS | 41 | 390 | 4812800 | ||
171428796 | C20180602 | E | Sept. 8, 2022, 4:59 p.m. | OK | GNU C++17 | TESTS | 41 | 420 | 4812800 | ||
171436108 | sinianqwq | E | Sept. 8, 2022, 6:06 p.m. | OK | GNU C++17 | TESTS | 41 | 436 | 18227200 | ||
171427625 | 1459007298 | E | Sept. 8, 2022, 4:52 p.m. | OK | GNU C++17 | TESTS | 41 | 436 | 24064000 | ||
171429630 | Freedom__King | E | Sept. 8, 2022, 5:06 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 109 | 7782400 | ||
171428005 | Hackenbush | E | Sept. 8, 2022, 4:54 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 249 | 4096000 | ||
171439549 | bashkort | E | Sept. 8, 2022, 6:44 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 280 | 3584000 | ||
171439490 | bashkort | E | Sept. 8, 2022, 6:43 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 280 | 3584000 | ||
171439235 | bashkort | E | Sept. 8, 2022, 6:40 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 280 | 3584000 | ||
171437331 | moyung | E | Sept. 8, 2022, 6:18 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 280 | 3584000 | ||
171440274 | bashkort | E | Sept. 8, 2022, 6:53 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 296 | 3584000 | ||
171439210 | bashkort | E | Sept. 8, 2022, 6:40 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 296 | 3584000 | ||
171438644 | cuzperf | E | Sept. 8, 2022, 6:33 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 296 | 3584000 | ||
171428155 | Mangooste | E | Sept. 8, 2022, 4:55 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 296 | 4812800 | ||
171432465 | magnus.hegdahl | E | Sept. 8, 2022, 5:30 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 108 | 7475200 | ||
171432426 | magnus.hegdahl | E | Sept. 8, 2022, 5:30 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 124 | 7475200 | ||
171435512 | 18o3 | E | Sept. 8, 2022, 5:59 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 233 | 9625600 | ||
171436959 | Lucina | E | Sept. 8, 2022, 6:14 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 234 | 7270400 | ||
171432288 | magnus.hegdahl | E | Sept. 8, 2022, 5:29 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 234 | 7270400 | ||
171422220 | tarjen | E | Sept. 8, 2022, 4:31 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 234 | 14643200 | ||
171426322 | Dremix10 | E | Sept. 8, 2022, 4:45 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 248 | 15257600 | ||
171421474 | WinterLove | E | Sept. 8, 2022, 4:30 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 249 | 2457600 | ||
171459818 | jiuzhem | E | Sept. 9, 2022, 2:19 a.m. | OK | GNU C++20 (64) | TESTS | 66 | 249 | 3584000 | ||
171453817 | akifpatel | E | Sept. 8, 2022, 11:36 p.m. | OK | GNU C++20 (64) | TESTS | 56 | 249 | 4812800 | ||
171449849 | dzhi | E | Sept. 8, 2022, 9:42 p.m. | OK | Java 11 | TESTS | 56 | 873 | 36352000 | ||
171450828 | dzhi | E | Sept. 8, 2022, 10:06 p.m. | OK | Java 11 | TESTS | 56 | 888 | 36249600 | ||
171451156 | dzhi | E | Sept. 8, 2022, 10:15 p.m. | OK | Java 11 | TESTS | 56 | 920 | 36352000 | ||
171450957 | freehandle | E | Sept. 8, 2022, 10:09 p.m. | OK | Java 17 | TESTS | 56 | 748 | 13414400 | ||
171421819 | freehandle | E | Sept. 8, 2022, 4:31 p.m. | OK | Java 17 | TESTS | 41 | 779 | 13516800 | ||
171428464 | AndreySiunov | E | Sept. 8, 2022, 4:57 p.m. | OK | Java 8 | TESTS | 41 | 608 | 0 | ||
171428716 | AndreySiunov | E | Sept. 8, 2022, 4:59 p.m. | OK | Java 8 | TESTS | 41 | 655 | 0 | ||
171427935 | eepsilon | E | Sept. 8, 2022, 4:54 p.m. | OK | PyPy 3-64 | TESTS | 41 | 482 | 37068800 | ||
171419060 | Navier_boltzmann | E | Sept. 8, 2022, 4:25 p.m. | OK | PyPy 3-64 | TESTS | 41 | 1044 | 94924800 | ||
171454050 | robostac | E | Sept. 8, 2022, 11:44 p.m. | OK | Rust 2021 | TESTS | 56 | 171 | 11571200 | ||
171453925 | robostac | E | Sept. 8, 2022, 11:39 p.m. | OK | Rust 2021 | TESTS | 56 | 171 | 11571200 | ||
171453644 | robostac | E | Sept. 8, 2022, 11:32 p.m. | OK | Rust 2021 | TESTS | 56 | 171 | 11571200 | ||
171433546 | robostac | E | Sept. 8, 2022, 5:41 p.m. | OK | Rust 2021 | TESTS | 41 | 186 | 11571200 | ||
171433684 | robostac | E | Sept. 8, 2022, 5:42 p.m. | OK | Rust 2021 | TESTS | 41 | 187 | 11571200 |
Back to search problems