Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
98622 CSYZLiuJ Old Driver Tree C++ 运行超时 60 1000 MS 1828 KB 476 2023-08-16 12:08:57

Tests(12/13):


#include<bits/stdc++.h> #define int long long using namespace std; const int N = 2e5 + 5; int n, m; int a[N]; int num; int l, r, x; signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n >> m; for(int i = 1; i <= n; ++ i){ cin >> a[i]; } while(m --){ cin >> l >> r >> x; num = 0; for(int i = l; i <= r; ++ i){ num += a[i] == x; a[i] = x; } cout << num << '\n'; } return 0; }


测评信息: