QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#674108 | #9104. Zayin and Forest | ucup-team5071# | Compile Error | / | / | C++20 | 1.1kb | 2024-10-25 13:54:10 | 2024-10-25 13:54:10 |
Judging History
answer
include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxn=2e6+10;
int n,cnt,root;
int sum[maxn*20],ls[maxn*20],rs[maxn*20];
void update(int &p,int L,int R,int x,int f){
if(!p)p=++cnt;
if(L==R){
sum[p]+=f;
return;
}
int m=L+((R-L)>>1);
if(x<=m)
update(ls[p],L,m,x,f);
else
update(rs[p],m+1,R,x,f);
sum[p]=sum[ls[p]]+sum[rs[p]];
}
int query(int p,int L,int R,int l,int r){
if(!p)return 0;
if(L>=l&&R<=r)return sum[p];
int m=L+((R-L)>>1),ans=0;
if(l<+m)ans+=query(ls[p],L,m,l,r);
else ans+=query(rs[p],m+1,R,l,r);
return ans;
}
void Solve(){
int m;
cin>>n>>m;
auto lowbit=[&](int x)->int{
return x&(-x);
};
root=++cnt;
while(m--){
int op,x,y;
cin>>op>>x>>y;
if(op==1){
for(;x<=n;x+=lowbit(x))
update(root,1,n,x,y);
}
else {
cout<<query(root,1,n,x,y)<<"\n";
}
}
}
signed main(){
ios::sync_with_stdio(false),cin.tie(0);
Solve();
return 0;
}
Details
answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:9: error: ‘bits’ was not declared in this scope 1 | include<bits/stdc++.h> | ^~~~ answer.code:1:14: error: ‘stdc’ was not declared in this scope; did you mean ‘std’? 1 | include<bits/stdc++.h> | ^~~~ | std answer.code:1:1: error: ‘include’ does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ answer.code: In function ‘void Solve()’: answer.code:30:5: error: ‘cin’ was not declared in this scope 30 | cin>>n>>m; | ^~~ answer.code:43:13: error: ‘cout’ was not declared in this scope 43 | cout<<query(root,1,n,x,y)<<"\n"; | ^~~~ answer.code: In function ‘int main()’: answer.code:48:5: error: ‘ios’ has not been declared 48 | ios::sync_with_stdio(false),cin.tie(0); | ^~~ answer.code:48:33: error: ‘cin’ was not declared in this scope 48 | ios::sync_with_stdio(false),cin.tie(0); | ^~~