#K78922. Detect Revisited Coordinates
Detect Revisited Coordinates
Detect Revisited Coordinates
You are given a list of geographic coordinates expressed as pairs of floating-point numbers representing latitude and longitude. Your task is to determine whether any coordinate appears more than once.
In other words, check if there is any repeated pair in the list. If there is at least one repeated coordinate, output True
; otherwise, output False
.
Input Format: The input will be given via standard input. The first line contains a non-negative integer \( n \) representing the number of positions. Each of the following \( n \) lines contains two space-separated floating-point numbers representing the latitude and longitude respectively.
Output Format: Output a single line with either True
or False
indicating whether any coordinate was revisited.
Example:
Input: 4 40.712776 -74.005974 34.052235 -118.243683 40.712776 -74.005974 51.507351 -0.127758</p>Output: True
Note: Coordinates are considered the same if both their latitude and longitude values are exactly equal.
inputFormat
The first line of input contains a single integer \( n \) (\( n \ge 0 \)) indicating the number of coordinates. The next \( n \) lines each contain two space-separated floats representing the latitude and longitude of a coordinate.
outputFormat
Output a single line: True
if any coordinate is repeated, otherwise False
.
4
40.712776 -74.005974
34.052235 -118.243683
40.712776 -74.005974
51.507351 -0.127758
True