摘要: 题目描述 小明要去一个国家旅游。这个国家有#NNN个城市,编号为111至NNN,并且有MMM条道路连接着,小明准备从其中一个城市出发,并只往东走到城市i停止。 所以他就需要选择最先到达的城市,并制定一条路线以城市i为终点,使得线路上除了第一个城市,每个城市都在路线前一个城市东面,并且满足这个前提下还 阅读全文
posted @ 2019-01-17 21:03 NKDEWSM 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目背景 BBB地区在地震过后,所有村庄都造成了一定的损毁,而这场地震却没对公路造成什么影响。但是在村庄重建好之前,所有与未重建完成的村庄的公路均无法通车。换句话说,只有连接着两个重建完成的村庄的公路才能通车,只能到达重建完成的村庄。 题目描述 给出BBB地区的村庄数NNN,村庄编号从000到N−1 阅读全文
posted @ 2019-01-17 20:42 NKDEWSM 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= 阅读全文
posted @ 2019-01-17 19:56 NKDEWSM 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 题目背景 一个循环格就是一个矩阵,其中所有元素为箭头,指向相邻四个格子。每个元素有一个坐标(行,列),其中左上角元素坐标为(0,0)。给定一个起始位(r,c),你可以沿着箭头方向在格子间行走。即:如果(r,c)是一个左箭头,那么走到(r,c-1);如果是一个右箭头,走到(r,c+1);如果是上箭头, 阅读全文
posted @ 2019-01-17 19:41 NKDEWSM 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Inzane finally found Zane with a lot of money to spare, so they together decided to establish a country of their own. Ruling a country is not an easy 阅读全文
posted @ 2019-01-17 16:43 NKDEWSM 阅读(314) 评论(0) 推荐(0) 编辑
摘要: Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To search for Zane, he would need a lot of money, of which he 阅读全文
posted @ 2019-01-17 16:40 NKDEWSM 阅读(474) 评论(0) 推荐(0) 编辑
摘要: Zane the wizard is going to perform a magic show shuffling the cups. There are n cups, numbered from 1 to n, placed along the x-axis on a table that h 阅读全文
posted @ 2019-01-17 16:31 NKDEWSM 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Zane the wizard had never loved anyone before, until he fell in love with a girl, whose name remains unknown to us. The girl lives in house m of a vil 阅读全文
posted @ 2019-01-17 16:30 NKDEWSM 阅读(159) 评论(0) 推荐(0) 编辑