关于题目数据的建议
查看原帖
关于题目数据的建议
91757
BlakrPander楼主2020/10/11 15:00

个人的AC代码是:

#include<bits/stdc++.h>
using namespace std;
int main(){
	int date=0;
	int a,b,max=0;
	for(int i=1;i<=7;i++){
		cin>>a>>b;
		if(a+b>max){
			max=a+b;
			date=i;
		}
	}
	if(max<=8)
		cout<<"0";
	else
		cout<<date;
		return 0;
}

但是在第一次提交时,我并没有对max做小于等于8的特判,我却同样AC了。可知题目的数据应该是没有结果小于等于8的。如果是数据组疏忽的话,我觉得加上比较好。

2020/10/11 15:00
加载中...