摘要: 时间限制:2000ms单点时限:200ms内存限制:256MB描述Given N arithmetic expressions, can you tell whose result is closest to 9?输入Line 1: N (1 #include #include using namespace std;int main(){int N; cin >> N; int index = 1; double res = DBL_MAX; double ans; for(int i = 1 ; i > a >> op >> b; switch.. 阅读全文
posted @ 2014-04-07 17:36 Shanks-香克斯 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 时间限制:2000ms单点时限:1000ms内存限制:256MB描述Alice和Bob还有其他几位好朋友在一起玩传话游戏。这个游戏是这样进行的:首先,所有游戏者按顺序站成一排,Alice站第一位,Bob站最后一位。然后,Alice想一句话悄悄告诉第二位游戏者,第二位游戏者又悄悄地告诉第三位,第三位又告诉第四位……以此类推,直到倒数第二位告诉Bob。两位游戏者在传话中,不能让其他人听到,也不能使用肢体动作来解释。最后,Bob把他所听到的话告诉大家,Alice也把她原本所想的话告诉大家。由于传话过程中可能出现一些偏差,游戏者越多,Bob最后听到的话就与Alice所想的越不同。Bob听到的话往往会变 阅读全文
posted @ 2014-04-07 17:30 Shanks-香克斯 阅读(1480) 评论(0) 推荐(0) 编辑
摘要: 时间限制:10000ms单点时限:1000ms内存限制:256MB描述You are given a sequence of integers, A = a1, a2, ... an. A consecutive subsequence of A (say ai, ai+1 ... aj) is called a "repeated sequence" if it appears more than once in A (there exists some positive k that ai+k = ai, ai+k+1 = ai+1, ... aj+k = aj) an 阅读全文
posted @ 2014-04-07 15:03 Shanks-香克斯 阅读(158) 评论(0) 推荐(0) 编辑