Submission

Status:
Compilation Error

Score: 0

User: Monasm

Problemset: ผลบวก (ยาก)

Language: cpp

Time: 0.000 second

Submitted On: 2024-09-30 08:07:15

#include <bits/stdc++.h>

using nmaespace std;

int main(){
    int n;cin >> n;
    vector<int> arr(n);
    for(auto &i:arr){
        cin >> i;
    }
    int q;cin >> q;
    while(q--){
        int t;cin >> t;
        while(t--){
            int x,y;cin >> x >> y;
            arr[x] = y;
        }
        int x,y;cin >> x >> y;
        int ans = 0;
        for(int i=x;i<=y;i++){
            ans+=i;
        }
        cout<<ans<<endl;
    }
}