#include "iostream"
#include "memory.h"
#include "cstdio"
using namespace std;
int grap[500][500];
int ans;
int dis[500];
bool visited[500];
void prime(int n){
int source = 1;
for (int i = 1; i <=...
分类:
其他好文 时间:
2015-01-13 21:39:05
阅读次数:
153
&/@Shorthand notation for MapIf[PrimeQ[#], Framed@Style[#, Orange, Bold, 15], #] & /@ Range[250]Grid@Partition[If[PrimeQ[#], Tooltip[Framed@Style...
分类:
其他好文 时间:
2015-01-12 22:16:57
阅读次数:
143
主外键约束FKFOREIGN KEY(FK)CONSTRAINT fk_外键名 FOREIGN KEY(列名) REFERENCES 表2名(列名)--一般表2的主键先删除DROP TABLE MEMBER PURGE;创建表-成员CREATE TABLE MEMBER ( mid NUMBE...
分类:
其他好文 时间:
2015-01-10 20:58:18
阅读次数:
268
Oracle的sequence实现非常灵活,所以也带来一些易用性问题,如何取到新插入记录生成的sequence值与其它数据库有较大差别,本文详国介绍了5种实现读取新插入记录sequence值的方法。测试用的数据库脚本:SQL> create table T1 2 ( 3 ID NUMBE...
分类:
数据库 时间:
2015-01-09 12:07:42
阅读次数:
198
static int getNumberOfPrimes(int N) { int n = N+1;//to include 0 as the first number for easy index operations later final boolean a[] =...
分类:
其他好文 时间:
2015-01-09 01:31:29
阅读次数:
458
Co-prime
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d
& %I64u
Submit Status
Appoint description:
System Crawler (2015-01-07)
Description
Given a number N, y...
分类:
其他好文 时间:
2015-01-08 22:52:22
阅读次数:
314
这题只要知道质因数的性质就很容易做了。任意一个正整数(除了1)都可以分解成有限个质数因子的乘积。
那么假如两个数互质,那么这两个数肯定至少各有一个对方没有的质因子。所以若一个数跟n不互质,那么这个的数的质因子肯定也都属于n的质因子,那么就用容斥原理求出所有跟n不互质的所有数的个数。然后再用总的减去即可。
代码如下:
#include
#include
#include
#include...
分类:
其他好文 时间:
2015-01-08 18:11:23
阅读次数:
234
Problem Description
Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N.
Two integers are said to be co-prime or relatively pr...
分类:
其他好文 时间:
2015-01-06 23:11:11
阅读次数:
171
题意:求正整数L和U之间有多少个整数x满足形如x=pk 这种形式,其中p为素数,k>1分析:首先筛出1e6内的素数,枚举每个素数求出1e12内所有满足条件的数,然后排序。对于L和U,二分查找出小于U和L的最大数的下标,作差即可得到答案。 1 #include 2 #include 3 #incl.....
分类:
其他好文 时间:
2015-01-06 21:15:02
阅读次数:
131
DECLARE
l_api_version NUMBER := 1.0;
l_init_msg_list VARCHAR2(100) := fnd_api.g_false; -- bug 7513308;
l_commit VARCHAR2(100) := fnd_api.g_false;
l_validation_level NUMBE...
分类:
其他好文 时间:
2015-01-06 17:57:17
阅读次数:
176