0pts求救!
查看原帖
0pts求救!
951470
hmy_ddxw__awa楼主2023/8/13 11:19
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long t=0,n=0,m=0,o=0,x=0,k=0;
	bool b=false;	
	cin>>t;
	while(t--){
		cin>>n>>m;
		while(m--){
			cin>>o>>x;
			if(o==1){
				b=true;
				k++;
			}
			else{
				b=false;
			}
		}
	}
	cout<<k<<endl;
	if(b==false){
		cout<<"-1";
	}
	return 0;
}
2023/8/13 11:19
加载中...