POJ1064 Cable master

Description

Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided to connect computers for the contestants using a "star" topology - i.e. connect them all to a single central hub. To organize a truly honest contest, the Head of the Judging Committee has decreed to place all contestants evenly around the hub on an equal distance from it.

编译原理 第三章 词法分析

3.1 词法分析器概述

3.1.1 词法分析器的功能

输入源程序字符串,每识别出一个单词,就产生其种别编码。

lower_bound()和upper_bound()的使用

函数 lower_bound()firstlast 中的前闭后开区间进行二分查找,返回不小于 val 的第一个元素位置,如果所有元素都小于 val,则返回 last 位置。

POJ3320 Jessica's Reading Problem

Description

Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master all ideas included in a very thick text book. The author of that text book, like other authors, is extremely fussy about the ideas, thus some ideas are covered more than once. Jessica think if she managed to read each idea at least once, she can pass the exam. She decides to read only one contiguous part of the book which contains all ideas covered by the entire book. And of course, the sub-book should be as thin as possible.

POJ3061 Subsequence

Description

A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the subsequence of consecutive elements of the sequence, the sum of which is greater than or equal to S.

POJ2456 Aggressive cows

Description

Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000).

工程伦理 第二章 工程伦理

2.1 作为职业的工程

工业革命后,工程师作为中产阶级出现。

编译原理 第二章 高级语言及其语法描述

2.1 高级语言简介

2.1.1 高级语言的定义

任何语言程序都可以看成一定字符集(称为字母表)上的一个字符串(有限序列)。只有满足语法要求的字符串才是合式的程序。

语法:一组可以形成和产生合式程序的规则,包括词法规则和语法规则。

语义:一组可以定义程序意义的规则,这些规则称为语义规则。

编译原理 第一章 绪论

编译原理系列,是在学习本校 "编译技术" 这门课程时,所作记录,参考教材为 《编译技术基础教程》清华大学出版社。(为什么是这本教材,学校规定)

1.1 编译程序简介

计算机系统的语言分为三个层次:

  • 机器语言(Machine Language)
    • 难记忆、难编写、难阅读、难改错
    • 计算机可直接理解
    • 例:C706 0000 0002
  • 汇编语言(Assembly Language)
    • 引入助记符
    • 依赖特定机器
    • 编写效率低
    • 例:MOV X,2
  • 高级语言(High-level Language)
    • 接近人类表达习惯,不依赖特定机器
    • 编写效率高
    • 例:x = 2

背包问题详解

01 背包问题

问题描述

有 n 个重量和价值分别为 \(w_i\)\(v_i\) 的物品。从这些物品中挑选出总重量不超过 W 的物品,求所有挑选方案中价值总和的最大值。

Your browser is out-of-date!

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

×