啊啊啊啊啊我的TLE

P1217 [USACO1.5] 回文质数 Prime Palindromes

@[会飞的海洋566](/space/show?uid=108809) 首先偶数不可能是回文质数
by andyli @ 2018-07-05 22:26:15


`isprime`函数应该这样写: ```cpp bool isPrime(long long num){ int x = sqrt(num) + 0.5;//防止浮点误差 for(long long i=2;i<=x;i++){ if(num%i==0){ return false; } } return true; } ```
by andyli @ 2018-07-05 22:30:36


@[会飞的海洋566](/space/show?uid=108809) 还用您用`int`足够了
by andyli @ 2018-07-05 22:31:46


或者枚举回文数的一半
by nflsjxc @ 2018-07-05 23:43:09


|