\documentclass[12pt]{article} % Автор: Сергей Копелиович \usepackage{cmap} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[russian]{babel} \usepackage{graphicx} \usepackage{amsthm,amsmath,amssymb} \usepackage{listings} \usepackage{color} \usepackage[table]{xcolor} \usepackage{colortbl} \usepackage{array} \usepackage{epigraph} \usepackage{textcomp} \usepackage[russian,colorlinks=true,urlcolor=red,linkcolor=blue]{hyperref} \usepackage{enumerate} \usepackage[shortlabels]{enumitem} \usepackage{datetime} \usepackage{fancyhdr} \usepackage{lastpage} \usepackage{verbatim} \usepackage{tikz} \usetikzlibrary{arrows,patterns,decorations.markings,decorations.pathmorphing,decorations.pathreplacing} \usetikzlibrary{math,positioning} \usepackage{pgfplots} \usepackage{ifthen} \usepackage{mathtools} \usepackage{mdframed} \usepackage[normalem]{ulem} \usepackage{tabu} %\usepackage{tabls} %\usepackage{tabularx} %\usepackage{xifthen} %\listfiles \def\SEASON{1 курс, осень 2021/22} \input code-format.tex \sloppy \voffset=-20mm \textheight=235mm \hoffset=-22mm \textwidth=180mm \headsep=12pt \footskip=20pt \parskip=0em \parindent=0em \setlength\epigraphwidth{.8\textwidth} \newlength{\tmplen} \newlength{\tmpwidth} \newlength{\storelen} \newcounter{listcounter} % Список с маленькими отступами \newenvironment{MyList}[1][4pt]{ \begin{enumerate}[1.] \setlength{\parskip}{0pt} \setlength{\itemsep}{#1} }{ \end{enumerate} } % Вложенный список с маленькими отступами \newenvironment{InnerMyList}[1][0pt]{ \vspace*{-0.5em} \begin{enumerate}[(a)] \setlength{\parskip}{-0pt} \setlength{\itemsep}{#1} }{ \end{enumerate} \vspace*{-0.5em} } % Список с маленькими отступами \newenvironment{MyItemize}[1][4pt]{ \begin{itemize} \setlength{\parskip}{0pt} \setlength{\itemsep}{#1} }{ \end{itemize} } % Основные математические символы \def\TODO{{\color{red}\bf TODO}} \def\N{\mathbb{N}} % \def\R{\mathbb{R}} % \def\F2{\mathbb{F}_2} % \def\Z{\mathbb{Z}} % \def\H{\mathcal{H}} % семество хеш-функций \def\E{\mathsf{E}} % матожидание \def\INF{\t{+}\infty} % +inf \def\EPS{\varepsilon} % \def\EMPTY{\varnothing} % \def\PHI{\varphi} % \def\SO{\Rightarrow} % => \def\EQ{\Leftrightarrow} % <=> \def\t{\texttt} % mono font \def\c#1{{\rm\sc{#1}}} % font for classes NP, SAT, etc \def\O{\mathcal{O}} % \def\NO{\t{\#}} % # \def\XOR{\text{ {\raisebox{-2pt}{\ensuremath{\Hat{}}}} }} \def\xor{\t{\^{}}} \renewcommand{\le}{\leqslant} \renewcommand{\ge}{\geqslant} \newcommand{\q}[1]{\langle #1 \rangle} % \newcommand\URL[1]{{\footnotesize{\url{#1}}}} % \newcommand{\sfrac}[2]{{\scriptstyle\frac{#1}{#2}}} % Очень маленькая дробь \newcommand{\mfrac}[2]{{\textstyle\frac{#1}{#2}}} % Небольшая дробь \newcommand{\score}[1]{{\bf\color{red}{(#1)}}} \newcommand{\fix}[1]{{\color{fixcolor}{#1}}} % \underline \def\bonus{\t{\red{(*)}}} \def\ifbonus#1{\ifthenelse{\equal{#1}{}}{}{\bonus}} \def\smallsquare{$\scalebox{0.5}{$\square$}$} \def\vstick{^\t{\textquotesingle}} \def\bluebox#1{\fcolorbox{blue}{white}{#1}} \newlength{\myItemLength} \setlength{\myItemLength}{0.3em} \def\ItemSymbol{\smallsquare} \def\Item{\vspace*{\myItemLength}\ItemSymbol \ \ } \newcommand{\LET}{% % [line width=0.6pt] \begin{tikzpicture}% \draw(0.8ex,0) -- (0.8ex,1.6ex);% \draw(0,1.6ex) -- (0.8ex,1.6ex);% \end{tikzpicture}% \hspace*{0.1em}% } % Отступы \def\makeparindent{\hspace*{\parindent}\unskip} \def\up{\vspace*{-0.5em}}%{\vspace*{-\baselineskip}} \def\down{\vspace*{0.5em}} \def\LINE{\vspace*{-1em}\noindent \underline{\hbox to 1\textwidth{{ } \hfil{ } \hfil{ } }}} \def\BOX#1{\mbox{\fbox{\bf{#1}}}} \def\Pagebreak{\pagebreak\vspace*{-1.5em}} \def\RIGHT{\hspace*{\fill}} % сдвинуться до упора вправо \def\NewLine{\hspace*{1em}\\} % Мелкий заголовок \newcommand{\THEE}[1]{ \vspace*{0.5em} \noindent{\bf \underline{#1}}%\hspace{0.5em} \vspace*{0.2em} } % Другой тип мелкого заголовка \newcommand{\THE}[1]{ \vspace*{0.5em} $\bullet$ \noindent{\bf #1}%\hspace{0.5em} \vspace*{0.2em} } \newenvironment{MyTabbing}{ \t\bgroup \vspace*{-\baselineskip} \begin{tabbing} aaaa\=aaaa\=aaaa\=aaaa\=aaaa\=aaaa\kill }{ \end{tabbing} \t\egroup } % Код с правильными отступами \lstnewenvironment{code}{ \lstset{} % \vspace*{-0.2em} }% { % \vspace*{-0.2em} } \lstnewenvironment{codep}{ \lstset{language=python} }% { } % Код, содержащий выскоие формулы, вставить не так просто... \def\codeinput#1{ \begin{mdframed}[innertopmargin=-2pt,innerbottommargin=-2pt,innerleftmargin=4pt,backgroundcolor=lightgray] \lstinputlisting[frame={}]{#1} \end{mdframed} } % Формулы с правильными отступами \newenvironment{smallformula}{ \vspace*{-0.8em} }{ \vspace*{-1.2em} } \newenvironment{formula}{ \vspace*{-0.4em} }{ \vspace*{-0.6em} } % Большая квадратная скобка \makeatletter \newenvironment{sqcases}{% \matrix@check\sqcases\env@sqcases }{% \endarray\right.% } \def\env@sqcases{% \let\@ifnextchar\new@ifnextchar \left\lbrack \def\arraystretch{1.2}% \array{@{}l@{\quad}l@{}}% } \makeatother % Определяем основные секции: \begin{Lm}, \begin{Thm}, \begin{Def}, \begin{Rem} \renewcommand{\qedsymbol}{$\blacksquare$} \theoremstyle{definition} % жирный заголовок, плоский текст \newtheorem{Thm}{\underline{Теорема}}[subsection] % нумерация будет "<номер subsection>.<номер теоремы>" \newtheorem{Lm}[Thm]{\underline{Lm}} % Нумерация такая же, как и у теорем \newtheorem{Ex}[Thm]{Упражнение} % Нумерация такая же, как и у теорем \newtheorem{Example}[Thm]{Пример} % Нумерация такая же, как и у теорем \newtheorem{Code}[Thm]{Код} % Нумерация такая же, как и у теорем \theoremstyle{plain} % жирный заголовок, курсивный текст \newtheorem{Def}[Thm]{Def} % Нумерация такая же, как и у теорем \newtheorem{Algo}[Thm]{Алгоритм} % Нумерация такая же, как и у теорем \theoremstyle{remark} % курсивный заголовок, плоский текст \newtheorem{Cons}[Thm]{Следствие} % Нумерация такая же, как и у теорем \newtheorem{Conj}[Thm]{Гипотеза} % Нумерация такая же, как и у теорем \newtheorem{Prop}[Thm]{Утверждение} % Нумерация такая же, как и у теорем \newtheorem{Rem}[Thm]{Замечание} % Нумерация такая же, как и у теорем \newtheorem{Remark}[Thm]{Замечание} % Нумерация такая же, как и у теорем \newtheorem{Img}[Thm]{Иллюстрация} % Нумерация такая же, как и у теорем % Определяем ЗАГОЛОВКИ \def\SectionName{unknown} \def\AuthorName{unknown} \newlength{\sectionvskip} \setlength{\sectionvskip}{0.5em} \newcommand{\Section}[4][]{ % Заголовок \pagebreak % \ifthenelse{\isempty{#1}}{ \refstepcounter{section} % }{} \vspace{0.5em} % \ifthenelse{\isempty{#1}}{ % \addtocontents{toc}{\protect\addvspace{-5pt}}% \addcontentsline{toc}{section}{\arabic{section}. #2} % }{} \begin{center} {\Large \bf Лекция \NO{\arabic{section}}: #2} \\ \vspace{\sectionvskip} \ifthenelse{\equal{#3}{}}{}{{\large #3}\\} % {\large #3} \\ \end{center} \LINE % Запомнили название и автора главы \gdef\SectionName{#2} \gdef\AuthorName{#4} % Заголовок страницы \lhead{Алгоритмы, \SEASON} \chead{} \rhead{\SectionName} \renewcommand{\headrulewidth}{0.4pt} \lfoot{Глава \NO{\arabic{section}}. #3.} \cfoot{\thepage\t{/}\pageref*{LastPage}} \rfoot{Автор конспекта: \AuthorName} \renewcommand{\footrulewidth}{0.4pt} } \newcommand{\Subsection}[2][]{ \refstepcounter{subsection} \vspace*{1em} \ifthenelse{\equal{#1}{}} {\addcontentsline{toc}{subsection}{\arabic{section}.\arabic{subsection}. #2}} {\addcontentsline{toc}{subsection}{\arabic{section}.\arabic{subsection}. \bonus\,#2}} {\color{blue}\bf\large \arabic{section}.\arabic{subsection}. \ifbonus{#1}\,{#2}} \vspace*{0.5em} \makeparindent } \newcommand{\Subsubsection}[2][]{ \refstepcounter{subsubsection} \vspace*{1em} \ifthenelse{\equal{#1}{}} {\addcontentsline{toc}{subsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}. #2}} {\addcontentsline{toc}{subsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}. \bonus\,#2}} {\color{blue}\bf\large \arabic{section}.\arabic{subsection}.\arabic{subsubsection}. \ifbonus{#1}\,#2} \vspace*{0.5em} \makeparindent } \newcommand{\Header}{ \pagestyle{empty} \renewcommand{\dateseparator}{--} \begin{center} {\Large\bf SPb HSE, \SEASON\\ %Первый курс, \SEASON\\ \vspace{0.3em} Конспект лекций по алгоритмам}\\ \vspace{0.7em} {Собрано {\today} в {\currenttime}} \end{center} \LINE \vspace{0em} \renewcommand{\baselinestretch}{0.98}\normalsize \tableofcontents \renewcommand{\baselinestretch}{1.0}\normalsize \pagebreak } \newcommand{\BeginConspect}{ \pagestyle{fancy} \setcounter{page}{1} } \def\Bibliography#1#2#3{\href{#1}{\t{[#2]}}. #3} \def\Link#1#2#3{\href{#1}{\t{[#2]}}. #3} \def\ShortLink#1#2{\href{#2}{\t{[#1]}}} \gdef\Papers{http://acm.math.spbu.ru/~sk1/courses/1819s_au3/conspect/papers} \definecolor{mygray}{rgb}{0.7,0.7,0.7} \definecolor{ltgray}{rgb}{0.9,0.9,0.9} \definecolor{fixcolor}{rgb}{0.7,0,0} \definecolor{red2}{rgb}{0.7,0,0} \definecolor{dkred}{rgb}{0.4,0,0} \definecolor{dkblue}{rgb}{0,0,0.6} \definecolor{dkgreen}{rgb}{0,0.6,0} \definecolor{brown}{rgb}{0.5,0.5,0} \newcommand{\green}[1]{{\color{green}{#1}}} \newcommand{\black}[1]{{\color{black}{#1}}} \newcommand{\red}[1]{{\color{red}{#1}}} \newcommand{\dkred}[1]{{\color{dkred}{#1}}} \newcommand{\blue}[1]{{\color{blue}{#1}}} \newcommand{\dkgreen}[1]{{\color{dkgreen}{#1}}} \begin{document} \Header \BeginConspect \input 0903-Asymptotic.tex \end{document}