这是一个入门的数论题目 , 只需要简单的找素数和快速幂取模
题意:输入一个数 n , 如果这个数是非素数 , 问是不是 这个2~n-1区间的所有数都满足 ?
解法:由于数据量不大 , 可以直接暴力求解
解法1: 暴力求解
#include
#include
#include
using namespace std;
long long prime[65010];
...
分类:
其他好文 时间:
2014-06-15 15:26:51
阅读次数:
215
/*
*Copyright (c) 2013, 烟台大学计算机学院
* All rights reserved.
* 作 者:马广明
* 完成日期:2014 年 6 月 7 日
* 版 本 号:v1.0
* 问题描述:电子词典
*/
#include
#include
#include
#include
using namespace std;
clas...
分类:
其他好文 时间:
2014-06-14 17:52:17
阅读次数:
209
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;namespace Com.LingHu.D...
分类:
数据库 时间:
2014-06-14 17:25:40
阅读次数:
219
在linux下的hash_maphash_map本身以前本身不属于标准库,是后来引入的.有两种可能:一种可能它被放在了stdext名空间里,那么你就要使用using namespace stdext 引入该名空间并#include ;.另一种可能就是它被反在了标准库的ext目录底下,仍旧属于std名...
分类:
系统相关 时间:
2014-06-14 16:01:19
阅读次数:
344
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up: Can you solve it without using extra space?比...
分类:
其他好文 时间:
2014-06-14 15:48:59
阅读次数:
217
decltype关键字用于查询表达式的类型。与其他特性结合起来之后会有意想不到的效果。
decltype的语法是
decltype (expression)
实例:
#include
#include
using namespace std;
int main()
{
int i;
double d;
float f;
struct A
{
int i;
dou...
分类:
编程语言 时间:
2014-06-14 14:50:28
阅读次数:
256
未改偏移量之前
using (FileStream fs = new FileStream(txtFilePathRead.Text, FileMode.Open))
{
//创建一个容量4M的数组
byte[] byteData = new byte[1024 * 1024 * 4];...
分类:
其他好文 时间:
2014-06-14 14:13:27
阅读次数:
216
#include
#include
using namespace std;
struct Node{
int x, y;
friend bool operator b.x; //x最小的节点在队首
}
};
int main(){
priority_queue PQ;
Node temp = {2, 3};
PQ...
分类:
其他好文 时间:
2014-06-14 14:03:20
阅读次数:
355
1.首先需要安装必须的库,PCRE,zlib
sudo apt-get install libpcre3 libpcre3-dev
如果找不到文件的话就下载源文件进行安装。
2.解压下载的nginx源码,进入目录: sudo ./configure 得到的输出如下:
Configuration summary
+ using system PCRE library
+ ...
分类:
其他好文 时间:
2014-06-14 13:31:29
阅读次数:
219
选择出数列中前k个最大的数。
这里因为数据特殊,所以可以使用hash表的方法:
#include
#include
#include
#include
using namespace std;
const int SIZE = 1000005;
const int SMALL = -500000;
bool arr[SIZE];
int main()
{
int n, m, a,...
分类:
其他好文 时间:
2014-06-14 11:03:43
阅读次数:
244