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 | 103661696 | Feb. 19, 2023, 11:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 11814 ) | L | Controllers | PROGRAMMING | binary search math |
You are at your grandparents' house and you are playing an old video game on a strange console. Your controller has only two buttons and each button has a number written on it. Initially, your score is (0). The game is composed of (n) rounds. For each (1\le i\le n), the (i)-th round works as follows. On the screen, a symbol (s_i) appears, which is either (+) ( plus ) or (-) ( minus ). Then you must press one of the two buttons on the controller once . Suppose you press a button with the number (x) written on it: your score will increase by (x) if the symbol was (+) and will decrease by (x) if the symbol was (-). After you press the button, the round ends. After you have played all (n) rounds, you win if your score is (0). Over the years, your grandparents bought many different controllers, so you have (q) of them. The two buttons on the (j)-th controller have the numbers (a_j) and (b_j) written on them. For each controller, you must compute whether you can win the game playing with that controller. The first line contains a single integer (n) ((1 \le n \le 2\cdot 10^5)) — the number of rounds. The second line contains a string (s) of length (n) — where (s_i) is the symbol that will appear on the screen in the (i)-th round. It is guaranteed that (s) contains only the characters (+) and (-). The third line contains an integer (q) ((1 \le q \le 10^5)) — the number of controllers. The following (q) lines contain two integers (a_j) and (b_j) each ((1 \le a_j, b_j \le 10^9)) — the numbers on the buttons of controller (j). Output (q) lines. On line (j) print (YES) if the game is winnable using controller (j), otherwise print (NO). In the first sample , one possible way to get score (0) using the first controller is by pressing the butt |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 194232926 | VectorASD gujik Liswiera | L | Feb. 19, 2023, 1:18 p.m. | OK | C# 10 | TESTS | 25 | 390 | 3686400 | ||
| 194226421 | ruban | L | Feb. 19, 2023, 12:30 p.m. | OK | FPC | TESTS | 25 | 343 | 1331200 | ||
| 194231124 | XCEsupremacy IcMtr icyM3tra | L | Feb. 19, 2023, 1:04 p.m. | OK | GNU C++14 | TESTS | 25 | 46 | 204800 | ||
| 194245773 | ztlh | L | Feb. 19, 2023, 2:59 p.m. | OK | GNU C++14 | TESTS | 25 | 62 | 204800 | ||
| 194226955 | Xu_Hongxi | L | Feb. 19, 2023, 12:34 p.m. | OK | GNU C++14 | TESTS | 25 | 62 | 204800 | ||
| 194218945 | Jimanbanashi | L | Feb. 19, 2023, 11:41 a.m. | OK | GNU C++14 | TESTS | 25 | 62 | 204800 | ||
| 194217811 | wsyhb | L | Feb. 19, 2023, 11:34 a.m. | OK | GNU C++14 | TESTS | 25 | 62 | 204800 | ||
| 194217435 | bdzzj _Diu_ Flew | L | Feb. 19, 2023, 11:32 a.m. | OK | GNU C++14 | TESTS | 25 | 62 | 204800 | ||
| 194216929 | p6pou Krystallos william556 | L | Feb. 19, 2023, 11:30 a.m. | OK | GNU C++14 | TESTS | 25 | 62 | 204800 | ||
| 194218623 | _Ice_Tea_ mmi366127 detaomega | L | Feb. 19, 2023, 11:39 a.m. | OK | GNU C++14 | TESTS | 25 | 77 | 512000 | ||
| 194216690 | ghj1222 | L | Feb. 19, 2023, 11:28 a.m. | OK | GNU C++14 | TESTS | 25 | 77 | 2867200 | ||
| 194225189 | xuwenhao0817 | L | Feb. 19, 2023, 12:22 p.m. | OK | GNU C++14 | TESTS | 25 | 78 | 0 |
Back to search problems