# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1135414 | imarn | GCD-sum (CPSPC17_gcds) | C++20 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define plx pair<ll,int>
#define f first
#define s second
#define pb push_back
#define all(x) x.begin(),x.end()
#define vi vector<int>
#define vvi vector<vi>
#define pp pair<ll,int>
#define ub(x,i) upper_bound(all(x),i)-x.begin()
using namespace std;
const int mxn=5e5+5,inf=10001;
map<ll,int>mp;
vector<ll>v;
ll t[2*mxn]{0};
ll qr(int l,int r,int sz,ll rs=0){
for(l+=sz,r+=sz;l<r;l>>=1,r>>=1){
if(l&1)rs=__gcd(rs,t[l++]);
if(r&1)rs=__gcd(rs,t[--r]);
}return rs;
}
void upd(int i,int sz,ll amt){
i+=sz;t[i]=amt;
for(i>>=1;i;i>>=1)t[i]=__gcd(t[2*i],t[2*i+1]);
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |