社区讨论
这能骗50pts???
P11219【MX-S4-T3】「yyOI R2」youyou 的序列 II参与者 3已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @m2n4nlg5
- 此快照首次捕获于
- 2024/10/24 17:55 去年
- 此快照最后确认于
- 2025/11/04 16:20 4 个月前
看到特殊性质A写的,为什么15-20也过了(((
CPP#include<bits/stdc++.h>
#define lowbit(x) (x&-x)
#define int long long
using namespace std;
int n,q,c1,c2,w1,w2,t[300030];
inline void add(int p,int k){while(p<=n) t[p]+=k,p+=lowbit(p);}
inline int get(int p)
{
int res=0;
while(p) res+=t[p],p-=lowbit(p);
return res;
}
signed main()
{
cin>>n>>q>>c1>>c2>>w1>>w2;
for(int i=1;i<=n;i++)
{
int x;
cin>>x;
add(i,x);
}
while(q--)
{
int opt,x,y;
cin>>opt>>x>>y;
if(opt==1) add(x,y);
else
{
int sum=get(y)-get(x-1);
if(c1<y-x+1) cout<<"tetris\n";
else if(sum<=w1) cout<<"cont\n";
else cout<<"tetris\n";
}
}
}
回复
共 2 条回复,欢迎继续交流。
正在加载回复...