diff --git a/Medium/Day6/Solution.cpp b/Medium/Day6/Solution.cpp index b55091c..76706da 100644 --- a/Medium/Day6/Solution.cpp +++ b/Medium/Day6/Solution.cpp @@ -1 +1,57 @@ // Write your code here +#include +#include +using namespace std; +#define int long long int + + +/*---------------------------------------------------------------------------------*/ + + + +int op(int a, int b){return a + b;} +int e(){return 0;} + +void solve () +{ + + int n,q; + cin>>n>>q; + vector a(n); + for (int i = 0; i < n; i++) + { + cin>>a[i]; + } + atcoder::segtree st(a); + for (int i = 0; i < q; i++) + { + int t; + cin>>t; + if (t==0){ + int p,x; + cin>>p>>x; + st.set(p,st.get(p)+x); + } + else{ + int l,r; + cin>>l>>r; + cout<