求解惑
  • 板块灌水区
  • 楼主North_encounter
  • 当前回复3
  • 已保存回复3
  • 发布时间2023/10/11 20:30
  • 上次更新2023/11/2 14:25:21
查看原帖
求解惑
850632
North_encounter楼主2023/10/11 20:30
#include<bits/stdc++.h>
using namespace std;
struct student{
	int max,min;
}op[114514];
signed main(){
	int t=0;
	int a=0,n=0;
	cin>>t;
	for(int u=1;u<=t;u++){
	//	cout<<endl<<u<<endl<<endl;
		cin>>a>>n;
		for(int i=1;i<=n;i++){
			op[i].max=0;
			op[i].min=114514;
		}
		for(int i=1;i<=n;i++){
			int day=0,hour=0;
			cin>>day>>hour;
			op[day].max=max(op[day].max,hour);
			op[day].min=min(op[day].min,hour);
		}
		int x=0;
		for(int i=1;i<=a;i++){
			if(op[i].max-op[i].min>=0){
				x+=op[i].max-op[i].min;
			}
		}
		if(x>=a*8){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

为什么while执行完一次后第二次在输入出卡住了,调试时也在那里卡住

2023/10/11 20:30
加载中...