Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

gina78 avatar gina78 4 Точки

Football Standings

Здравейте, може ли малко помощ за сортирането по условието всико се изпълнява а judge 40/100

това е кода ми   

https://pastebin.com/ZtMN60Xy

Problem 3. Football Standings

You will be given information about results of football matches. Create a standings table by points. For win the team gets 3 points, for loss – 0 and for draw – 1. Also find the top 3 teams with most scored goals in descending order. If two or more teams are with same goals scored or same points order them by name in ascending order.

The name of each team is encrypted. You must decrypt it before proceeding with calculating statistics. You will be given some string key and the team name will be placed between that key in reversed order.

For example: the key: “???”;

String to decrypt: “kfle???airagluB???gertIt%%” -> “airagluB” -> “Bulgaria”

Also you should ignore the letter casing in the team names. For example:

buLgariA = BulGAria = bulGARIA = BULGARIA

Input / Constrains

On the first line of input you will get the key that will be used for decryption

On the next lines until you receive “final” you will get lines in format:

{encrypted teamA} {encrypted teamB} {teamA score}:{teamB score}

Team scores will be integer numbers in the range [0...231]

 

League standings:

{place}. {TEAM NAME} {points}

...


Output

  • Print the standings table ordered descending by points in format:

 

Top 3 scored goals:

- {team name} -> {goals}

- {team name} -> {goals}

- {team name} -> {goals}


Where place is a number in range [1… number of teams].

 

  • Then you should print the top 3 team ordered by goals in descending order in format:
  • All team’s names should be uppercase.
  • For more clarification, see the examples on the next page.

Examples

Input

Output

??

??ecnarF?? ??kramneD?? 0:0

..??airagluB??32 ??dnalgnE??gf 3:2

Fg??NIAPS?? fgdrt%#$??YNAMREG??gtr 3:4

??eCnArF?? >>??yLATi??<< 2:2

final

League standings:

1. BULGARIA 3

2. GERMANY 3

3. FRANCE 2

4. DENMARK 1

5. ITALY 1

6. ENGLAND 0

7. SPAIN 0

Top 3 scored goals:

- GERMANY -> 4

- BULGARIA -> 3

- SPAIN -> 3

Input

Output

KZL

fdKZLairagluBKZL KZLkramneDKZLll 2:0

kzljjjKZLAiRaGluBKZL KZLylATIKZLkk 1:1

KZLkRamnedKZL KZLYlatiKZL 4:4

final

League standings:

1. BULGARIA 4

2. ITALY 2

3. DENMARK 1

Top 3 scored goals:

- ITALY -> 5

- DENMARK -> 4

- BULGARIA -> 3

 

Тагове:
0
PHP Fundamentals
gina78 avatar gina78 4 Точки

Много си добър.Благодаря ти много

1
nimeberi avatar nimeberi 4 Точки

Thank you for sharing this challenge. My interests are closely related to football and football statistics. I'm trying to find the ideal forecast based on a complete database of scoring chances. Has anyone tried to create an algorithm for this?

0
Miller7 avatar Miller7 4 Точки

Creating algorithms for processing statistical data is a complex task. It's even harder to apply this to sports data. You will laugh, but it will be easier for you to train your brain on bets here - https://melbetke.com/en The classic way is African football. We can just watch the local championship.

0
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.