题解列表

筛选

P1001 (C语言代码)

摘要:解题思路:先对这个数组排序,再根据下标的位置关系找到第k大和第k小的数,最后对其差值判断是否为素数。注意事项:1.容易忽略当差值小于2的情况,素数是从大于二开始。2.判断是否为素数的时候可能使代码运行……

P1014 (C++代码)数据有错

摘要:                         代码是正确的,区间 Dp。#include <bits/stdc++.h> constexpr auto Inf = 0X3F3F3F3F;

P1001 (C++代码)水一下

摘要:解题思路:    又水了一发啊参考代码:#include<bits/stdc++.h> #define hh ios::sync_with_stdio(false),cin.tie(0),cout.……

C语言训练-求素数问题 (C语言代码)

摘要:解题思路:从小到大选出质数,根据每个质数,剔除后面的成倍的非质数注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ int n; int ……

【蟠桃记】 (C++代码)

摘要:解题思路:注意事项:参考代码:#include<iostream>int main(){ using namespace std; int n,i,sum=1; while(cin.eof()!=1)……