摘要: CIVIC DILL MIXTime Limit: 1000MS Memory limit: 65536K题目描述Roman numerals are an ancient numbering system used extensively throughout Europe through the 13th century (where it was eventually replaced by our current positional system). Vestiges of this system still exist today on clock faces, building 阅读全文
posted @ 2012-04-15 11:46 某某。 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 这道题刚开始看到的时候一看见时一个很大的数,就觉得有一个规律的,但是算的时候发现时周期是十九,再然后写了几个数字之后发现是20进制,但是忽略了零,一直就纳闷20为什么算不对,然后就一直处理,到了晚上的时候我回去做的时候在发现我的a[0]不应该忽略,结果又改成了0,再然后交还是不对,然后就一直再改,最后赵鹏告诉我我忽略了7.8位= =。。。这道题一直搞到12点多。。。当时满脸黑线了= =Give Me an ETime Limit: 1000MS Memory limit: 65536K题目描述Everyone knows that the letter “E” is the most freq 阅读全文
posted @ 2012-04-15 11:42 某某。 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Max SumTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 73271Accepted Submission(s): 16779Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max 阅读全文
posted @ 2012-04-15 11:40 某某。 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 最大子序列和问题问题描述:输入一组整数,求出这组数字子序列和中最大值。也就是只要求出最大子序列的和,不必求出最大的那个序列。例如:序列:-2 11 -413 -5 -2,则最大子序列和为20。序列:-6 2 4 -7 5 3 2 -1 6 -9 10 -2,则最大子序列和为16。算法一://穷举法,复杂度O(n^3)long maxSubSum1(const vector<int>& a){ long maxSum = 0; for (int i = 0; i < a.size(); i++) { for (int j = i; j < a.size(); j+ 阅读全文
posted @ 2012-04-15 11:37 某某。 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Black and white paintingTime Limit: 1000MS Memory limit: 65536K题目描述You are visiting the Centre Pompidou which contains a lot of modern paintings. In particular you notice one painting which consists solely of black and white squares, arranged in rows and columns like in a chess board (no two adjacen 阅读全文
posted @ 2012-03-10 16:23 某某。 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 数据结构实验之求二叉树后序遍历和层次遍历Time Limit: 1000MS Memory limit: 65536K题目描述已知一棵二叉树的前序遍历和中序遍历,求二叉树的后序遍历。输入输入数据有多组,第一行是一个整数t (t<1000),代表有t组测试数据。每组包括两个长度小于50 的字符串,第一个字符串表示二叉树的先序遍历序列,第二个字符串表示二叉树的中序遍历序列。输出每组第一行输出二叉树的后序遍历序列,第二行输出二叉树的层次遍历序列示例输入2abdegcfdbgeafcxnliulnixu示例输出dgebfcaabcdefglinuxxnuli#include<stdio.h 阅读全文
posted @ 2012-03-05 23:56 某某。 阅读(1694) 评论(0) 推荐(0) 编辑
摘要: Train Problem ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8757Accepted Submission(s): 3221Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because 阅读全文
posted @ 2012-03-02 20:47 某某。 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 很郁闷。。。一直以为是精度问题。。。其实还就是精度问题==。。。另外还有一个问题就是看错题了,最后的那个数字我写成了double 型。后来改正后就AC了= =。。。刘老师不在的话,我想说一句“我怀念我的103小马甲= =”Ballot evaluationTime Limit: 1000MS Memory limit: 65536K题目描述Before the 2009 elections at the European Parliament, Bill and Ted have asked their friends to make guesses about the outcome of 阅读全文
posted @ 2012-02-26 23:09 某某。 阅读(370) 评论(2) 推荐(0) 编辑
摘要: 数据结构实验之二叉树的建立与遍历添加一下各个遍历的输出便于理解顺序树abd,,e,,cf,,g,,先序遍历打印:abdecfg中序遍历打印:dbeafcg后序遍历打印:dbefcgaTime Limit: 1000MS Memory limit: 65536K题目描述 已知一个按先序序列输入的字符序列,如abc,,de,g,,f,,,(其中逗号表示空节点)。请建立二叉树并按中序和后序方式遍历二叉树,最后求出叶子节点个数和二叉树深度。输入输入一个长度小于50个字符的字符串。输出输出共有4行:第1行输出中序遍历序列;第2行输出后序遍历序列;第3行输出叶子节点个数;第4行输出二叉树深度。示例输入.. 阅读全文
posted @ 2012-02-26 12:08 某某。 阅读(3981) 评论(0) 推荐(0) 编辑
摘要: Problem Description今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的考生,并将他们的成绩按降序打印。Input测试输入包含若干场考试的信息。每场考试信息的第1行给出考生人数N ( 0 < N< 1000 )、考题数M ( 0 < M < = 10 )、分数线(正整数)G;第2行排序给出第1题至第M题的正整数分值;以下N行,每行给出一名考生的准考证号(长度不超过20的字符串)、该生解决的题目总数m、以及这m道题的题号(题目号由1到M)。 阅读全文
posted @ 2012-02-22 23:48 某某。 阅读(294) 评论(0) 推荐(0) 编辑