Tony5t4rk

2018-2019 ACM-ICPC, Asia East Continent Finals

F. Interstellar … Fantasy

Description:

Unfortunately, the boy finally got bankrupt. Looking at his receding figure, Rikka understood more about the world — but she is still herself. Though, she still sat on the tower and spent time with the low gravity, feeling lost.
She looked at the deep dark sky, where the blue round Earth is shining overhead. Rikka thought about her families, her friends, and her homeland. Is she in her dream or a “real” world? The girl of chunibyo felt afraid for the first time since the journey began.
She saw a bright star traveling fast around the earth — maybe a geostationary space station. How could she get there? Daydream started again.
In other words, Rikka wonders the minimum distance she needs to travel from her position $s$ to the position of the star $t$, while a sphere — the earth staying there as an obstacle. They are in a 3-dimensional Euclidean space. $s$ and $t$ may be at the same position.

CodeForces 559A Gerald's Hexagon

Description:

Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to . Then he measured the length of its sides, and found that each of them is equal to an integer number of centimeters. There the properties of the hexagon ended and Gerald decided to draw on it.
He painted a few lines, parallel to the sides of the hexagon. The lines split the hexagon into regular triangles with sides of 1 centimeter. Now Gerald wonders how many triangles he has got. But there were so many of them that Gerald lost the track of his counting. Help the boy count the triangles.

Educational Codeforces Round 57 (Rated for Div. 2)

A. Find Divisible

Description:

You are given a range of positive integers from $l$ to $r$.
Find such a pair of integers $(x, y)$ that $l \le x, y \le r$, $x \ne y$ and $x$ divides $y$.
If there are multiple answers, print any of them.
You are also asked to answer $T$ independent queries.

Codeforces Round #529 (Div. 3)

A. Repeating Cipher

Description:

Polycarp loves ciphers. He has invented his own cipher called repeating.
Repeating cipher is used for strings. To encrypt the string $s=s_{1}s_{2} \dots s_{m}$ ($1 \le m \le 10$), Polycarp uses the following algorithm:

  • he writes down $s_1$ ones,
  • he writes down $s_2$ twice,
  • he writes down $s_3$ three times, … he writes down $s_m$ $m$ times.

For example, if $s$=”bab” the process is: “b” $\to$ “baa” $\to$ “baabbb”. So the encrypted $s$=”bab” is “baabbb”.

Given string $t$ — the result of encryption of some string $s$. Your task is to decrypt it, i. e. find the string $s$.

Technocup 2019 - Elimination Round 4

A. Right-Left Cipher

Description:

Polycarp loves ciphers. He has invented his own cipher called Right-Left.
Right-Left cipher is used for strings. To encrypt the string $s=s_{1}s_{2} \dots s_{n}$ Polycarp uses the following algorithm:

  • he writes down $s_1$,
  • he appends the current word with $s_2$ (i.e. writes down $s_2$ to the right of the current result),
  • he prepends the current word with $s_3$ (i.e. writes down $s_3$ to the left of the current result),
  • he appends the current word with $s_4$ (i.e. writes down $s_4$ to the right of the current result),
  • he prepends the current word with $s_5$ (i.e. writes down $s_5$ to the left of the current result),
  • and so on for each position until the end of $s$.

For example, if $s$=”techno” the process is: “t” $\to$ “te” $\to$ “cte” $\to$ “cteh” $\to$ “ncteh” $\to$ “ncteho”. So the encrypted $s$=”techno” is “ncteho”.

Given string $t$ — the result of encryption of some string $s$. Your task is to decrypt it, i.e. find the string $s$.

CodeForces 794B Cutting Carrot

Description:

Igor the analyst has adopted n little bunnies. As we all know, bunnies love carrots. Thus, Igor has bought a carrot to be shared between his bunnies. Igor wants to treat all the bunnies equally, and thus he wants to cut the carrot into n pieces of equal area.
Formally, the carrot can be viewed as an isosceles triangle with base length equal to 1 and height equal to h. Igor wants to make n - 1 cuts parallel to the base to cut the carrot into n pieces. He wants to make sure that all n pieces have the same area. Can you help Igor determine where to cut the carrot so that each piece have equal area?

Illustration to the first example.

HDU 1796 How many integers can you find

Description:

Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer set is {2,3}, so there is another set {2,3,4,6,8,9,10}, all the integers of the set can be divided exactly by 2 or 3. As a result, you just output the number 7.

AYITOJ ROUND #3

A.TAT

Descriptiion:

给定一个字符串s, 问”TAT”是否为s的子串

一个字符串 s 被称作另一个字符串 S 的子串,表示 s 在 S 中出现了。比如,“中出”是“我们中出了一个叛徒”的子串。

注意子串和子序列是不同的:“苹机”是“苹果手机”的子序列,而不是子串。

前缀和后缀是两种特殊的子串:一个前缀在原串的开始位置出现,而一个后缀在原串的末端出现。

例如,“苹果手机”的所有子串是:“”(空串),“苹”,“果”,“手”,“机”,“苹果”,“果手”,“手机”,“苹果手”,“果手机”,“苹果手机”。

以上摘自维基百科~

NYOJ 42 一笔画问题

Description:

zyc从小就比较喜欢玩一些小游戏,其中就包括画一笔画,他想请你帮他写一个程序,判断一个图是否能够用一笔画下来。

规定,所有的边都只能画一次,不能重复画。

CodeForces GYM 102028 2018-2019 ACM-ICPC, Asia Jiaozuo Regional Contest

A. Xu Xiake in Henan Province

Description:

Shaolin Monastery, also known as the Shaolin Temple, is a Chan (“Zen”) Buddhist temple in Dengfeng County, Henan Province. Believed to have been founded in the $5$-th century CE, the Shaolin Temple is the main temple of the Shaolin school of Buddhism to this day.
Longmen Grottoes, are some of the finest examples of Chinese Buddhist art. Housing tens of thousands of statues of Buddha and his disciples, they are located $12$ kilometres ($7.5$ mi) south of present-day Luoyang in Henan province.
White Horse Temple is, according to tradition, the first Buddhist temple in China, established in $68$ AD under the patronage of Emperor Ming in the Eastern Han dynasty capital Luoyang.
The Yuntai Mountain is situated in Xiuwu County, Jiaozuo, Henan Province. The Yuntai Geo Park scenic area is classified as an AAAAA scenic area by the China National Tourism Administration. Situated within Yuntai Geo Park, with a fall of 314 metres, Yuntai Waterfall is claimed as the tallest waterfall in China.
They are the most famous local attractions in Henan Province.

Now it’s time to estimate the level of some travellers. All travellers can be classified based on the number of scenic spots that have been visited by each of them.
A traveller that visited exactly $0$ above-mentioned spot is a “Typically Otaku”. A traveller that visited exactly $1$ above-mentioned spot is a “Eye-opener”. A traveller that visited exactly $2$ above-mentioned spots is a “Young Traveller”. A traveller that visited exactly $3$ above-mentioned spots is a “Excellent Traveller”. A traveller that visited all $4$ above-mentioned spots is a “Contemporary Xu Xiake”. Please identify the level of a traveller.