Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
231286 | 陈柏丞 | *小美的数组操作2 | C++ | Wrong Answer | 40 | 0 MS | 276 KB | 497 | 2024-01-13 20:12:12 |
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; for(int i = 1;i <= t;i++){ int n, k; cin >> n >> k; int a[102]; for(int j = 1;j <= n;j++){ cin >> a[j]; } for(int j = 1;j <= k;j++){ int u, k; cin >> u >> k; a[u]++;a[k]--; } bool yn = true; for(int j = 1;j <= n-1;j++){ if(a[j] < a[j+1]){ yn = false; } } if(yn){ cout << "Yes" << endl; }else{ cout << "No" << endl; } } return 0; }