### taklo's blog

By taklo, history, 4 days ago, ,

We are given an array 'a' of size N. We have 2 type of query Type 1 :- i , x update a[i] with a[i]+x Type 2:- i Give output S. Where S = a[0]+a[1]+.....+a[i] Constraint:- N<=100000 Q<=100000 Where N = size of array Q=Number of query

Example a={1,2,3,4,5,6} Type 1: 0,5 Type 2: 3 Type 1: 4,3 Type 2: 5

Output: 15 29

• -16

 » 4 days ago, # |   0 Is this from a running contest?
•  » » 4 days ago, # ^ |   0 One of friend asked me this question.
•  » » » 4 days ago, # ^ |   +2 Segment trees.
•  » » » » 4 days ago, # ^ |   +1 Please explain the idea. Is it a standard question??
•  » » » » » 4 days ago, # ^ |   0  Is it a standard question?? Yes.
•  » » » » 4 days ago, # ^ |   +1 Can you share the resources?? Please...
•  » » » » » 4 days ago, # ^ |   0
•  » » » » » » 4 days ago, # ^ |   +1 Thanks...:)
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.16657744348049164, "perplexity": 5614.6284688495925}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570986653876.31/warc/CC-MAIN-20191014150930-20191014174430-00001.warc.gz"}