超时怎么优化
查看原帖
超时怎么优化
1052994
venti06楼主2023/8/19 20:36
long long t,l,r,n;
cin>>t;
while(t--){
	cin>>l>>r;
	n=0;
	for(int i=l;i<=r;i++){
		if(i%2!=0){
			n++;
		}
	}
	cout<<n<<"\n";
}
2023/8/19 20:36
加载中...