Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
229926 | 顾欣薇 | *小美的数组操作2 | C++ | Wrong Answer | 0 | 0 MS | 276 KB | 441 | 2024-01-07 13:57:57 |
#include <bits/stdc++.h> using namespace std; int main() { int t,n,k,a[10005],u,v; bool b=1; cin >> t; for (int i=1;i<=t;i++) { cin >> n >> k; for (int j=1;j<=n;j++) { cin >> a[j]; } for (int j=1;j<=k;j++) { cin >> u >> v; a[u]+=1; a[v]-=1; } for (int j=1;j<n;j++) { if (a[j]>a[j+1]) { b=0; } } if (b==1) { cout << "Yes"; }else { cout << "No"; } } return 0; }