Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
98639 | CSYZ_HeMinshen | Karry5307 | C++ | 运行超时 | 10 | 1000 MS | 5640 KB | 624 | 2023-08-16 12:10:31 |
#include<bits/stdc++.h> using namespace std; const int N=200011; #define int long long #define mod 1000000007 int t,n,k,m; //map<int,int> q; int a[N]; unordered_map<int,int> q; signed main(){ // freopen("ssh.in","r",stdin); // freopen("ssh.in","w",stdout); cin>>n>>m; for(int i=1;i<=n;i++)cin>>a[i]; for(int i=1;i<=m;i++){ int opt,l,r,x; cin>>opt; int ans=0; if(opt==1){ cin>>l>>r>>x; for(int j=l;j<=r;j++)a[j]=x; } else{ cin>>l>>r; for(int j=l;j<=r;j++){ q[a[j]]++; if(q[a[j]]==1)ans++; } cout<<ans<<endl; for(int j=l;j<=r;j++)q[a[j]]--; } } }