【codeforces】Bulbs 淡淡的烟草味﹌ 2022-09-24 00:26 137阅读 0赞 ![这里写图片描述][20160721230838563] ![这里写图片描述][20160721230850345] ![这里写图片描述][20160721230901407] 抱着水的心态就行了=.= #include<stdio.h> #include<algorithm> using namespace std; int a[100000]; int main() { int n,m,mark=1; while(scanf("%d %d",&n,&m)!=EOF) { int t,s,k=0; for(int l=0; l<n; l++) { scanf("%d",&t); for(int j=0; j<t; j++) { scanf("%d",&s); a[k]=s; k++; } } sort(a,a+k); for(int l=0; l<k; l++) { if(a[l]==mark) mark++; } if(mark==m+1) printf("YES\n"); else printf("NO\n"); } return 0; } [20160721230838563]: /images/20220720/10374b2aef0e4c978f544aa81a73d60f.png [20160721230850345]: /images/20220720/3bf41f8f02ad4e54bdc47e6afc9539a1.png [20160721230901407]: /images/20220720/3b5db11257264a6ab7c8de3b73a8dd8c.png
还没有评论,来说两句吧...