Help to understand on atcoder Math problem statement












0












$begingroup$


I stumble on this question (https://atcoder.jp/contests/abc116/tasks/abc116_c) and I cannot for my life understand what the problem ask me to solve



So I understand these part:
we have N flowers
each flowers start at 0 heights
we have sequences of heights that map to each flowers.
I know there could be some sort of addition in here because on the third sample, I can see 96+50+75 = 221.



What I didn't understand
what is the relation of these "l" and "r" to the problem? I know r should be equal to the number of flower but in the first output, "r" can be 3.



I just cannot understand the problem, even after looking up the answer, I still don't know why the answer like that.










share|cite|improve this question









$endgroup$

















    0












    $begingroup$


    I stumble on this question (https://atcoder.jp/contests/abc116/tasks/abc116_c) and I cannot for my life understand what the problem ask me to solve



    So I understand these part:
    we have N flowers
    each flowers start at 0 heights
    we have sequences of heights that map to each flowers.
    I know there could be some sort of addition in here because on the third sample, I can see 96+50+75 = 221.



    What I didn't understand
    what is the relation of these "l" and "r" to the problem? I know r should be equal to the number of flower but in the first output, "r" can be 3.



    I just cannot understand the problem, even after looking up the answer, I still don't know why the answer like that.










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$


      I stumble on this question (https://atcoder.jp/contests/abc116/tasks/abc116_c) and I cannot for my life understand what the problem ask me to solve



      So I understand these part:
      we have N flowers
      each flowers start at 0 heights
      we have sequences of heights that map to each flowers.
      I know there could be some sort of addition in here because on the third sample, I can see 96+50+75 = 221.



      What I didn't understand
      what is the relation of these "l" and "r" to the problem? I know r should be equal to the number of flower but in the first output, "r" can be 3.



      I just cannot understand the problem, even after looking up the answer, I still don't know why the answer like that.










      share|cite|improve this question









      $endgroup$




      I stumble on this question (https://atcoder.jp/contests/abc116/tasks/abc116_c) and I cannot for my life understand what the problem ask me to solve



      So I understand these part:
      we have N flowers
      each flowers start at 0 heights
      we have sequences of heights that map to each flowers.
      I know there could be some sort of addition in here because on the third sample, I can see 96+50+75 = 221.



      What I didn't understand
      what is the relation of these "l" and "r" to the problem? I know r should be equal to the number of flower but in the first output, "r" can be 3.



      I just cannot understand the problem, even after looking up the answer, I still don't know why the answer like that.







      problem-solving






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Jan 30 at 13:47









      SactioSactio

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          The $l$ and $r$ are indices. The input $(1,3)$ indicates that flowers number $1,2,3$ should be increased by $1$. If I instead input $(5,19)$, then flowers $5$ to $19$ are increased by $1$. So $r$ is not the number of flowers. Instead, if there are $n$ flowers, then we have to have $1 leq l leq r leq n$.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thanks, I think I start to see it. So for sample first input output, they do - (1,3) so it will be "1 1 1 0" - then they do (2,4) to make it "1 2 2 1". and for the second input (1,5) then (1,1) twice then (3,4) then (4,4) assuming l and r can be less than or equal. The description of (l,r) in the problem might need little more explanation
            $endgroup$
            – Sactio
            Jan 30 at 15:19














          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3093542%2fhelp-to-understand-on-atcoder-math-problem-statement%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0












          $begingroup$

          The $l$ and $r$ are indices. The input $(1,3)$ indicates that flowers number $1,2,3$ should be increased by $1$. If I instead input $(5,19)$, then flowers $5$ to $19$ are increased by $1$. So $r$ is not the number of flowers. Instead, if there are $n$ flowers, then we have to have $1 leq l leq r leq n$.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thanks, I think I start to see it. So for sample first input output, they do - (1,3) so it will be "1 1 1 0" - then they do (2,4) to make it "1 2 2 1". and for the second input (1,5) then (1,1) twice then (3,4) then (4,4) assuming l and r can be less than or equal. The description of (l,r) in the problem might need little more explanation
            $endgroup$
            – Sactio
            Jan 30 at 15:19


















          0












          $begingroup$

          The $l$ and $r$ are indices. The input $(1,3)$ indicates that flowers number $1,2,3$ should be increased by $1$. If I instead input $(5,19)$, then flowers $5$ to $19$ are increased by $1$. So $r$ is not the number of flowers. Instead, if there are $n$ flowers, then we have to have $1 leq l leq r leq n$.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thanks, I think I start to see it. So for sample first input output, they do - (1,3) so it will be "1 1 1 0" - then they do (2,4) to make it "1 2 2 1". and for the second input (1,5) then (1,1) twice then (3,4) then (4,4) assuming l and r can be less than or equal. The description of (l,r) in the problem might need little more explanation
            $endgroup$
            – Sactio
            Jan 30 at 15:19
















          0












          0








          0





          $begingroup$

          The $l$ and $r$ are indices. The input $(1,3)$ indicates that flowers number $1,2,3$ should be increased by $1$. If I instead input $(5,19)$, then flowers $5$ to $19$ are increased by $1$. So $r$ is not the number of flowers. Instead, if there are $n$ flowers, then we have to have $1 leq l leq r leq n$.






          share|cite|improve this answer









          $endgroup$



          The $l$ and $r$ are indices. The input $(1,3)$ indicates that flowers number $1,2,3$ should be increased by $1$. If I instead input $(5,19)$, then flowers $5$ to $19$ are increased by $1$. So $r$ is not the number of flowers. Instead, if there are $n$ flowers, then we have to have $1 leq l leq r leq n$.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 30 at 13:57









          JohannaJohanna

          4,74541640




          4,74541640












          • $begingroup$
            Thanks, I think I start to see it. So for sample first input output, they do - (1,3) so it will be "1 1 1 0" - then they do (2,4) to make it "1 2 2 1". and for the second input (1,5) then (1,1) twice then (3,4) then (4,4) assuming l and r can be less than or equal. The description of (l,r) in the problem might need little more explanation
            $endgroup$
            – Sactio
            Jan 30 at 15:19




















          • $begingroup$
            Thanks, I think I start to see it. So for sample first input output, they do - (1,3) so it will be "1 1 1 0" - then they do (2,4) to make it "1 2 2 1". and for the second input (1,5) then (1,1) twice then (3,4) then (4,4) assuming l and r can be less than or equal. The description of (l,r) in the problem might need little more explanation
            $endgroup$
            – Sactio
            Jan 30 at 15:19


















          $begingroup$
          Thanks, I think I start to see it. So for sample first input output, they do - (1,3) so it will be "1 1 1 0" - then they do (2,4) to make it "1 2 2 1". and for the second input (1,5) then (1,1) twice then (3,4) then (4,4) assuming l and r can be less than or equal. The description of (l,r) in the problem might need little more explanation
          $endgroup$
          – Sactio
          Jan 30 at 15:19






          $begingroup$
          Thanks, I think I start to see it. So for sample first input output, they do - (1,3) so it will be "1 1 1 0" - then they do (2,4) to make it "1 2 2 1". and for the second input (1,5) then (1,1) twice then (3,4) then (4,4) assuming l and r can be less than or equal. The description of (l,r) in the problem might need little more explanation
          $endgroup$
          – Sactio
          Jan 30 at 15:19




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3093542%2fhelp-to-understand-on-atcoder-math-problem-statement%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          Npm cannot find a required file even through it is in the searched directory