-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC.tex
31 lines (25 loc) · 852 Bytes
/
C.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\section{C}%
\label{sec:c}
\begin{frame}
\frametitle{Problem C: Cold War}
\begin{itemize}
\item First solve at 00:27 by \textbf{Jonathan1234} (Naixin Zong)
\item Implementation problem: figure out if you can make it out of a duel without getting shot
\item One possible solution: try shooting everyone and see what happens
\item Complexity: $O(n^2)$
\item Another possible solution: order everyone by reaction time, then step through until your turn
\item Complexity: $O(n \log n)$
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Problem C: $O(n^2)$ try-everyone solution}
\pyf{Cbrute}
\end{frame}
\begin{frame}
\frametitle{Problem C: $O(n^2)$ try-everyone solution (continued)}
\pyf{Cbrute2}
\end{frame}
\begin{frame}
\frametitle{Problem C: $O(n \log n)$ ordering solution}
\pyf{Cfast}
\end{frame}