Benchmark AI / Public workspace

Humanity's Last Code Exam / 2020_O / Which Planet is This?!

Problem

Answer published by the source. Consult the official source to check your work against its answer.

platform

atcoder

question content

## Problem Description It’s the year 2521, and interstellar probes have reached planets in distant solar systems. The Interstellar Consortium of Planet Cartographers (ICPC) has created detailed maps of these planets, and they seem to indicate the existence of alien life! On each map, the ICPC has recorded the locations of what appear to be alien dwellings. The ICPC was planning to release this exciting news to the public, but at the last moment, disaster struck. One of the ICPC’s interns deleted all metadata associated with the maps. So while the maps themselves are safe, the ICPC does not know which maps belong to which planets. For this, they have come back in time to ask for your help. Given two maps, can you determine whether they describe the same planet? Hopefully, a 500-year head start will be enough time to solve this important problem! The planetary maps consist of sets of points on the (spherical) planet surface. They are specified in terms of latitude (the angle north or south of the equator) and longitude (the angle west or east of the noon meridian, which is the location of the sun when the map’s data was collected). Two maps for the same planet always agree on the latitudes of the points, since the planet’s axis does not change. However, the longitudes of the points might differ, because the planet rotates between measurements. ## Input The first line of input contains an integer n n (1n400,000 1 \leq n \leq 400,000 ), the number of points in each of the two maps to be compared. Then follow n n lines describing the first map. Each of these lines contains two real numbers a a and b b , where a a (90<a<90-90 < a < 90) is the latitude and b b (180<b180-180 < b \leq 180) is the longitude. Coordinates are expressed in degrees and have at most four digits after the decimal point. No two points on the map will have the same coordinates. The remaining n n lines describe the second map in the same format as the first. ## Output Output `Same` if there is a rotation around the planet’s axis that transforms one map into the other. Otherwise, output `Different`. ## Sample Input 1
Plain-text mathematical notation (without MathML)
## Problem Description

It’s the year 2521, and interstellar probes have reached planets in distant solar systems. The Interstellar Consortium of Planet Cartographers (ICPC) has created detailed maps of these planets, and they seem to indicate the existence of alien life! On each map, the ICPC has recorded the locations of what appear to be alien dwellings.

The ICPC was planning to release this exciting news to the public, but at the last moment, disaster struck. One of the ICPC’s interns deleted all metadata associated with the maps. So while the maps themselves are safe, the ICPC does not know which maps belong to which planets. For this, they have come back in time to ask for your help. Given two maps, can you determine whether they describe the same planet? Hopefully, a 500-year head start will be enough time to solve this important problem!

The planetary maps consist of sets of points on the (spherical) planet surface. They are specified in terms of latitude (the angle north or south of the equator) and longitude (the angle west or east of the noon meridian, which is the location of the sun when the map’s data was collected). Two maps for the same planet always agree on the latitudes of the points, since the planet’s axis does not change. However, the longitudes of the points might differ, because the planet rotates between measurements.

## Input

The first line of input contains an integer n (1≤n≤400,000), the number of points in each of the two maps to be compared. Then follow n lines describing the first map. Each of these lines contains two real numbers a and b, where a (−90<a<90) is the latitude and b (−180<b≤180) is the longitude. Coordinates are expressed in degrees and have at most four digits after the decimal point. No two points on the map will have the same coordinates. The remaining n lines describe the second map in the same format as the first.

## Output

Output `Same` if there is a rotation around the planet’s axis that transforms one map into the other. Otherwise, output `Different`.

## Sample Input 1

Original LaTeX notation
## Problem Description

It’s the year 2521, and interstellar probes have reached planets in distant solar systems. The Interstellar Consortium of Planet Cartographers (ICPC) has created detailed maps of these planets, and they seem to indicate the existence of alien life! On each map, the ICPC has recorded the locations of what appear to be alien dwellings.

The ICPC was planning to release this exciting news to the public, but at the last moment, disaster struck. One of the ICPC’s interns deleted all metadata associated with the maps. So while the maps themselves are safe, the ICPC does not know which maps belong to which planets. For this, they have come back in time to ask for your help. Given two maps, can you determine whether they describe the same planet? Hopefully, a 500-year head start will be enough time to solve this important problem!

The planetary maps consist of sets of points on the (spherical) planet surface. They are specified in terms of latitude (the angle north or south of the equator) and longitude (the angle west or east of the noon meridian, which is the location of the sun when the map’s data was collected). Two maps for the same planet always agree on the latitudes of the points, since the planet’s axis does not change. However, the longitudes of the points might differ, because the planet rotates between measurements.

## Input

The first line of input contains an integer \( n \) (\( 1 \leq n \leq 400,000 \)), the number of points in each of the two maps to be compared. Then follow \( n \) lines describing the first map. Each of these lines contains two real numbers \( a \) and \( b \), where \( a \) (\(-90 < a < 90\)) is the latitude and \( b \) (\(-180 < b \leq 180\)) is the longitude. Coordinates are expressed in degrees and have at most four digits after the decimal point. No two points on the map will have the same coordinates. The remaining \( n \) lines describe the second map in the same format as the first.

## Output

Output `Same` if there is a rotation around the planet’s axis that transforms one map into the other. Otherwise, output `Different`.

## Sample Input 1

Code

4
0.0000 0.0000
30.0000 90.0000
-45.0000 -30.0000
30.0000 60.0000
30.0000 150.0000
30.0000 120.0000
0.0000 60.0000
-45.0000 30.0000

## Sample Output 1

Code

Same

## Sample Input 2

Code

3
0.0000 0.0000
30.0000 0.0000
30.0000 90.0000
0.0000 0.0000
30.0000 0.0000
30.0000 -90.0000

## Sample Output 2

Code

Different

question title

Which Planet is This?!

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import