Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
98655 | CSYZZhangZH | Old Driver Tree | C++ | 运行出错 | 20 | 21 MS | 332 KB | 397 | 2023-08-16 12:14:41 |
#include<bits/stdc++.h> using namespace std; const int N=8005; int n,m,a[N]; int main(){ ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); cin>>n>>m; for(int i=1;i<=n;++i) cin>>a[i]; for(int i=1;i<=m;++i){ int l,r,c,sum=0; cin>>l>>r>>c; for(int j=l;j<=r;++j){ if(a[j]==c) sum++; a[j]=c; } cout<<sum<<'\n'; } return 0; }