AnanagramsMost crossword puzzle fans are used toanagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POT...
分类:
其他好文 时间:
2015-02-05 23:08:11
阅读次数:
186
这题刚开始看的时候,的确被吓了一跳,13次方,这也太大了,而且还是任意的x,有点麻烦,但是仔细分析之后,发现有点窍门:
65|f(x),不妨设5*x^13+13*x^5+k*a*x=m*65,于是可以得到:
x*(5*x^12+13*x^4+k*a)=m*65,继续得到:
x*(5*x^12+13*x^4+k*a)/65=m,因为是对于任意的x均成立,所以(5*x^12+13*x^4+k*a...
分类:
其他好文 时间:
2015-02-04 18:48:00
阅读次数:
102
这道题其实挺简单的,因为只看最后一位,所以就讨论最后一位的情况就可以了。而最后一位显然是有周期性的。
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int a,b,mode[12];
while(scanf("%d%d",&a,&b)!=EOF)
{
...
分类:
其他好文 时间:
2015-02-04 18:39:20
阅读次数:
105
Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that there will be on...
分类:
其他好文 时间:
2015-02-02 22:49:09
阅读次数:
234
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.
Given an integer n, return all distinct solutions to the n-queens puzzle.
...
分类:
其他好文 时间:
2015-02-02 18:11:32
阅读次数:
128
题目链接:http://poj.org/problem?id=1386Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open...
分类:
其他好文 时间:
2015-02-01 13:22:07
阅读次数:
196
【题意】:输入a,b,数字a^b最后边的那个数字。思路:知道n个数相乘,最后一位的周期最大为4就行。
【代码】
#include
#include
using namespace std;
int main()
{
int a = 0, b = 0;
while (cin >> a >> b)
{
int t[4], temp = a%10;...
分类:
其他好文 时间:
2015-02-01 12:10:18
阅读次数:
123
POJ 3678 Katu Puzzle(2-sat 模板题)...
分类:
其他好文 时间:
2015-01-31 21:55:36
阅读次数:
259
The problem:Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return...
分类:
其他好文 时间:
2015-01-30 01:23:52
阅读次数:
174
A Puzzle for PiratesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 508Accepted Submission(s): 167...
分类:
其他好文 时间:
2015-01-29 21:01:41
阅读次数:
157