Skip to content

Instantly share code, notes, and snippets.

@domperor
Last active September 24, 2019 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domperor/e6492336e0650cc2ba4fef4d7674b94c to your computer and use it in GitHub Desktop.
Save domperor/e6492336e0650cc2ba4fef4d7674b94c to your computer and use it in GitHub Desktop.
AtCoder Beginners Selection 7. ABC 085 B - Kagami Mochi solved in plain TeX
\read-1to\N
\newcount\n
\n\N
\newcount\c
\def\loop{\read-1to\I
\expandafter\ifx\csname\I\endcsname\relax
\expandafter\def\csname\I\endcsname{}\advance\c1
\fi
\ifnum\the\n>1\advance\n-1\loop\fi}
\loop
\immediate\write16{\the\c}
\end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment