0%

Nezzar and Lucky Number

Nezzar's favorite digit among $1,…,9$ is $d$. He calls a positive integer lucky if $d$ occurs at least once in its decimal representation.

阅读全文 »

Nezzar and Colorful Balls

Nezzar has $n$ balls, numbered with integers $1,2,…,n$. Numbers $a_1,a_2,…,a_n$ are written on them, respectively. Numbers on those balls form a non-decreasing sequence, which means that $a_i≤a_{i+1}$ for all $1≤i<n$.

阅读全文 »

New Year's Number

Polycarp remembered the $2020$-th year, and he is happy with the arrival of the new $2021$-th year. To remember such a wonderful moment, Polycarp wants to represent the number $n$ as the sum of a certain number of $2020$ and a certain number of $2021$.

阅读全文 »

Odd Divisor

You are given an integer $n$. Check if $n$ has an odd divisor, greater than one (does there exist such a number $x$ ($x>1$) that $n$ is divisible by $x$ and $x$ is odd).

阅读全文 »

拯救007

在老电影“007之生死关头”(Live and Let Die)中有一个情节,007被毒贩抓到一个鳄鱼池中心的小岛上,他用了一种极为大胆的方法逃脱 —— 直接踩着池子里一系列鳄鱼的大脑袋跳上岸去!(据说当年替身演员被最后一条鳄鱼咬住了脚,幸好穿的是特别加厚的靴子才逃过一劫。)

阅读全文 »

Wizard of Orz

There are $n$ digital panels placed in a straight line. Each panel can show any digit from $0$ to $9$. Initially, all panels show $0$.

阅读全文 »

扫描集

扫描集为一个字符集合,用来匹配期待输入的字符。对于scanf匹配输入内容时,可以使用扫描集灵活地进行字符串截取输入。

扫描集以 % 开头,用 [] 包含字符集。如扫描集 %[abc], %[a-z], %[^abc], %[^a-z] ,其中 ^ 表示求反集。

阅读全文 »