记录自己比赛过程中需要补的题目,防止时间长了将其忘光

# 回文日期

## 描述

传送门：我是传送门

在日常生活中，通过年、月、日这三个要素可以表示出一个唯一确定的日期。

牛牛习惯用8位数字表示一个日期，其中，前4位代表年份，接下来2位代表月 份，最后2位代表日期。显然：一个日期只有一种表示方法，而两个不同的日期的表 示方法不会相同。

牛牛认为，一个日期是回文的，当且仅当表示这个日期的8位数字是回文的。现 在，牛牛想知道：在他指定的两个日期之间包含这两个日期本身），有多少个真实存 在的日期是回文的。

一个8位数字是回文的，当且仅当对于所有的i(1<= i <= 8)从左向右数的第i个 数字和第9-i个数字（即从右向左数的第i个数字）是相同的。

例如：

•对于2016年11月19日，用8位数字20161119表示，它不是回文的。

•对于2010年1月2日，用8位数字20100102表示，它是回文的。

•对于2010年10月2日，用8位数字20101002表示，它不是回文的。

每一年中都有1212个月份：

其中，1,3,5,7,8,10,12月每个月有31天；4,6,9,11月每个月有30天；而对于2月，闰年时有29天，平年时有28天。

一个年份是闰年当且仅当它满足下列两种情况其中的一种：

1.这个年份是4的整数倍，但不是100的整数倍；

2.这个年份是400的整数倍。

例如：

•以下几个年份都是闰年：2000,2012,2016。

•以下几个年份是平年：1900,2011,2014。

# Codeforces Round #518 (Div. 2) C. Colored Rooks

## 描述

传送门：我是传送门

Ivan is a novice painter. He has $n$ dyes of different colors. He also knows exactly $m$ pairs of colors which harmonize with each other.

Ivan also enjoy playing chess. He has $5000$ rooks. He wants to take $k$ rooks, paint each of them in one of $n$ colors and then place this $k$ rooks on a chessboard of size $10^9×10^9$.

Let’s call the set of rooks on the board connected if from any rook we can get to any other rook in this set moving only through cells with rooks from this set. Assume that rooks can jump over other rooks, in other words a rook can go to any cell which shares vertical and to any cell which shares horizontal.

Ivan wants his arrangement of rooks to have following properties:

- For any color there is a rook of this color on a board;
- For any color the set of rooks of this color is connected;
- For any two different colors $a b$ union of set of rooks of color $a$ and set of rooks of color $b$ is connected if and only if this two colors harmonize with each other.
Please help Ivan find such an arrangement.

# 「2016 ACM/ICPC Asia Regional Dalian Online」F.Football Games

## 描述

传送门：我是传送门

A mysterious country will hold a football world championships—-Abnormal Cup, attracting football teams and fans from all around the world. This country is so mysterious that none of the information of the games will be open to the public till the end of all the matches. And finally only the score of each team will be announced.

At the first phase of the championships, teams are divided into M groups using the single round robin rule where one and only one game will be played between each pair of teams within each group. The winner of a game scores 2 points, the loser scores 0, when the game is tied both score 1 point. The schedule of these games are unknown, only the scores of each team in each group are available.

When those games finished, some insider revealed that there were some false scores in some groups. This has aroused great concern among the pubic, so the the Association of Credit Management (ACM) asks you to judge which groups’ scores must be false.

# 「The 2016 ACM-ICPC Asia Dalian Regional Contest」C.Game of Taking Stones(博弈论+大数)

## 描述

传送门：我是传送门

Two people face two piles of stones and make a game. They take turns to take stones. As game rules, there are two different methods of taking stones: One scheme is that you can take any number of stones in any one pile while the alternative is to take the same amount of stones at the same time in two piles. In the end, the first person taking all the stones is winner.Now,giving the initial number of two stones, can you win this game if you are the first to take stones and both sides have taken the best strategy?

# 「The 13th Zhejiang Provincial」 D. The Lucky Week

## 描述

传送门：我是传送门

Edward, the headmaster of the Marjar University, is very busy every day and always forgets the date.

There was one day Edward suddenly found that if Monday was the 1st, 11th or 21st day of that month, he could remember the date clearly in that week. Therefore, he called such week “The Lucky Week”.

But now Edward only remembers the date of his first Lucky Week because of the age-related memory loss, and he wants to know the date of the N-th Lucky Week. Can you help him?

# 牛客暑期多校第二场 J.farm

## 描述

传送门：我是传送门

White Rabbit has a rectangular farmland of n*m. In each of the grid there is a kind of plant. The plant in the j-th column of the i-th row belongs the a[i][j]-th type.

White Cloud wants to help White Rabbit fertilize plants, but the i-th plant can only adapt to the i-th fertilizer. If the j-th fertilizer is applied to the i-th plant (i!=j), the plant will immediately die.

Now White Cloud plans to apply fertilizers T times. In the i-th plan, White Cloud will use k[i]-th fertilizer to fertilize all the plants in a rectangle (x1[i]…x2[i])(y1[i]…y2[i]).

White rabbits wants to know how many plants would eventually die if they were to be fertilized according to the expected schedule of White Cloud.

# 「The 14th Zhejiang Provincial」 C.What Kind of Friends Are You?

## 描述

传送门：我是传送门

Japari Park is a large zoo home to extant species, endangered species, extinct species, cryptids and some legendary creatures. Due to a mysterious substance known as

Sandstar, all the animals have become anthropomorphized into girls known asFriends.Kaban is a young girl who finds herself in Japari Park with no memory of who she was or where she came from. Shy yet resourceful, she travels through Japari Park along with Serval to find out her identity while encountering more

Friendsalong the way, and eventually discovers that she is a human.However, Kaban soon finds that it’s also important to identify other

Friends. Her friend, Serval, enlightens Kaban that she can use some questions whose expected answers are either “yes” or “no” to identitfy a kind ofFriends.To be more specific, there are n

Friendsneed to be identified. Kaban will ask each of them q same questions and collect their answers. For each question, she also gets a full list of animals’ names that will give a “yes” answer to that question (and those animals who are not in the list will give a “no” answer to that question), so it’s possible to determine the name of aFriendsby combining the answers and the lists together.But the work is too heavy for Kaban. Can you help her to finish it?