Loading...

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

gina78 avatar gina78 4 Точки

Problem 4. Files

здравейте, тая задача по условието всичко ок, в judge 20/100

може ли да ми кажите какво пропускам.

моя код  https://pastebin.com/qV9E35h9

Благодаря!

 

Problem 4. Files

You are given number of files with their full file paths and file sizes. You need to print all file names with a given extension that are present in a given root directory sorted by their file size in descending order. If two files have same size, order them by alphabetical order.

If a file name (file name + extension) appears more than once in a given root, save only its latest value. If a file name appears in more than one root, they are treated as different files.

If there aren't any files that correspond to the query, print "No".

Input / Constrains

On the first line of input you will get N the number of files to be read from the console

On the next N lines, you receive the actual files in the format "root\folder\filename.extension;filesize"

There may be more than one folder e.g. files can be deeply nested

On the last line you receive a query string in format "{extension} in {root}". You need to print all files with the given extension that are in present in the given root

Output

You need to print all files sorted by their size in descending order.

If two files have the same size, order them by alphabetical order.

Files should be printed in the given format "filename.extension - filesize KB"

If there aren't any movies that correspond to the query, print "No".

Examples

Input

Output

4

Windows\Temp\win.exe;5423

Games\Wow\wow.exe;1024

Games\Wow\patcher.cs;65212

Games\Pirates\Start\keygen.exe;1024

exe in Games

keygen.exe - 1024 KB

wow.exe - 1024 KB

 

3

C:\Documents\01. problems.docx;6521

D:\Documents\02. Documents\ presentation.pptx;44234

E:\Movies\Classics\someclassicmovie.avi;6221235212

docx in E:

No

 

 

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

благодаря ти

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