【题目】
Problem E
Open Credit System
Input: Standard Input
Output: Standard Output
In an open credit system, the students can choose any course they like, but there is a problem. Some of the stude...
分类:
其他好文 时间:
2014-05-03 00:22:50
阅读次数:
380
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 requi...
分类:
其他好文 时间:
2014-05-02 23:54:43
阅读次数:
474
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 underst...
分类:
其他好文 时间:
2014-05-02 23:39:35
阅读次数:
485
【题目】
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...
分类:
其他好文 时间:
2014-05-02 23:35:16
阅读次数:
526
Problem I
Automatic Poetry
Input: standard input
Output: standard output
Time Limit: 2 seconds
Memory Limit: 32 MB
“Oh God”, Lara Croft exclaims, “it’s one of these dumb rid...
分类:
其他好文 时间:
2014-05-02 22:51:52
阅读次数:
352
线程1循环3次,线程2循环6次,线程3循环9次,接着又回到线程1循环3次,线程2循环6次,线程3循环9次...如此循环50次 1 package ch03; 2
3 import java.util.concurrent.locks.Condition; 4 import java.uti...
分类:
编程语言 时间:
2014-05-01 19:25:26
阅读次数:
376
今天在微博看到一道有趣的题目。作为python的脑残粉,自然手痒。
题目在这里。
FizzBuzzWhizz
你是一名体育老师,在某次课距离下课还有五分钟时,你决定搞一个游戏。此时有100名学生在上课。游戏的规则是:
1. 你首先说出三个不同的特殊数,要求必须是个位数,比如3、5、7。
2. 让所有学生拍成一队,然后按顺序报数。
3. 学生报数时,如果所报数字是第一个特殊数...
分类:
其他好文 时间:
2014-05-01 18:35:36
阅读次数:
241
树形结构是一类重要的非线性数据结构,其中以树和二叉树最为常用。
二叉树是每个结点最多有两个子树的有序树。通常子树的根被称作“左子树”(left subtree)和“右子树”(right subtree)。二叉树常被用作二叉查找树和二叉堆或是二叉排序树。二叉树的每个结点至多只有二棵子树(不存在度大于2的结点),二叉树的子树有左右之分,次序不能颠倒。二叉树的第i层至多有2的 i -1次方个结点;...
分类:
其他好文 时间:
2014-04-30 22:44:38
阅读次数:
501
题目:输入一个表示整数的字符串,把该字符串转换成整数并输出。例如输入字符串"345",则输出整数345。...
分类:
其他好文 时间:
2014-04-30 22:24:40
阅读次数:
459
前序:
(二叉)堆数据结构是一种数组对象,它可以被视为一棵完全二叉树。树中每个节点与数组中存放该节点值的那个元素对应。
树的每一层都是填满的,最后一层除外。
树的根为a[1] (在这里是从1开始的,也可以从0开始),给定了某个节点的下标i,其父节点为i/2,左二子为2*i,右儿子为2*i+1。
二叉堆满足二个特性:
1.父结点的键值总是大于或等于(小于或等于)任何一个...
分类:
其他好文 时间:
2014-04-30 22:15:38
阅读次数:
434