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'Once upon a time Mike and Mike decided to come up with an outstanding problem for some stage of ROI (rare olympiad in informatics). One of them came up with a problem prototype but another stole the idea and proposed that problem for another stage of the same olympiad. Since then the first Mike has been waiting for an opportunity to propose the original idea for some other contest... Mike waited until this moment! You are given an array a of n integers. You are also given q queries of two types: After performing each query you have to calculate the sum of all elements in the array. The first line contains two integers n and q ( 1 <= n, q <= 2 cdot 10^5 ) -- the number of elements in the array and the number of queries, respectively. The second line contains n integers a_1, ldots, a_n ( 1 <= a_i <= 10^9 ) -- elements of the array a . Each of the following q lines contains a description of the corresponding query. Description begins with integer t ( t in {1, 2 } ) which denotes a type of the query: Print q integers, each on a separate line. In the i -th line print the sum of all elements in the array after performing the first i queries. Consider array from the example and the result of performing each query: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
157221566 |
kakel_san |
B |
May 14, 2022, 3:11 p.m. |
OK |
C# 8 |
TESTS |
43 |
389 |
46489600 |
|
|
157251452 |
allegrogiken |
B |
May 15, 2022, 1:18 a.m. |
OK |
D |
TESTS |
43 |
358 |
38092800 |
|
|
157227833 |
tovValentin |
B |
May 14, 2022, 4:13 p.m. |
OK |
FPC |
TESTS |
43 |
764 |
3379200 |
|
|
157227771 |
tovValentin |
B |
May 14, 2022, 4:12 p.m. |
OK |
FPC |
TESTS |
43 |
764 |
3379200 |
|
|
157227497 |
tovValentin |
B |
May 14, 2022, 4:09 p.m. |
OK |
FPC |
TESTS |
43 |
764 |
3379200 |
|
|
157227600 |
tovValentin |
B |
May 14, 2022, 4:10 p.m. |
OK |
FPC |
TESTS |
43 |
779 |
3379200 |
|
|
157236227 |
tovValentin |
B |
May 14, 2022, 5:49 p.m. |
OK |
FPC |
TESTS |
43 |
795 |
1740800 |
|
|
157196560 |
123ERG |
B |
May 14, 2022, 11:25 a.m. |
OK |
GNU C++14 |
TESTS |
43 |
218 |
3174400 |
|
|
157221927 |
Worldwide_D |
B |
May 14, 2022, 3:14 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
233 |
1638400 |
|
|
157254401 |
kele20100413_1 |
B |
May 15, 2022, 3 a.m. |
OK |
GNU C++14 |
TESTS |
43 |
249 |
1638400 |
|
|
157253888 |
luoZH111 |
B |
May 15, 2022, 2:49 a.m. |
OK |
GNU C++14 |
TESTS |
43 |
249 |
1638400 |
|
|
157206497 |
Raxus |
B |
May 14, 2022, 12:52 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
249 |
2662400 |
|
|
157226228 |
moumouya |
B |
May 14, 2022, 3:57 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
264 |
1638400 |
|
|
157209254 |
xing89qs |
B |
May 14, 2022, 1:11 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
264 |
1638400 |
|
|
157245697 |
KrK |
B |
May 14, 2022, 9:27 p.m. |
OK |
GNU C++14 |
TESTS |
43 |
264 |
2662400 |
|
|
157252631 |
TreeTraveler.h |
B |
May 15, 2022, 2:14 a.m. |
OK |
GNU C++14 |
TESTS |
43 |
265 |
2457600 |
|
|
157251805 |
doctor049 |
B |
May 15, 2022, 1:39 a.m. |
OK |
GNU C++14 |
TESTS |
43 |
265 |
2457600 |
|
|
157236440 |
Salfi_Sabit |
B |
May 14, 2022, 5:52 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
249 |
819200 |
|
|
157225116 |
iwew |
B |
May 14, 2022, 3:45 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
249 |
1638400 |
|
|
157226257 |
ashutoshrout0311 |
B |
May 14, 2022, 3:57 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
249 |
3993600 |
|
|
157263220 |
abhi2296 |
B |
May 15, 2022, 5:52 a.m. |
OK |
GNU C++17 |
TESTS |
43 |
249 |
5836800 |
|
|
157254911 |
HHU_fl |
B |
May 15, 2022, 3:12 a.m. |
OK |
GNU C++17 |
TESTS |
43 |
265 |
1638400 |
|
|
157235925 |
ChuancyL |
B |
May 14, 2022, 5:45 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
265 |
1638400 |
|
|
157235797 |
ChuancyL |
B |
May 14, 2022, 5:43 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
265 |
1638400 |
|
|
157211834 |
anodiebird |
B |
May 14, 2022, 1:36 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
265 |
1638400 |
|
|
157204685 |
885377999 |
B |
May 14, 2022, 12:42 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
265 |
1638400 |
|
|
157232360 |
samvel |
B |
May 14, 2022, 5:02 p.m. |
OK |
GNU C++17 |
TESTS |
43 |
265 |
3174400 |
|
|
157210665 |
ReSakura |
B |
May 14, 2022, 1:23 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
171 |
2457600 |
|
|
157238429 |
Lucina |
B |
May 14, 2022, 6:20 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
186 |
1638400 |
|
|
157230524 |
shivansh_jaiswal |
B |
May 14, 2022, 4:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
186 |
3174400 |
|
|
157218434 |
8xin |
B |
May 14, 2022, 2:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
186 |
24883200 |
|
|
157199567 |
Shailesh_Rathod |
B |
May 14, 2022, 11:33 a.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
187 |
819200 |
|
|
157237758 |
imnasim3.1415 |
B |
May 14, 2022, 6:10 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
187 |
1638400 |
|
|
157232150 |
SriBharath555 |
B |
May 14, 2022, 5 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
187 |
1638400 |
|
|
157256495 |
cjtodl |
B |
May 15, 2022, 4:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
187 |
3174400 |
|
|
157229547 |
boyiddha |
B |
May 14, 2022, 4:30 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
187 |
3174400 |
|
|
157211315 |
Nutella3000 |
B |
May 14, 2022, 1:30 p.m. |
OK |
GNU C++17 (64) |
TESTS |
43 |
187 |
3174400 |
|
|
remove filters
Back to search problems