Blog

remember to do & remember doing

remember to do #

记得要去做某事 Remember to finish your homework tonight.

remember doing #

记得做过某事

Do you remember watching that film with us?

This is such a good story. I still remember reading it for the first time when I aws a child.

Examples #

I’m glad that I remembered to close the window when I left home. I still remember cleaning up the mess when I once forgot closing the window before storm. You’ll never want to experience that.

...

forget to do & forget doing

forget to do #

忘记要去做某事 Honey, why is the light still on? Sorry, I forgot to turn off the light before I left home.

forget doing #

忘记做过某事 I totally forget going shopping with you last week!

I was so drunk last night that I completely forgot talking to her at the party. I have no idea what I said to her.

Why is my phone in the bag? Maybe I forget putting it in there myself.

...

sheet:Tree

Tree #

  • luogu1305 练习先序遍历,使用数组存储左右节点。
  • uva536 从先序和中序推出后序,不重建树结构。
  • uva548 从中序和后序构建树,并找出路径权值最小的叶子节点。中等难度。

Huffman #

  • poj3253 Huffman树的思路,使用priority_queue。
  • poj1521 Huffman树,直接计算字符串的编码长度,无需对字符串逐个编码。
  • uva12676 从每个字符Huffman编码的长度,反推字符串的最少字符数。
  • uva240 可变基Huffman编码,要求输出每个编码,需要保存父子关系,对编码的次序有要求。需要多个数组,数据结构较复杂。

二叉搜索树 #

最近公共祖先 #

重心 #

  • cf685B(Kay and Snowflake) 一次递归求出所有子树的重心。若y是x的孩子,且y的重心为p,则x的重心必在p到x的路径上。

直径 #

  • luoguB4016(树的直径) 练习计算树的直径,用动态规划实现。
  • luogu3629(巡逻) 先用BFS求直径,然后将直径上的边的权重设置为-1,再用DP求直径。分析较难。
  • luogu1099(树网的核) 两次BFS求出直径,再求树上节点为根的子树的最长距离,最后计算偏心距。

表达主观推断

Content #

  • It’s likely that … It’s likely that we’ll finish the project by the end of this week.

  • I dare say … I dare say her performance was the best one yet.

  • There’s a good chance that … There’s a good chance that we will not be able to catch the last train tonight.

  • If I had to guess … If I had to guess, she might still be in the library.

    ...

Fustrating is an understatement

Content #

Fustrating is an understatement. 说“沮丧”还是太轻描淡写了。

完整的句子可说成: To say this is frustrating is an understatement.

Dealing with this endless papaerwork is a pain; frustrating is an understatement.

From #

push somebody's bottons

Content #

故意激怒某人。

He always tries to push my buttons.

You should stay cool and don’t allow them to push your buttons.

From #

get on somebody's nerves

Content #

使某人不安,心烦意乱。恼怒程度较 can’t stand doing something 和 drive somebody crazy/nuts 要低一些。一般用来形容那些说不上很严重,但就是令人难以忽略的心绪不宁的事情。

It really gets on my nerves when she practices piano late at night.

Your loud ringtone is really getting on my nerves. Turn it off! 你的心机铃声听得我心烦。给我关了!

From #