题解列表

筛选

求10000以内n的阶乘

解题思路:注意事项:Python默认限制了可以转换为字符串的整数的最大位数为4300位。由于10000的阶乘远大于这个限制,因此抛出了ValueError。参考代码:importmathimportsyssys.set_int_max_str_digits(100000)#设置sys.set_int_

哥德巴赫曾猜测思路简单解

解题思路:注意事项:参考代码:#include#defineMAX32767usingnamespacestd;boolisPrime(intnum){if(num<2)returnfalse;for(intj=2;j*j<=num;j++){if(num%j==0){return

优先队列实现看病,取消同步流避免超时

解题思路:优先队列,实现看病案例注意事项:取消同步流,避免超时参考代码://看病取消同步流,加快速度#includeusingnamespacestd;structpatient//定义病人结构体{charsname[20];//姓名intprior;//优先级};//比

不用switch-case

摘要:解题思路:或的用法注意事项:参考代码:#include <stdio.h>int main() { int day; scanf(&qu……