Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

贴三道题 有人给我的~

Posted by bobobo at 2006-10-17 16:29:39
Problem A

A+B Problem
Time Limit:1000MS  Memory Limit:10000K

Description
Calculate a+b, and got familiar with our system ^_^ 

Input
Two integer a,b (0<=a,b<=10)

Output
Output a+b

Sample Input

1 2
Sample Output

3 


Problem B

Binary string representing different numbers
Time Limit:10000MS  Memory Limit:50000K

Description

Given m=2, we have the binary string 0011. If we let the head and end connected, we obtain a loop. Now we get m elements from some position clockwise or counterclockwise. Then we start from the next position. We obtain 4 strings of length 2: 00,01, 11, 10. They represent the decimal numbers 0, 1, 3, 2.

For m=3, we obtain the string 00010111 of length 8. By getting strings of length 3, we also obtain 8 decimal numbers 0, 1, 2, 5, 5, 7, 6, 4. 



Now your job is to display such string with least order among the strings of length 2m.

Input

The first row of the input is a number n. 

The next m rows are m numbers, one number m on each row, (0<m<=3). 

Output

The output will consist of two lines for each line of input. You should print the words "m=#:", where # is the serial number of the testing data. on the first line. Then print the required string of length 2m.

Sample Input 
2
3


Sample Output 
m=2:
0011
m=3:
00010111 



Problem E
Automatic Correction of Misspellings
Time Limit:1000MS Memory Limit:50000K
Description
Some text editors offer a feature to correct words which seem to be written incorrectly. In this problem
you are asked to implement a simple Automatic Correction of Misspellings (ACM).
ACM takes care of the following misspellings of words:
1. One letter is missing (e.g., letter is written leter) or too much (e.g., letter is written lettter).
2. One letter is wrong (e.g., letter is written ketter)
3. The order of two adjacent letters is wrong (e.g., letter is written lettre)
ACM is based on a dictionary of known words. When a text contains a word which is not in the
dictionary, ACM will try to replace it by a similar word of the dictionary. Two words are similar if we
can transform one word into the other by doing exactly one of the misspellings listed above. An unknown
word is left unchanged if there is no similar word in the dictionary.
Input
The first line of the input file will give the number n of words in the dictionary (n<=10000). The next n
lines contain the dictionary words. The following line contains an integer q <=1000, the number of query
words. The next q lines contain the query words. You may assume that each word in the input consists of
1 to 25 lower case letters ('a' to 'z').
Output
For each query word, print one line with the query word followed by one of the following possibilities:
1. is correct, if the word occurs in the dictionary.
2. is a misspelling of <x>, where <x>is a word of the dictionary similar to the query word, and the
query word is not in the dictionary. In the case that there are several possibilities, select the word
from the dictionary which appeared earlier in the input.
3. is unknown, if cases 1 and 2 do not apply.
Sample Input
10
this
is
a
dictionary
that
we
will
use
for
us
6
su
as
the
dictonary
us
willl
Sample Output
su is a misspelling of us
as is a misspelling of is
the is unknown
dictonary is a misspelling of dictionary
us is correct
willl is a misspelling of will  

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator