- 博客(13)
- 收藏
- 关注
原创 结构体排序练习
Description Excel可以对一组纪录按任意指定列排序。现请你编写程序实现类似功能。Input 测试输入包含若干测试用例。每个测试用例的第1行包含两个整数 N (<=100000) 和 C,其中 N 是纪录的条数,C 是指定排序的列号。以下有 N 行,每行包含一条学生纪录。每条学生纪录由学号(6位数字,同组测试中没有重复的学号)、姓名(不超过8位且不包含空格的字符串)、成绩(闭区间
2016-04-09 23:03:18
482
原创 进制转换
Problem Description输入一个十进制数N,将它转换成R进制数输出。Input输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(2<=R<=16, R<>10)。Output为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10用A表示,等等)。Sample Input7 2 23 12 -4 3Sample O
2016-04-09 22:58:40
333
原创 Automatic Poetry
Oh God”, Lara Croft exclaims, “it’s one of these dumb riddles again!”In Tomb Raider XIV, Lara is, as ever, gunning her way through ancient Egyptian pyramids, prehistoric caves and medival hallways. Now
2016-04-09 22:56:07
302
原创 Immediate Decodability
Problem Description An encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all c
2016-04-09 22:53:23
376
原创 Andy's First Dictionary
Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinking up all the wor
2016-04-09 22:50:07
660
原创 Decode the tape
Your boss has just unearthed a roll of old computer tapes. The tapes have holes in them and might contain some sort of useful information. It falls to you to figure out what is written on them. Input
2016-04-09 22:46:32
251
原创 Artificial Intelligence?
Physics teachers in high school often think that problems given as text are more demanding than pure computations. After all, the pupils have to read and understand the problem first! So they don’t st
2016-04-09 22:43:35
414
原创 Excuses, Excuses!
Judge Ito is having a problem with people subpoenaed for jury duty giving rather lame excuses in order to avoid serving. In order to reduce the amount of time required listening to goofy excuses, Judge
2016-04-09 22:38:14
511
原创 Catch That Cow
Problem Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a po
2016-04-09 22:27:00
204
原创 Lowest Common Multiple Plus
Description 求n个数的最小公倍数。Input 输入包含多个测试实例,每个测试实例的开始是一个正整数n,然后是n个正整数。Output 为每组测试数据输出它们的最小公倍数,每个测试实例的输出占一行。你可以假设最后的输出是一个32位的整数。Sample Input 2 4 6 3 2 5 7 Sample Output 12 70 思路:可以按顺序先求前两个数的最小公倍数,然后
2016-04-09 22:21:53
213
原创 分拆素数和
Description 把一个偶数拆成两个不同素数的和,有几种拆法呢?Input 输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。Output 对应每个偶数,输出其拆成不同素数的个数,每个结果占一行。Sample Input 30 26 0 Sample Output 3 2 代码#include<stdio.h>#include<math.h>
2016-04-09 11:57:39
294
原创 Where's Waldorf?
Given a m by n grid of letters, (1 ≤ m, n ≤ 50), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line of letters in the gri
2016-04-09 11:54:41
327
原创 Palindromes
Description 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 the string is r
2016-04-04 20:07:10
401
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人