题目来源 The 2018 ACM-ICPC China JiangSu Provincial Programming Contest 35.4% 1000ms 65536K Persona5 Persona5 is a famous video game. In the game, you are going to build relationship with your friends. You have N friends and each friends have his upper b…
Let's consider some math problems. JSZKC has a set A=A={1,2,...,N}. He defines a subset of A as 'Meo set' if there doesn't exist two integers in this subset with difference one. For example, When A={1,2,3},{1},{2},{3},{1,3} are 'Meo set'. For each 'M…
JSZKC is going to spend his vacation! His vacation has N days. Each day, he can choose a T-shirt to wear. Obviously, he doesn't want to wear a singer color T-shirt since others will consider he has worn one T-shirt all the time. To avoid this problem…
A Plague Inc Plague Inc. is a famous game, which player develop virus to ruin the world. JSZKC wants to model this game. Let's consider the world has N×Mimes MN×M cities. The world has N rows and M columns. The city in the X row and the Y column has…
We call a string as a 0689-string if this string only consists of digits '0', '6', '8' and '9'. Given a 0689-string $s$ of length $n$, one must do the following operation exactly once: select a non-empty substring of $s$ and rotate it 180 degrees. Mo…
BaoBao has just found a grid with $n$ rows and $m$ columns in his left pocket, where the cell in the $j$-th column of the $i$-th row (indicated by $(i, j)$) contains an arrow (pointing either upwards, downwards, leftwards or rightwards) and an intege…
A:Martadella Stikes Again 水. #include <bits/stdc++.h> using namespace std; #define ll long long int t; ll R, r; int main() { scanf("%d", &t); while (t--) { scanf("%lld%lld", &R, &r); if (R * R > 2ll * r * r) puts(&…
Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered 11 to nn ,the ii-th pile of stones has a_iai​ stones. There are n - 1n−1 bidirectional roads in total. For any two piles, there is a unique path from…
Travel There are nn planets in the MOT galaxy, and each planet has a unique number from 1 \sim n1∼n. Each planet is connected to other planets through some transmission channels. There are mm transmission channels in the galaxy. Each transmission cha…
Swap There is a sequence of numbers of length nn, and each number in the sequence is different. There are two operations: Swap the first half and the last half of the sequence (if nn is odd, the middle number does not change) Swap all the numbers in…