Welcome to Yumao′s Blog.
ZOJ Problem Set – 2417 Lowest Bit
, 2011年03月21日 , C Language , 评论 在〈ZOJ Problem Set – 2417 Lowest Bit〉中留言功能已關閉 ,

也是一道AC比較高的
感覺最近只對簡單題有feel?
盯著難題看了很久我只是想到了夜宵。。

Lowest Bit
Time Limit: 1 Second Memory Limit: 32768 KB

Given an positive integer A (1 <= A <= 100), output the lowest bit of A. For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2. Another example goes like this: given A = 88, we can write A in binary form as 1011000, so the lowest bit of A is 1000, so the output should be 8. (閱讀全文…)

ZOJ Problem Set – 2970 Faster, Higher, Stronger
, 2010年04月13日 , C Language , 评论 在〈ZOJ Problem Set – 2970 Faster, Higher, Stronger〉中留言功能已關閉 ,
Faster, Higher, Stronger
Time Limit: 1 Second      Memory Limit: 32768 KB

In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China and Beijing Olympics is to be a festival for people all over the world as well.

The motto of Olympic Games is “Citius, Altius, Fortius”, which means “Faster, Higher, Stronger”.

In this problem, there are some records in the Olympic Games. Your task is to find out which one is faster, which one is higher and which one is stronger.

Input

(閱讀全文…)

ZOJ Problem Set – 1006 Do the Untwist
, 2010年04月04日 , C Language , 评论 在〈ZOJ Problem Set – 1006 Do the Untwist〉中留言功能已關閉 ,
Do the Untwist

——————————————————————————–

Time Limit: 1 Second      Memory Limit: 32768 KB

——————————————————————————–

Cryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the ciphertext) so that no one seeing the ciphertext will be able to figure out the plaintext except the intended recipient. Transforming the plaintext to the ciphertext is encryption; transforming the ciphertext to the plaintext is decryption. Twisting is a simple encryption method that requires that the sender and recipient both agree on a secret key k, which is a positive integer.

The twisting method uses four arrays: plaintext and ciphertext are arrays of characters, and plaincode and ciphercode are arrays of integers. All arrays are of length n, where n is the length of the message to be encrypted. Arrays are origin zero, so the elements are numbered from 0 to n – 1. For this problem all messages will contain only lowercase letters, the period, and the underscore (representing a space).

(閱讀全文…)

关键字:, , , , , , ,
分页 (1): 1