Translation Notice
This article was machine-translated using DeepSeek-R1.
- Original Version: Authored in Chinese by myself
- Accuracy Advisory: Potential discrepancies may exist between translations
- Precedence: The Chinese text shall prevail in case of ambiguity
- Feedback: Technical suggestions regarding translation quality are welcomed
A - Vanishing Pitch
Problem Summary
A ball travels at $V~\text{m/s}$. It becomes invisible after flying for $T$ seconds and remains invisible after $S$ seconds. Can the person see the ball after it has flown $D$ meters? Output Yes
or No
.
Constraints:
$1\le V\le 1000$
$1\le T < S\le 1000$
$1\le D\le 1000$
Input Format
V T S D
Output Format
Output the answer.
Samples
$V$ | $T$ | $S$ | $D$ | Output |
---|---|---|---|---|
$10$ | $3$ | $5$ | $20$ | Yes |
$10$ | $3$ | $5$ | $30$ | No |
Analysis
If $VT \le D \le VS$, the ball is invisible after flying $D$ meters (output No
); otherwise, output Yes
.
Code
|
|
B - Remove It
Problem Summary
Given an integer sequence $A$ of length $N$, remove all occurrences of $X$ and output the remaining elements in their original order.
Constraints:
$1\le N\le 10^5$
$1\le X\le 10^9$
$1\le A_i\le 10^9$
Input Format
Line 1: N X
Line 2: A_1 A_2 ... A_N
Output Format
Output the filtered sequence with elements separated by spaces.
Samples
Sample Input 1
|
|
Sample Output 1
|
|
After removing all 5
s from [3,5,6,5,4]
, we get [3,6,4]
.
Sample Input 2
|
|
Sample Output 2
|
|
Output a blank line when all elements are removed.
Analysis
The problem does not require actual deletion of all $X$ elements; simply skip outputting elements equal to $X$ during printing.
Code
|
|
C - Digital Graffiti
Problem Summary
Given a $H \times W$ grid where each cell is black (#
) or white (.
). The outermost cells are guaranteed to be white. The black cells form a polygon. Find the number of edges of this polygon.
Constraints:
$3\le H,W\le 10$
Input Format
Line 1: H W
Lines 2~H+1: Grid rows.
Output Format
Print the number of edges.
Sample
Sample Input
|
|
Sample Output
|
|
The shape is a quadrilateral.
Custom Test Case
Input
|
|
Output
|
|
Analysis
The number of vertices of a polygon equals its number of edges. A cell is a vertex if among its four adjacent cells, exactly one or three are white. Count such vertices by checking all $2 \times 2$ squares.
Code
|
|
D - Circle Lattice Points
Problem Summary
Count the number of lattice points (integer coordinates) inside or on a circle with center $(X,Y)$ and radius $R$.
Constraints:
$|X|, |Y| \le 10^5$
$0 \le R \le 10^5$
$X, Y, R$ may have up to 4 decimal places.
Input Format
X Y R
Output Format
Print the total count.
Samples
Sample Input 1
|
|
Sample Output 1
|
|
The red marks in the figure indicate valid lattice points.
Sample Input 2
|
|
Sample Output 2
|
|
Note: Points exactly on the circle are counted.
Sample Input 3
|
|
Sample Output 3
|
|
Analysis
Precision handling: Multiply all values by $10^4$ to avoid floating-point errors. For each integer $x$ coordinate within the circle’s horizontal range, use binary search to find the maximum and minimum $y$ coordinates and count valid lattice points.
Code
|
|