a guest Feb 19th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  long result=0;
  2.             int[] answers;
  3.             int tempCounter=0;
  4.             // get every [y,2] element
  5.             for(int y=0;y<queries.GetLength(0);y++){ // go through y rows
  6.                 for(int x=0;x<2;x++){// go through x rows skipping last element
  7.                 tempCounter=queries[y][0]; // assign it to the 1st value
  8.                     while(tempCounter>=queries[y][0]&&tempCounter<=queries[y][1]){ // if between the values
  9.                         tempCounter++; // increment counter
  10.                         answers[tempCounter]+=queries[y][2];// increment array value by k element
  11.                     }
  13.                 }
  14.             }
  15.             return result;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand