与‘基础算法-枚举’有关的日志

uva1591

maksyuki 发表于 oj 分类,标签:
0
uva1591

Dr. Tuple is working on the new data-mining application for Advanced Commercial Merchandise Inc. One of the subroutines for this application works with two arrays P and Q containing N records of data each (records are numbered from 0 to N − 1). Array >>继续阅读

uva508

maksyuki 发表于 oj 分类,标签:
0
uva508

Samuel F. B. Morse is best known for the coding scheme that carries his name. Morse code is still used in international radio communication. The coding of text using Morse code is straightforward. Each character (case is insignificant) is translated >>继续阅读

uva253

maksyuki 发表于 oj 分类,标签:
0
uva253

We have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of these colors. The cube’s faces are numbered as in Figure 1.

Since a cube has 6 faces, our machine can paint a f >>继续阅读

hdu1395

maksyuki 发表于 oj 分类,标签: ,
0
hdu1395

2^x mod n = 1

Problem Description

Give a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1. >>继续阅读

uva10976

maksyuki 发表于 oj 分类,标签:
0
uva10976

It is easy to see that for every fraction in the form  (k > 0), we can always find two positive integers x and yx ≥ y, such that:

Now our question is: can you write a program that counts how many such pairs of x and y there are for any given  >>继续阅读