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.
Problems
B'Alice is a big fan of volleyball and especially of the very strong "Team A". Volleyball match consists of up to five sets. During each set teams score one point for winning a ball. The first four sets are played until one of the teams scores at least 25 points and the fifth set is played until one of the teams scores at least 15 points. Moreover, if one of the teams scores 25 (or 15 in the fifth set) points while the other team scores 24 (or 14 in the fifth set), the set is played until the absolute difference between teams ' points becomes two. The match ends when one of the teams wins three sets. The match score is the number of sets won by each team. Alice found a book containing all the results of all matches played by "Team A". The book is old, and some parts of the book became unreadable. Alice can not read the information on how many sets each of the teams won, she can not read the information on how many points each of the teams scored in each set, she even does not know the number of sets played in a match. The only information she has is the total number of points scored by each of the teams in all the sets during a single match. Alice wonders what is the best match score "Team A" could achieve in each of the matches. The bigger is the difference between the number of sets won by "Team A" and their opponent, the better is the match score. Find the best match score or conclude that no match could end like that. If there is a solution, then find any possible score for each set that results in the best match score. The first line contains a single integer m ( 1 <= m <= 50 ,000 ) -- the number of matches found by Alice in the book. Each of the next m lines contains two integers a and b ( 0 <= a, b <= 200 ) -- the number of points scored by "Team A" and the number of points scored by their opponents respectively. Output the solution for every match in the same order as they are given in the input. If the teams '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
46545788 |
ruban |
A |
Dec. 3, 2018, 2:34 p.m. |
OK |
Delphi |
TESTS |
10 |
608 |
29286400 |
|
2300 |
49688775 |
WhiteRose45 |
A |
Feb. 10, 2019, 9:48 a.m. |
OK |
GNU C11 |
TESTS |
10 |
451 |
0 |
|
2300 |
46475136 |
Mr_Spade Feeey cxt |
A |
Dec. 2, 2018, 8:04 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
31 |
0 |
|
2300 |
46654952 |
lyh uniea wbs501 |
A |
Dec. 5, 2018, 3:49 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
31 |
0 |
|
2300 |
46506212 |
Seast WA_A_PLAYER |
A |
Dec. 2, 2018, 11:19 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
31 |
0 |
|
2300 |
46514404 |
TadijaSebez |
A |
Dec. 2, 2018, 3:09 p.m. |
OK |
GNU C++11 |
TESTS |
10 |
46 |
0 |
|
2300 |
46499836 |
975678774 xyw5vplus1 Cubic3 |
A |
Dec. 2, 2018, 10:40 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
46 |
0 |
|
2300 |
46489882 |
linners lpa20020220 HEIMAOJINGZHANG |
A |
Dec. 2, 2018, 9:50 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
46 |
0 |
|
2300 |
46481366 |
cxaphoenix MKibera kingjgv5 |
A |
Dec. 2, 2018, 8:54 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
46 |
0 |
|
2300 |
50561696 |
AceSrc gisp_zjz zyb |
A |
Feb. 27, 2019, 11:24 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
46 |
0 |
|
2300 |
46844454 |
ql_wpc |
A |
Dec. 10, 2018, 10:02 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
46 |
2662400 |
|
2300 |
46925536 |
zeppoe |
A |
Dec. 12, 2018, 8:24 a.m. |
OK |
GNU C++11 |
TESTS |
10 |
46 |
4198400 |
|
2300 |
46572237 |
KeyID Phronesis 423555290 |
A |
Dec. 4, 2018, 6:38 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
31 |
0 |
|
2300 |
60515977 |
emmah Origenes OAHOBOHAO |
A |
Sept. 14, 2019, 6:35 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
31 |
0 |
|
2300 |
46492321 |
ko_osaga .o. alex9801 |
A |
Dec. 2, 2018, 10:06 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
31 |
7065600 |
|
2300 |
46788450 |
bibibibi WonderMouse fange121 |
A |
Dec. 9, 2018, 7:50 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
46 |
0 |
|
2300 |
46750191 |
bibibi sdqe Water_Sheep |
A |
Dec. 8, 2018, 8:49 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
46 |
0 |
|
2300 |
46664444 |
AMnu |
A |
Dec. 5, 2018, 11:25 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
46 |
0 |
|
2300 |
46510658 |
kirisame |
A |
Dec. 2, 2018, 1:08 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
46 |
0 |
|
2300 |
48320677 |
zzb111 |
A |
Jan. 13, 2019, 9:07 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
46 |
0 |
|
2300 |
46499462 |
QDEZ604 |
A |
Dec. 2, 2018, 10:31 a.m. |
OK |
GNU C++14 |
TESTS |
10 |
46 |
2150400 |
|
2300 |
50534294 |
dafeng |
A |
Feb. 26, 2019, 2:58 p.m. |
OK |
GNU C++14 |
TESTS |
10 |
46 |
5324800 |
|
2300 |
46507814 |
yswness kukyo lililalala |
A |
Dec. 2, 2018, 11:54 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
31 |
0 |
|
2300 |
46956275 |
nicetomeetu Trote_w forever97 |
A |
Dec. 13, 2018, 4:23 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
46 |
0 |
|
2300 |
58601513 |
usachevd0 iura fake123 |
A |
Aug. 11, 2019, 1:34 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
46 |
0 |
|
2300 |
62456358 |
ez_cjb |
A |
Oct. 13, 2019, 6:35 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
46 |
0 |
|
2300 |
51306669 |
Keram Bouncheck piotrgrabowski |
A |
March 14, 2019, 5:08 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
46 |
0 |
|
2300 |
48577744 |
fleimgruber lumibons Gregory |
A |
Jan. 19, 2019, 2:58 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
46 |
204800 |
|
2300 |
51302983 |
papa3 stasio6 budro |
A |
March 14, 2019, 3:21 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
46 |
204800 |
|
2300 |
46910331 |
Arpa |
A |
Dec. 11, 2018, 4:34 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
61 |
0 |
|
2300 |
47801218 |
ShJ |
A |
Dec. 31, 2018, 11:14 p.m. |
OK |
GNU C++17 |
TESTS |
10 |
61 |
5222400 |
|
2300 |
46476523 |
wwwwodddd AA_love_dreamoon dreamoon_love_AA |
A |
Dec. 2, 2018, 8:17 a.m. |
OK |
GNU C++17 |
TESTS |
10 |
61 |
7884800 |
|
2300 |
46479431 |
eatmore |
A |
Dec. 2, 2018, 8:38 a.m. |
OK |
Java 8 |
TESTS |
10 |
171 |
0 |
|
2300 |
46901469 |
spar5h Jeel_Vaishnav Yash23 |
A |
Dec. 11, 2018, 12:11 p.m. |
OK |
Java 8 |
TESTS |
10 |
311 |
0 |
|
2300 |
46499452 |
fetetriste mipt.vi002 |
A |
Dec. 2, 2018, 10:31 a.m. |
OK |
Java 8 |
TESTS |
10 |
607 |
0 |
|
2300 |
65766360 |
habibulka |
A |
Nov. 26, 2019, 6:09 p.m. |
OK |
Java 8 |
TESTS |
10 |
702 |
0 |
|
2300 |
64843624 |
iakovlev.zakhar sharepoLOVEDDD golikovnik |
A |
Nov. 13, 2019, 4:57 p.m. |
OK |
Java 8 |
TESTS |
10 |
904 |
10444800 |
|
2300 |
46540366 |
107th |
A |
Dec. 3, 2018, 11:38 a.m. |
OK |
Java 8 |
TESTS |
10 |
1013 |
0 |
|
2300 |
46532837 |
K_B_C_S |
A |
Dec. 3, 2018, 7:01 a.m. |
OK |
Java 8 |
TESTS |
10 |
1107 |
139980800 |
|
2300 |
46506944 |
moss3s |
A |
Dec. 2, 2018, 11:36 a.m. |
OK |
Kotlin |
TESTS |
10 |
904 |
7475200 |
|
2300 |
46492145 |
BrainFreeze peregrinus |
A |
Dec. 2, 2018, 10:01 a.m. |
OK |
Mono C# |
TESTS |
10 |
639 |
73932800 |
|
2300 |
46715675 |
omikad |
A |
Dec. 7, 2018, 11:02 a.m. |
OK |
Mono C# |
TESTS |
10 |
717 |
26624000 |
|
2300 |
64731007 |
hi_allerria |
A |
Nov. 12, 2019, 8:26 a.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
155 |
17510400 |
|
2300 |
61294524 |
WoodMachine |
A |
Sept. 25, 2019, 11:38 p.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
187 |
11366400 |
|
2300 |
65581559 |
shef_2318 Ancient_mage vitux |
A |
Nov. 23, 2019, 11:11 a.m. |
OK |
MS C++ 2017 |
TESTS |
10 |
280 |
11776000 |
|
2300 |
46712476 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46712399 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46712323 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46712290 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46712158 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46712078 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46712071 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46712067 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46712013 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
46711950 |
|
A |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2300 |
remove filters
Back to search problems