#P8938. [DTOI 2023] A. 小狗哥哥
[DTOI 2023] A. 小狗哥哥
Background
luanmenglei has a glorious present: all the girls in his class call him Yi-jiang.
But who would have thought that luanmenglei has a sad past: his five-year-old younger brother used to call him Big Brother Puppy.
Problem Description
All parameters below are integers by default.
As a game developer (of 7k7k mini-games), you designed the following game (so crude that it is not even as good as Big Brother Puppy’s kindergarten graduation project). It has two elements:
- An enemy creature with health .
- The protagonist’s weapon, which has levels. The damage of level is .
The game balance needs to be planned in advance, so you also have a sequence , defined as follows:
- means the enemy creature will die after being hit exactly times by the level weapon.
Unfortunately, you forgot what exactly is, so you need to find the number of all possible values of .
If there can be infinitely many values of , output xiaogougege.
Input Format
The first line contains two positive integers .
The second line contains positive integers, representing the sequence .
Output Format
Output one line containing one integer, the number of possible values of , or the string xiaogougege. Its meaning is described in the statement.
3 3
3 2 1
1
Hint
Sample 1 Explanation
When the weapon is level , analysis shows that must satisfy .
When the weapon is level , analysis shows that must satisfy .
When the weapon is level , analysis shows that must satisfy .
Also, is an integer. Therefore, only satisfies the conditions in the statement.
Sample 2
See game/game2.in and game/game2.out in the additional files.
This sample meets the constraints of test points .
Constraints and Hints
For all testdata, it is guaranteed that and .
The detailed constraints for each test point are shown in the table below:
| Test Point ID | Special Property | ||
|---|---|---|---|
| The testdata is purely random | |||
| None | |||
Note that the specific generator code for the purely random testdata is as follows:
#include <bits/stdc++.h>
using namespace std;
int n, m, w;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r) {
assert(l <= r);
return uniform_int_distribution<>(l, r)(rng);
}
int main() {
scanf("%d%d%d", &n, &m, &w);
printf("%d %d\n", n, m);
for (int i = 1; i <= n; i ++) printf("%d%c", rand(1, w), " \n"[i == n]);
return 0;
}
Simply put, for given , the generator randomly generates numbers in the range as .
Translated by ChatGPT 5