Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
229909 232217赵泽宇 *小美的数组操作2 C++ 解答错误 20 0 MS 276 KB 535 2024-01-07 13:47:42

Tests(1/5):


#include <iostream> using namespace std; int a[1002]; int main() { int t; cin>>t; for(int i = 1;i <= t;i++) { int n,k; cin>>n>>k; for(int j = 1;j <= n;j++) { cin>>a[j]; } for(int j = 1;j <= k;j++) { int u,d; cin>>u>>d; a[u]++; a[d]--; } bool panda = true; for(int j = 1;j <= n;j++) { if(a[j]<a[j+1])//降序为false { panda = false; } } if(panda == true) { cout<<"Yes"<<endl; } else { cout<<"No"<<endl; } } return 0; }


测评信息: