无欢 @ 2018-02-03 14:11:45
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
struct node
{
char d[17];
};
node c[17];
char a[9],b[9],e[17],len=0;
int se[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int year1,moon1,date1;
int year2,moon2,date2;
int i,j,k,sum=0;
int main()
{
k=0;
i=0;
while(len<16)
{
scanf("%s",c[i].d);
for(j=0;j<=strlen(c[i].d)-1;j++)
{
e[k]=c[i].d[j];
k++;
}
len+=strlen(c[i].d);
i++;
}
for(i=0;i<=7;i++)
{
a[i]=e[i];
b[i]=e[i+8];
}
year1=(a[0]-'0')*1000+(a[1]-'0')*100+(a[2]-'0')*10+(a[3]-'0')*1;
year2=(b[0]-'0')*1000+(b[1]-'0')*100+(b[2]-'0')*10+(b[3]-'0')*1;
moon2=(b[4]-'0')*10+(b[5]-'0')*1;
date2=(b[6]-'0')*10+(b[7]-'0')*1;
for(i=year1;i<=year2;i++)
{
moon1=(i/1%10*10)+(i/10%10*1);
date1=(i/100%10*10)+(i/1000%10*1);
if(moon1!=2)
{
if(i!=year2)
{
if(date1<=a[moon1])
{
sum++;
}
}
else
{
if(moon1<moon2)
{
sum++;
}
if(moon1==moon2)
{
if(date1<=date2)
{
sum++;
}
}
}
}
else
{
if((i%4==0&&i%100!=0)||(i%400==0))
{
if(i!=year2)
{
if(date1<=29)
{
sum++;
}
}
else
{
if(moon1<moon2)
{
if(date1<=se[moon1])
{
sum++;
}
}
if(moon1==moon2)
{
if(date1<=date2)
{
sum++;
}
}
}
}
else
{
if(i!=year2)
{
if(date1<=28)
{
sum++;
}
}
else
{
if(moon1<moon2)
{
if(date1<=se[moon1])
{
sum++;
}
}
if(moon1==moon2)
{
if(date1<=date2)
{
sum++;
}
}
}
}
}
}
cout<<sum;
return 0;
}
没有O2优化60分 O2后70分 谁能告诉我O2优化是干嘛的!
by 你猜我叫啥啊 @ 2020-10-11 22:31:28
@Velix 嘿,还真是。 大佬能解释一下什么是AK,吊打std吗,看不懂(不要问我为什么问,因为别人不回答这个问题)
by AyxC @ 2020-10-16 19:07:49
@你猜我叫啥啊
AK v.在......比赛中获得满分
例句:chen_zhe AK IOI
by AFwhcing @ 2020-10-26 20:49:49
@Lonely_zongqing dalao济济啊!
by 我太蒻了 @ 2020-11-26 17:51:30
考古
by Solgareo @ 2021-01-10 22:36:27
@Aaron_Liu
吸氧原子和吸臭氧
/手动滑稽
by Chenyu_Ye @ 2021-01-22 20:58:18
考古
by Aresene @ 2021-03-12 13:36:58
@Velix 举爪
by RoFtaCD @ 2021-03-14 12:01:00
更臭的臭氧
#pragma GCC optimize(114514)
by Amspirin @ 2021-03-19 21:39:44
@蒟蒻_齐贝林 你这个吸完怕不是当场谔死
by 安城的芒果酱 @ 2021-03-30 18:27:00
@Lonely_zongqing%%%