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"The New Year has arrived in the Master's Assistance Center, which means it's time to introduce a new feature! Now students are given distance learning courses, with a total of n courses available. For the i -th distance learning course, a student can receive a grade ranging from x_i to y_i . However, not all courses may be available to each student. Specifically, the j -th student is only given courses with numbers from l_j to r_j , meaning the distance learning courses with numbers l_j, l_j + 1, ldots, r_j . The creators of the distance learning courses have decided to determine the final grade in a special way. Let the j -th student receive grades c_{l_j}, c_{l_j + 1}, ldots, c_{r_j} for their distance learning courses. Then their final grade will be equal to c_{l_j} | c_{l_j + 1} | ldots | c_{r_j} , where | denotes the bitwise OR operation. Since the chatbot for solving distance learning courses is broken, the students have asked for your help. For each of the q students, tell them the maximum final grade they can achieve. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 2 cdot 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of distance learning courses. Each of the following n lines contains two integers x_i and y_i ( 0 <= x_i <= y_i < 2^{30} ) -- the minimum and maximum grade that can be received for the i -th course. The next line contains a single integer q ( 1 <= q <= 2 cdot10^5 ) -- the number of students. Each of the following q lines contains two integers l_j and r_j ( 1 <= l_j <= r_j <= n ) -- the minimum and maximum course numbers accessible to the j -th s"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
249834884 |
firewater.cryyy |
E |
March 5, 2024, 5:09 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
296 |
56729600 |
|
|
249862083 |
Java |
E |
March 5, 2024, 8:43 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
312 |
49664000 |
|
|
249882489 |
yueyuanzhiyyz |
E |
March 6, 2024, 3:51 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
342 |
75776000 |
|
|
249841092 |
zc2707 |
E |
March 5, 2024, 5:44 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
343 |
49664000 |
|
|
249864605 |
stup_bitch |
E |
March 5, 2024, 9:19 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
358 |
30003200 |
|
|
249873406 |
ikaurov |
E |
March 6, 2024, 12:37 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
373 |
7987200 |
|
|
249866879 |
lsantire |
E |
March 5, 2024, 9:54 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
374 |
4505600 |
|
|
249884238 |
AkaiLemon |
E |
March 6, 2024, 4:18 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
374 |
14438400 |
|
|
249881242 |
wishgoodluck |
E |
March 6, 2024, 3:29 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
374 |
60928000 |
|
|
249837923 |
regain0002 |
E |
March 5, 2024, 5:25 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
37 |
389 |
51302400 |
|
|
249853019 |
ollpu |
E |
March 5, 2024, 7:13 p.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
218 |
6348800 |
|
|
249878176 |
thisislike |
E |
March 6, 2024, 2:32 a.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
249 |
52940800 |
|
|
249877708 |
N_z__ |
E |
March 6, 2024, 2:22 a.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
280 |
48128000 |
|
|
249861702 |
undercat |
E |
March 5, 2024, 8:39 p.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
280 |
50483200 |
|
|
249883311 |
stan23456 |
E |
March 6, 2024, 4:04 a.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
280 |
73728000 |
|
|
249840061 |
VegJJJy |
E |
March 5, 2024, 5:37 p.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
280 |
92569600 |
|
|
249833055 |
JoanhLan |
E |
March 5, 2024, 5:02 p.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
280 |
105779200 |
|
|
249882342 |
Opuntia9622 |
E |
March 6, 2024, 3:48 a.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
311 |
49664000 |
|
|
249884242 |
Neymar-Jr |
E |
March 6, 2024, 4:18 a.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
358 |
49664000 |
|
|
249881112 |
CodeChild |
E |
March 6, 2024, 3:27 a.m. |
OK |
C++17 (GCC 9-64) |
TESTS |
37 |
358 |
66048000 |
|
|
249858688 |
selmon__bhoi |
E |
March 5, 2024, 8:05 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
186 |
15872000 |
|
|
249879760 |
Hamim99 |
E |
March 6, 2024, 3:02 a.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
187 |
60108800 |
|
|
249847171 |
risujiroh |
E |
March 5, 2024, 6:26 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
217 |
50483200 |
|
|
249850733 |
Nazar |
E |
March 5, 2024, 6:53 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
233 |
4812800 |
|
|
249852227 |
guperman |
E |
March 5, 2024, 7:06 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
233 |
49664000 |
|
|
249861077 |
r4m1m |
E |
March 5, 2024, 8:31 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
233 |
51200000 |
|
|
249838810 |
Vanjanja |
E |
March 5, 2024, 5:30 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
233 |
107622400 |
|
|
249839095 |
dino_merlin |
E |
March 5, 2024, 5:31 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
234 |
6758400 |
|
|
249843970 |
tiom4eg |
E |
March 5, 2024, 6:03 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
249 |
27750400 |
|
|
249868302 |
askd |
E |
March 5, 2024, 10:19 p.m. |
OK |
C++20 (GCC 11-64) |
TESTS |
37 |
249 |
48025600 |
|
|
remove filters
Back to search problems