飞翔 @ 2016-11-15 22:23:51
高精卡时间空间,快速幂没说模多少,真的没法做啊
by Lolierl @ 2016-11-16 06:58:25
@飞翔
快速幂也可以用高精度的
by 飞翔 @ 2016-11-17 06:18:28
@KingLolierl 关键是一个AC的都没有
by Lolierl @ 2016-11-17 06:46:52
好吧
by pupuvovovovovo @ 2016-11-19 22:23:13
不是官方数据吧。
by AFOier @ 2016-11-20 13:16:17
11月15日?以前是另外一道题吧
by NuclearBase_ACE @ 2016-11-21 19:15:22
AC代码:
#include<iostream>
using namespace std;
int n1 = 0,n2 = 0;
int ans = 0;
bool huiwen(int a)
{
int u = a;
int q[10];
int i = 0;
while(u != 0)
{
q[i] = u % 10;
u /= 10;
i++;
}
for(i = 0;i <= 3;i++)
{
if(q[i] != q[7-i])
{
return 0;
}
}
return 1;
}
int main()
{
// freopen("date.in","r",stdin);
// freopen("date.out","w",stdout);
int l = 0,y = 0,r = 0;
cin>>n1>>n2;
for(int i = n1;i <= n2;)
{
if(huiwen(i))
ans++;
i++;
l = i/10/10/10/10;
y = (i-(l*10*10*10*10))/10/10;
r = i % 100;
r++;
if(y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12)
{
if(r == 32)
{
i -= (r-1);
i += 101;
l = i/10/10/10/10;
y = (i-(l*10*10*10*10))/10/10;
r = i % 100;
if(y >= 13)
{
i -= y * 100;
i += 101;
i += 10000;
}
}
}
else if(y == 4 || y == 6 || y == 9 || y == 11)
{
if(r == 31)
{
i -= (r-1);
i += 101;
l = i/10/10/10/10;
y = (i-(l*10*10*10*10))/10/10;
r = i % 100;
if(y >= 13)
{
i -= y * 100;
i += 101;
i += 10000;
}
}
}
else if(y == 2)
{
if(l % 4 == 0 && l % 100 != 0)
{
if(r == 30)
{
i -= (r-1);
i += 101;
}
}
else if(l % 400 == 0)
{
if(r == 30)
{
i -= (r-1);
i += 101;
}
}
else if(r == 29)
{
i -= (r-1);
i += 101;
}
}
}
cout<<ans;
// fclose(stdin);
// fclose(stdout);
return 0;
}
骗你我死全家
by smzzlceshi @ 2016-11-21 22:18:42
就是模拟啊
by Sqrt_tyz @ 2016-11-22 13:00:19
为什么11月15日就有人发言,不是19号考的吗