为啥这题开不开快读快写时间一样呢?是因为我快读写错了吗?求助大佬qwq
#include<iostream>
#include<cstdio>
namespace xtracer{
typedef long long ll;
void read(ll &n){
ll x=0,f=1;
char ch=getchar();
while(ch<'0' or ch>'9'){
if(ch=='-')f=-1;
ch=getchar();
}
while(ch>='0' and ch<='9'){
x=x*10+ch-48;
ch=getchar();
}
n=x*f;
}
void write(ll n){
if(n>=10)write(n/10);
putchar(n%10+48);
}
}
using namespace xtracer;
ll huiwen[100000001]={},hi=0;
ll hw_prime[100000001]={},pi=0;
ll n,m;
bool hw(ll n){
ll rev=0,f=n;
while(n){
rev=rev*10+n%10;
n/=10;
}
if(rev==f)return true;
else return false;
}
void addhw(){
for(ll i=n;i<=m;i++){
if(hw(i))huiwen[hi++]=i;
}
return ;
}
bool prime(ll n){
if(n==2)return true;
if(n%2==0)return false;
for(ll i=3;i*i<=n;i++){
if(n%i==0)return false;
}
return true;
}
void addpr(){
for(ll i=0;i<hi;i++){
if(prime(huiwen[i]))hw_prime[pi++]=huiwen[i];
}
}
void output(){
for(ll i=0;i<pi;i++){
write(hw_prime[i]);
putchar('\n');
}
}
void solve(){
read(n);read(m);
addhw();
addpr();
output();
}
int main(){
solve();
return 0;
}
我记得之前我就是靠这个namespace xtracer抢到CF579A的最优解的,这次失灵了?