![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
杭电
文章平均质量分 70
十泉浩手中的馒头
存放学习生活中的笔记内容
展开
-
杭电1022(栈)(思路和注释)
问题描述随着新学期的到来,伊格纳修斯火车站现在非常繁忙。许多学生想乘火车回到学校(因为伊格纳修斯火车站的火车是世界上最快的V^)。但问题来了,只有一条铁路,所有的火车都停在那里。所以所有的火车都从一边进来,然后从另一边出来。对于这个问题,如果A列车先进入铁路,然后B列车在A列车离开之前进入铁路,那么A列车在B列离开之前是不能离开的。下面的图片说明了问题的所在。现在的问题是,车站最多有9列火车,所有列车都有一个ID(编号从1到n),火车按O1顺序进入铁路,你的任务是确定火车是否能按O2顺序下车。输入输入原创 2021-09-16 19:16:50 · 142 阅读 · 0 评论 -
杭电1443 Joseph(思路和解析)
问题描述约瑟夫的问题众所周知。对于那些不熟悉原始问题的人:从n个人中,编号1,2,。。每一个人都要被处决,只有最后一个人的生命才会被拯救。约瑟夫很聪明,选择了最后一个留下来的人的位置,从而挽救了他的生命,向我们传达了这一事件的信息。例如,当n=6和m=5时,人民将按5、4、6、2、3和1顺序被处死。假设有好的和坏的。在这个圈子里,前k是好人,最后k是坏人。你必须确定最小的m,在第一个好人之前,所有的坏人都会被处决。输入输入文件由包含k的单独行组成,输入文件中的最后一行包含0。你可以假设0<k&原创 2021-09-13 23:42:58 · 182 阅读 · 0 评论 -
杭电1052-Tian Ji -- The Horse Racing 贪心算法(有思路和注释)
Problem DescriptionHere is a famous story in Chinese history.“That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.”“Both of Tian and the king have three horses in d原创 2021-09-12 15:15:51 · 403 阅读 · 0 评论 -
杭电oj1072Nightmare(带注释和思路)(bfs)
Problem DescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial exploding time of the bomb is set to原创 2021-09-10 20:56:37 · 172 阅读 · 0 评论 -
杭电1010Tempter of the Bone(dfs)
Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone was a trap, and he tried desperately原创 2021-09-09 23:33:32 · 147 阅读 · 0 评论 -
杭电1728逃离迷宫(bfs)
逃离迷宫Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 46838 Accepted Submission(s): 11480Problem Description给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,原创 2021-09-09 11:24:26 · 105 阅读 · 0 评论 -
杭电1087Super Jumping(dp)
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game can be played by two or more than two pla原创 2021-08-30 09:09:16 · 91 阅读 · 0 评论 -
杭电ojSubset sequence(子集序列)
Problem DescriptionConsider the aggregate An= { 1, 2, …, n }. For example, A1={1}, A3={1,2,3}. A subset sequence is defined as a array of a non-empty subset. Sort all the subset sequece of An in lexicography order. Your task is to find the m-th one.Input原创 2021-08-28 22:31:25 · 203 阅读 · 0 评论 -
结构体内的数组初始化(杭电2023)
写杭电2023题的时候发现一个很神奇的事情在vs2019编译器上,对结构体内的数组进行int a[6]={0,0,0,0,0,0}这样的初始化是没什么问题的而在杭电oj提交时0_0_36549296_2139.cpp0_0_36549296_2139.cpp(15) : error C2536: “student::student::aa”: 无法指定数组的显式初始值设定项0_0_36549296_2139.cpp(15) : 参见“student::aa”的声明所幸就直接在主函数里初始原创 2021-08-15 11:31:08 · 809 阅读 · 0 评论