Skip to content

Commit

Permalink
[skel] Update problem_cfp skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
mpsijm committed Dec 8, 2024
1 parent 5731a64 commit e68b7af
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions skel/problem_cfp/.timelimit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
3 changes: 2 additions & 1 deletion skel/problem_cfp/problem_statement/problem.en.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

%\illustration{0.3}{image.jpg}{
% Caption of the illustration (optional).
% CC BY-NC 2.0 by X on \href{https://example.com/reference-to-image}{Y}
% CC BY-SA 4.0 by X on \href{https://example.com/reference-to-image}{Y}
%}

% optionally define variables/limits for this problem
\newcommand{\maxa}{123456789}

% TODO: Remove this comment when you're done writing the problem statement.
Given the area $a$ of a square, calculate its perimeter.

\begin{Input}
Expand Down
10 changes: 10 additions & 0 deletions skel/problem_cfp/problem_statement/solution.en.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
\begin{frame}
\frametitle{\problemtitle}
\begin{itemize}
% TODO: Remove this comment when you're done writing the solutions.
\item<+-> \textbf{Problem:} Print $4\sqrt n$ with sufficiently many digits.
\item<+-> Naive solution: do something stupid. $\mathcal O(2^n)$ is too slow!
\item<+-> Instead, just compute the answer. $\mathcal O(1)$.
\end{itemize}
% \solvestats
\end{frame}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

import math

n = float(input())
a = 4 * math.sqrt(n)
print(f'{a:.10f}')
print(4 * math.sqrt(n))

0 comments on commit e68b7af

Please sign in to comment.