P1178 到天宫做客
#include<iostream>
using namespace std;
int m[12]={0,31,60,91,121,152,182,213,244,274,305,335},n,time[367];
bool days[367];
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
int month,day;
cin>>month>>day;
days[m[month-1]+day-1]=1;
}
days[366]=1;
int maxxx=0,i=0;
for(int d=0;d<367;d++)
{
if(days[d])
{
if(maxxx<time[i])
maxxx=time[i];
i++;
}
else
time[i]++;
}
cout<<(int)(((double)maxxx*(double)86400/(double)366)+0.5);
return 0;
}
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ
OTZ