P1047第一个AC,其他全部RE

P1047 [NOIP2005 普及组] 校门外的树

@[li_yuzhe](/user/1328330) 求关注 (1)数组开小了,所以会 RE\ (2)左端点是 0 ```cpp #include<bits/stdc++.h> using namespace std; int a[100001]; int main(){ int n,k; cin>>n>>k; int x,y; int s=0; for(int i=1;i<=k;i++){ cin>>x>>y; for(int j=x;j<=y;j++){ a[j]=1; } } for(int i=0;i<=n;i++){ if(a[i]==0) s++; } cout<<s; return 0; }
by Dream_Creator @ 2024-04-06 21:00:29


@[Dream_Creator](/user/529722) 感谢!关注了奥!
by liyuzhe456 @ 2024-04-06 21:02:59


|