Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
36123 zqqq 【S】T1 C++ 运行超时 40 2000 MS 1844 KB 891 2025-02-07 16:18:30

Tests(4/10):


#include<bits/stdc++.h> using namespace std; const int N=2e5+10; #define ll long long ll n,Q,L,R,q,x,s,t; ll a[N]; int main(){ ios::sync_with_stdio(0); cin>>n>>Q>>L>>R; for (int i = 1; i <= n; i++) { cin>>a[i]; } while (Q--) { 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); } }else{ for (int i = 1; i <= n; i++) { if(a[i]<=x){ double tmp=(a[i]-s)/t; if(tmp>0) a[i]=floor(tmp); else a[i]=ceil(tmp); } } } } int ans=0; for (int i = 1; i <= n; i++) { if(a[i]>=L && a[i]<=R) ans++; } cout<<ans; return 0; }


测评信息: