本人写的c++代码如下:
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define NR 1000000005
bool a[NR];
bool b[NR];
bool isPalindromeNumber(LL num)
{
int fresh = 0;
if (num < 0 || (num > 0 && num % 10 == 0))
return false;
while (fresh < num)
{
fresh *= 10;
fresh += num % 10;
num /= 10;
}
if (num == fresh || num == fresh / 10)
return true;
return false;
}
int main()
{
LL t;
cin >> t;
LL cnt = 0;
for (LL i = 1; i <= t; i++)
{
LL tmp;
cin >> tmp;
if (isPalindromeNumber(tmp))
{
cnt++;
if (i > 1e9)
a[i] = 1;
else
{
LL tmpp = i - 1000000000;
b[tmpp] = 1;
}
}
}
cout << cnt;
for (LL i = 1; i <= t; i++)
{
if (i > 1e9)
{
if (a[i])
cout << "Yes\n";
else
cout << "No\n";
}
else
{
if (b[i])
cout << "Yes\n";
else
cout << "No\n";
}
}
return 0;
}
原题链接:传送门
为何总是如下图:
调试了半天啊啊,用的是win32的g++编译,系统版本无问题,用的是windows,一直报错,找不出问题。
有大佬可以解答一下的吗?