Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
98641 | CSYZ_ChenHL | Old Driver Tree | C++ | 运行超时 | 40 | 1000 MS | 1044 KB | 453 | 2023-08-16 12:10:43 |
#include<bits/stdc++.h> using namespace std; int n,m; int a[200010]; int main() { // freopen("ODT.in","r",stdin); // freopen("ODT.out","w",stdout); std::ios::sync_with_stdio(false); std::cin.tie(0),std::cout.tie(0); cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i]; while(m--) { int l,r,c; cin>>l>>r>>c; int ans=0; for(int i=l;i<=r;i++) if(a[i]==c) ans++; else a[i]=c; cout<<ans<<endl; } return 0; }