Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
36084 | j136 | 【S】T1 | C++ | 运行出错 | 0 | 0 MS | 260 KB | 659 | 2025-02-07 15:22:56 |
#include<bits/stdc++.h> using namespace std; using ll = long long; ll n,qs,l,r,q,x,s,t,a[229028],ans; void out(){ for(int i=1;i<=n;i++)cout<<a[i]<<' '; cout<<'\n'; } int main(){ //ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); freopen("arithmetic.in","r",stdin),freopen("arithmetic.out","w",stdout); cin>>n>>qs>>l>>r; for(int i=1;i<=n;i++)cin>>a[i]; while(qs--){ cin>>q>>x>>s>>t; if(q==1)for(int i=1;i<=n;i++)if(a[i]>=x)a[i]=t*(a[i]+s); if(q==2)for(int i=1;i<=n;i++)if(a[i]<=x)a[i]=trunc((a[i]-s)/t); } for(int i=1;i<=n;i++)ans+=l<=a[i]&&a[i]<=r; cout<<ans; return 0; }