Skip to content

SandroBerger/CCC_33_2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Contest 33 (April 2020)

The input files for all levels can be found under the resouce folder where also the output files get saved to.

Level 1

Find the minimum and the maximum for each type of value, except for the altitude where we already know the minimum is 0 (generally, but the slice of data you see might not have it). Float values are compared with a maximum allowed error of 10-5


Input Output
Format N
timestamp,lat,long,altitude
(repeats N times)
minTimestamp maxTimestamp
minLat maxLat
minLong maxLong
maxAltitude
Types N (int) Number of flight entries that follow
timestamp (int) Amount of seconds since a fixed point in time
lat (float) North latitude of the coordinate. In degrees
long (float) East longitude of the coordinate. In degrees
altitude (float) Meters above the sea level
minTimestamp (int)
maxTimestamp (int)
minLat (float)
maxLat (float)
minLong (float)
maxLong (float)
maxAltitude (float)
Example 5
136932,48.297,16.503,1379
144068,45.262,39.702,1866
212782,41.287,2.089,0
370277,43.959,21.427,11582
578963,51.531,19.923,10058
136932 578963
41.287 51.531
2.089 39.702
11582

Level 2

Repeated for each pair of airports, A and B, that have at least one flight going from A to B. Direction matters Sort alphabetically by A and then B

  • Each entry from the previous level will receive 3 new fields.
  • For each entry you now know where the plane is coming from, where it’s going and when it took off.
  • The starting and destination airports are given as strings, denoting their IATA codes.
  • The takeoff time is given as a timestamp.
  • Based on this data, for each pair of airports, A and B, count the number of unique flights that start from A and go to B.
  • Output all pairs that have at least one flight, and the number of flights between them
  • Sort them alphabetically by A and then B.

Input Output
Format N
timestamp,lat,long,altitude,start,destination,takeoff
(repeats N times)
A B flightCount
Types N (int) Number of flight entries that follow
timestamp (int) Amount of seconds since a fixed point in time
lat (float) North latitude of the coordinate. In degrees
long (float) East longitude of the coordinate. In degrees
altitude (float) Meters above the sea level
start (string) IATA code of the start airport
destination (string) IATA code of the destination airport
takeoff (int) Timestamp at which the flight took off
A (string) IATA code of the start airport
B (string) IATA code of the destination airport
flightCount (int) Number of flights that start in A and go to B
Example 10
34103,51.331,-0.393,3962.0,LPPT,EGLL,26949
107649,38.024,-2.556,10972.0,LEMG,ESSA,106411
113591,49.003,17.515,10363.0,LLBG,EDDB,102016
223214,53.469,25.524,9448.0,LSGG,UUEE,215051
294080,54.146,8.657,11574.0,EKCH,EGKK,292283
375909,48.051,0.808,11887.0,EGGW,LEBL,373584
636037,53.141,-0.391,10058.0,EIDW,LZIB,634073
649847,53.564,9.846,1828.0,EDDH,EGLL,649106
652143,46.948,-1.463,10675.0,EBBR,LPPT,648044
659210,52.59,6.392,10363.0,EKCH,EBBR,655729
EBBR LPPT 1
EDDH EGLL 1
EGGW LEBL 1
EIDW LZIB 1
EKCH EBBR 1
EKCH EGKK 1
LEMG ESSA 1
LLBG EDDB 1
LPPT EGLL 1
LSGG UUEE 1

Releases

No releases published

Packages

No packages published

Languages