三进制搞下, 0 表示没出现过, 第i位为1 表示 i出现了奇数次, 2表示i 出现了偶数次。#include #include #include #include #include #include #include #include #include #include #include #inc...
分类:
其他好文 时间:
2014-08-09 23:07:59
阅读次数:
325
Palindromes
A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when t...
分类:
其他好文 时间:
2014-08-09 21:36:09
阅读次数:
344
Problem Description
The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj. For a given sequence of numbers a1, a2, ..., an, if we move t...
分类:
其他好文 时间:
2014-08-09 18:48:38
阅读次数:
241
Sumdiv
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 13959
Accepted: 3433
Description
Consider two natural numbers A and B. Let S be the sum of all natur...
分类:
其他好文 时间:
2014-08-09 11:43:07
阅读次数:
226
Description
Ouroboros is a mythical snake from ancient Egypt. It has its tail in its mouth and continously devours itself.
The Ouroboros numbers are binary numbers of 2^n bits that have the prop...
分类:
其他好文 时间:
2014-08-09 11:40:57
阅读次数:
315
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeate...
分类:
其他好文 时间:
2014-08-08 20:54:46
阅读次数:
246
一、系统环境操作系统:centos6.4x86_64openssl版本:openssl-0.9.8e二、安装过程#tarzxvfopenssl-0.9.8e.tar.gz
#cdopenssl-0.9.8e
#./configsharedzlib
#make报错:md5-x86_64.s:41:Error:0xd76aa478outrangeofsigned32bitdisplacement
md5-x86_64.s:50:Error:0xe8c7b756outr..
分类:
其他好文 时间:
2014-08-08 18:24:26
阅读次数:
506
RMQ(Range Minimum/Maximum Query)问题是求区间最值问题。对于长度为 n 的数组 A,进行若干次查询,对于区间 [L,R] 返回数组A中下标在 [L,R] 中的最小(大)值。可以用线段树来解决这个问题,预处理的复杂度是 O(nlogn),查询的复杂度是 O(logn)。更...
分类:
其他好文 时间:
2014-08-08 17:34:26
阅读次数:
200
Description
Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:
1. Emergency 911
...
分类:
其他好文 时间:
2014-08-08 12:49:16
阅读次数:
187
链接:http://poj.org/problem?id=3641
题意:由费马小定理可得,对于素数p,a^p = a (mod p),但是对于某些非素数p,也有比较小的可能满足a^p = a (mod p),如果满足,则称p是a条件下的伪素数,现给出p,a,问p是不是a条件的伪素数。
思路:首先用米勒 罗宾判断p是不是素数,如果不是,判断a^p = a (mod p)是否成立。
代码:
...
分类:
其他好文 时间:
2014-08-08 12:42:05
阅读次数:
232