题解 P1085 【不高兴的津津】
这题目在顺序与分支里居然用了For
实在是太不科学了
所以本题的正解是一串if
O(1)复杂度,脚踩STD
#include <iostream>
using namespace std;
int main()
{
int t1,t2;
int maxf=/*你觉得应该是多少呢?*/;
int t=0; //最大量,最大的天数
int now=0;//记录现在是哪天
cin>>t1>>t2;
now++;
if(t1+t2>maxf) maxf=t1+t2,t=now;
cin>>t1>>t2;
now++;
if(t1+t2>maxf) maxf=t1+t2,t=now;
cin>>t1>>t2;
now++;
if(t1+t2>maxf) maxf=t1+t2,t=now;
cin>>t1>>t2;
now++;
if(t1+t2>maxf) maxf=t1+t2,t=now;
cin>>t1>>t2;
now++;
if(t1+t2>maxf) maxf=t1+t2,t=now;
cin>>t1>>t2;
now++;
if(t1+t2>maxf) maxf=t1+t2,t=now;
cin>>t1>>t2;
now++;
if(t1+t2>maxf) maxf=t1+t2,t=now;
cout<<t;
return 0;
}