PAT-A 1003 Emergency (25)

  图的 Dijkstra 算法,在算法基础上增加最大点权和以及最短路径条数的记录。

As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are marked on the map. When there is an emergency call to you from some other city, your job is to lead your men to the place as quickly as possible, and at the mean time, call up as many hands on the way as possible.

PAT-A 1148 Werewolf - Simple Version (20)

  狼人杀简单版,暴力枚举

Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,

  • player #1 said: “Player #2 is a werewolf.”;
  • player #2 said: “Player #3 is a human.”;
  • player #3 said: “Player #4 is a werewolf.”;
  • player #4 said: “Player #5 is a human.”; and
  • player #5 said: “Player #4 is a human.”.

Given that there were 2 werewolves among them, at least one but not all the werewolves were lying, and there were exactly 2 liars. Can you point out the werewolves?

Now you are asked to solve a harder version of this problem: given that there were N players, with 2 werewolves among them, at least one but not all the werewolves were lying, and there were exactly 2 liars. You are supposed to point out the werewolves.

PAT-A 1081 Rational Sum (20)

  记录一次被水题的测试点教做人的经历,果然还是差得远。

Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.

使用分支限界法解决0/1背包问题

  在算法分析课上第一次接触分支限界法(Branch & Bound),实验要求使用分支限界法解决 0/1 背包问题。虽然很清楚代码量要远高于 DP,但报告是还要写的,硬着头皮怼吧。随便在蓝桥杯题库找了一道 0/1 背包的基础题做测试,题目是算法训练的 ALGO-30 入学考试。

使用Travis CI部署Hexo博客

  使用Travis CI部署Hexo博客是Hexo官方文档推荐的部署方法,但是博客源文件会被公开。起初就是因为这一点没有使用Travis CI部署,但是刚成功部署完Hexo发了第一篇博文后我就在想,博客源文件都在本地,如果我换电脑了或者源文件不在身边或者电脑坏了怎么办?岂不是很麻烦?我这么怕麻烦个人…

  当时就搜了这个问题,果然大佬们早就提供了解决方案。一般都是把源文件也放在github,或者推送到分支。我想既然都放到分支上了,不如直接按官方推荐的,用Travis CI部署,这样甚至可以随时随地修改博文,即便本地没有环境,也可以把md交到仓库即时发布。

Github+PicGo+jsDelivr搭建博客图床

  刷CSDN瞟到jsDelivr这个免费CDN,在官网了解一下发现可以加速Github项目。想到GithubPages加载缓慢,就赶紧深入学习。然后我惊奇发现,原来我用的Icarus主题已经用了jsDelivr的CDN,大一时写界面的Bootstrap也用了!它就在身边我居然今天(昨晚)才知道?

  图床是早就有了解的,但是一直没考虑尝试,一方面是懒,另一方面是不想把图片传到别人的空间。现在能用Github做图床,岂不美哉?

Github+Coding双托管Hexo及自定义域名

  为了改善加载速度分别尝试了Coding和Gitee的托管以及CloudFlare的CDN加(减)速。无奈都不太乐观,倒是把博客同时托管在Coding,多了个备胎这样子。国内的CDN都要求必须备案,不想备案就只能走境外CDN或者只使用DNS解析。

  心血来潮买了个域名,迫不及待把它绑定到博客。这个.me的黑山国家域名我还蛮喜欢,虽然觉得.cc更可爱些,但个人博客果然是.me比较合适(上面thumbnail是黑山的科托尔)。于是博客迎来全新域名 lokka.me

设计模式 - 工厂模式(Factory Pattern)

  Java设计模式 - 工厂模式

N皇后(N-Queens)

  • LeetCode 51 N-Queens
  • LeetCode 52 N-Queens II
  • Lanqiao BASIC-27 2N-Queens
  • Lanqiao ADV-203 8-Queens
  • PAT-A 1128 N-Queens Puzzle

First diary, Hello world!

  很早就想搞个博客记录学习和生活,留给未来回首往日。Emmm…之所以拖到今天才开始着手,一方面是因为疫情一直宅家想充实,一方面是面临考研,发现自己两年半来居然一点学习笔记也没留下。想想CXK练习时长两年半都出道了,自己考研前的寒假还爆肝了四五周游戏(u1s1,DQB2是真的香),爆肝之后的贤者模式告诉我,不能继续在游戏中堕落下去(该换个方式堕落了),这也是为什么我会在这里用小学作文的水平码字。。。

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×