Logo
(追記) (追記ここまで)

34390번 - Premier League Table 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB109990.000%

문제

The Premier League is the highest level of football (soccer, if you must!) in England and is widely considered the best football league in the world. Most football leagues around the world, including the Premier League, use a point system to determine who wins the league trophy.

Each team receives 3ドル$ points for winning a game, 1ドル$ point for drawing (tie), and 0ドル$ for losing. After 38ドル$ games (also called "fixtures") in a season spanning from August to May, the winner of the league is the team with the most points.

However, if points are tied, it goes to whichever team has the best goal differential (GD) calculated by taking the goals scored (called GF, goals for) minus goals let in (called GA, goals against). Note that goal differential can be a negative number. If neither points nor GD can break the tie, the teams are sorted alphabetically.1

The Premier League needs your help! The company they hired couldn't figure out how to make the table, so they hired you to create a sorted Premier League table based off of the results of all matches from a season.


1No, they don't use this as the actual tie-breaker

입력

The first line of input will be $N,ドル the number of fixtures to follow. The next $N$ lines will be the scores of each fixture throughout a season in the following format:

Team_One X-Y Team_Two

where Team_One is the first team and X is their score for that fixture and Team_Two is the second team and Y is their score for that fixture. Both X and Y are guaranteed to be non-negative numbers.

Input Restrictions

  • Team names will only have upper- and lower-case letters or underscores. No team names will have any whitespace.
  • The minimum amount of goals scored by either team is 0ドル,ドル while the maximum is 1ドル,000円,000円$.2
  • The minimum number of unique teams given is 2ドル,ドル while the maximum is 20ドル$ unique teams.
  • While a traditional season has 38ドル$ games, the number of games provided in the inputs can be anywhere from 1ドル$ to 10ドル,000円$.

2Yes, a million goals scored in one game is physically impossible.

출력

The output is a sorted league table with each line representing data from a single team. The data on each line should be space-separated, and should be as follows:

Team name, how many games the team has played (MP), number of wins, number of draws, number of losses, goals for (GF), goals against (GA), goal differential (GD), and points (PTS).

Each team is uniquely identified by their name in the input; there will be no duplicate team names.

Sorting priority (from highest to lowest) is points $\rightarrow$ GD $\rightarrow$ alphabetical. For instance, if two teams both have 70ドル$ points, then the team with the higher GD will appear earlier in the table. If two teams have both the same number of points and the same GD, then the team whose name comes first alphabetically will appear earlier in the table.

제한

예제 입력 1

2
Manchester_City 1-3 Liverpool
Leicester_City 2-1 Manchester_United

예제 출력 1

Liverpool 1 1 0 0 3 1 2 3
Leicester_City 1 1 0 0 2 1 1 3
Manchester_United 1 0 0 1 1 2 -1 0
Manchester_City 1 0 0 1 1 3 -2 0

예제 입력 2

4
Watford 4-1 Wolves
Aston_Villa 3-1 Burnley
Watford 4-2 Leeds_United
Crystal_Palace 2-4 Aston_Villa

예제 출력 2

Watford 2 2 0 0 8 3 5 6
Aston_Villa 2 2 0 0 7 3 4 6
Burnley 1 0 0 1 1 3 -2 0
Crystal_Palace 1 0 0 1 2 4 -2 0
Leeds_United 1 0 0 1 2 4 -2 0
Wolves 1 0 0 1 1 4 -3 0

노트

출처

School > CS@Mines > CS@Mines HSPC 2022 > Beginner K번

School > CS@Mines > CS@Mines HSPC 2022 > Advanced H번

  • 문제를 만든 사람: Ethan Richards
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /