Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
229889 232218施彦恺 *小美的数组操作2 C++ 通过 100 0 MS 268 KB 473 2024-01-07 13:36:04

Tests(5/5):


#include<bits/stdc++.h> using namespace std; int a[102]; int main(){ int t; cin>>t; for(int i=1;i<=t;i++){ int b,s; cin>>b>>s; for(int j=1;j<=b;j++){ cin>>a[j]; } for(int j=1;j<=s;j++){ int d,f; cin>>d>>f; a[d]++; a[f]--; } bool f=false; for(int j=2;j<=b;j++){ if(a[j]<a[j-1]){ f=true; break; } } if(f==true){ cout<<"No"<<endl; } else{ cout<<"Yes"<<endl; } } return 0; }


测评信息: