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 |
|---|---|---|---|---|---|---|
| 1776 | SWERC 2022-2023 - Online Mirror (Unrated, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 99600923 | Feb. 19, 2023, 11:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 2370 ) | G | Another Wine Tasting Event | PROGRAMMING | combinatorics constructive algorithms strings |
After the first successful edition, Gabriella has been asked to organize a second wine tasting event. There will be (2n - 1) bottles of wine arranged in a row, each of which is either red wine or white wine. This time, Gabriella has already chosen the type and order of all the bottles. The types of the wines are represented by a string (s) of length (2n - 1). For each (1 \le i \le 2n - 1), it holds that (s_i = R) if the (i)-th bottle is red wine, and (s_i = W) if the (i)-th bottle is white wine. Exactly (n) critics have been invited to attend. The critics are numbered from (1) to (n). Just like last year, each critic (j) wants to taste an interval of wines, that is, the bottles at positions (a_j, \, a_j + 1, \, \dots, \, b_j) for some (1 \le a_j \le b_j \le 2n - 1). Moreover, they have the following additional requirements: each of them wants to taste at least (n) wines, that is, it must hold that (b_j - a_j + 1 \ge n); no two critics must taste exactly the same wines, that is, if (j \ne k) it must hold that (a_j \ne a_k) or (b_j \ne b_k). Gabriella knows that, since the event is held in a coastal region of Italy, critics are especially interested in the white wines, and don't care much about the red ones. (Indeed, white wine is perfect to accompany seafood.) Thus, to ensure fairness, she would like that all critics taste the same number of white wines. Help Gabriella find an integer (x) (with (0 \le x \le 2n - 1)) such that there exists a valid assignment of intervals to critics where each critic tastes exactly (x) white wines. It can be proved that at least one such (x) always exists. The first line contains the integer (n) ((1 \le n \le 10^6)) — where (2n - 1) is the number of bottles, and (n) is the number of critics. The second line contains a string (s) of length (2n - 1) that represents the arrangement of the wines — |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 194305720 | shenhaomin | G | Feb. 20, 2023, 3:38 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 2048000 | ||
| 194224829 | Feynn 2745518585 Star32 | G | Feb. 19, 2023, 12:19 p.m. | OK | GNU C++14 | TESTS | 50 | 31 | 2048000 | ||
| 194224801 | chuanliubuxi | G | Feb. 19, 2023, 12:19 p.m. | OK | GNU C++14 | TESTS | 50 | 31 | 2048000 | ||
| 194220915 | aymanrasheed7 serotonin Alpha_Q | G | Feb. 19, 2023, 11:53 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 2048000 | ||
| 194218960 | hank55663 | G | Feb. 19, 2023, 11:41 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 2048000 | ||
| 194217223 | Gold_Record | G | Feb. 19, 2023, 11:31 a.m. | OK | GNU C++14 | TESTS | 50 | 31 | 2048000 | ||
| 194225144 | PEIMUDA hyman00 bilibilitdasc | G | Feb. 19, 2023, 12:21 p.m. | OK | GNU C++14 | TESTS | 50 | 31 | 3174400 | ||
| 194219674 | mydcwfy Qiuly.qwq themoon | G | Feb. 19, 2023, 11:45 a.m. | OK | GNU C++14 | TESTS | 50 | 46 | 1945600 | ||
| 194226788 | superyijin CALLSIGN_NULL RDFZchenyy | G | Feb. 19, 2023, 12:33 p.m. | OK | GNU C++14 | TESTS | 50 | 46 | 2048000 | ||
| 194228363 | daniel14311531 | G | Feb. 19, 2023, 12:44 p.m. | OK | GNU C++14 | TESTS | 50 | 46 | 2969600 |
Back to search problems