摘要: C. Dancing Lessonstime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arenpeople taking dancing lessons. Every person is characterized by his/her dancing skillai. At the beginning of the lesson they line up from left to right. While there is at 阅读全文
posted @ 2013-03-05 16:00 剑不飞 阅读(257) 评论(0) 推荐(0) 编辑
摘要: D. Event Datestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn a history lesson the teacher asked Vasya to name the dates whennfamous events took place. He doesn't remembers the exact dates but he remembers a segment of days[li, ri](inclusi 阅读全文
posted @ 2013-03-05 13:52 剑不飞 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 食物链Time Limit:1000MSMemory Limit:10000KTotal Submissions:33156Accepted:9626Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句 阅读全文
posted @ 2013-03-05 13:18 剑不飞 阅读(142) 评论(0) 推荐(0) 编辑