Содержание курса
← Занятие 11 · Словари
Обязательная задача

Номер появления слова

Условие

В единственной строке записан текст. Для каждого слова из данного текста подсчитайте, сколько раз оно встречалось в этом тексте ранее.

Словом считается последовательность непробельных символов идущих подряд, слова разделены одним или большим числом пробелов или символами конца строки.

Пример

Ввод
one two one tho three
Вывод
0 0 1 0 0

Все тесты задачи 13

Тест 1СвернутьПоказать
Ввод
one two one tho three
Ожидаемый вывод
0 0 1 0 0
Тест 2СвернутьПоказать
Ввод
She sells sea shells on the sea shore; The shells that she sells are sea shells I'm sure. So if she sells sea shells on the sea shore, I'm sure that the shells are sea shore shells.
Ожидаемый вывод
0 0 0 0 0 0 1 0 0 1 0 0 1 0 2 2 0 0 0 0 1 2 3 3 1 1 4 0 1 0 1 2 4 1 5 0 0
Тест 3СвернутьПоказать
Ввод
aba aba; aba @?"
Ожидаемый вывод
0 0 1 0
Тест 4СвернутьПоказать
Ввод
AA aa Aa aA
Ожидаемый вывод
0 0 0 0
Тест 5СвернутьПоказать
Ввод
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
Ожидаемый вывод
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
Тест 6СвернутьПоказать
Ввод
a b a c a b a d a b a c a b a
Ожидаемый вывод
0 0 1 0 2 1 3 0 4 2 5 1 6 3 7
Тест 7СвернутьПоказать
Ввод
dsgsdf ' sdfg gdf ghgh sdfg sdh ghhfgjgj sdfg fhdh dfh dfh dfh
Ожидаемый вывод
0 0 0 0 0 1 0 0 2 0 0 1 2
Тест 8СвернутьПоказать
Ввод
word
Ожидаемый вывод
0
Тест 9СвернутьПоказать
Ввод
Lady of luck come out of your hiden course bless your light upon me as the light of the moon shines above and in the light of luck will be blessed i, when the moon is next to be full
Ожидаемый вывод
0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 2 1 0 0 0 0 0 2 2 3 1 0 0 0 0 0 3 1 0 0 0 1 0
Тест 10СвернутьПоказать
Ввод
As I prick this candle, I prick at thee Broken hearts unhappy be May you part another day Soon to go your separate ways
Ожидаемый вывод
0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Тест 11СвернутьПоказать
Ввод
you will not solve this test. This @problem@ is unsolvable.
Ожидаемый вывод
0 0 0 0 0 0 0 0 0 0
Тест 12СвернутьПоказать
Ввод
dfs bfs dejkstra bubble sort floid kmp z-function kormen bfs dejkstra bubble sort qsort merge sort heap sort genetic algorythm
Ожидаемый вывод
0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 2 0 3 0 0
Тест 13СвернутьПоказать
Ввод
Little girl, little girl Why are you crying? Inside your restless soul your heart is dying Little one, little one Your soul is purging Of love and razor blades Your blood is surging Runaway From the river to the street And find yourself with your face in the gutter Your a stray for the salvation army There is no place like home When you got no place to go Little girl, little girl Your life is calling The charlatans and saints of your abandon Little one little one The sky is falling The lifeboat of deception is now sailing In the wake all the way No rhyme or reason Your bloodshot eyes Will show your heart of treason Little girl little girl You dirty liar You're just a junkie Preaching to the choir Runaway To your lost tranquility And find yourself with your face in the gutter Your a stray for the dregs of humanity There is no place like home When you got no place to go The traces of blood Always follow you home Like the Mascara tears From your getaway Your walking with blisters And running with shears So unholy. Sister of grace. Runaway From the river to the street And find yourself with your face in the gutter You're a stray for the salvation army There is no place like home When you got no place to go
Ожидаемый вывод
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 1 0 2 0 0 0 0 0 0 1 0 0 0 0 0 2 0 0 2 0 2 0 0 0 3 0 0 0 3 0 0 0 0 0 1 0 1 1 1 0 2 1 2 1 3 0 4 0 0 0 1 0 0 3 0 3 1 3 2 1 0 5 0 2 0 1 0 6 0 0 0 4 0 0 5 0 0 0 0 0 4 0 0 0 0 4 1 2 0 4 2 4 3 0 0 0 0 0 1 0 0 2 6 0 1 0 5 0 0 1 1 1 1 6 1 1 7 1 5 2 1 1 8 0 3 0 1 7 2 2 1 1 1 2 1 3 3 3 1 3 0 4 1 0 0 3 2 0 9 0 0 1 7 0 6 0 2 0 2 0 3 0 0 0 0 5 0 2 2 10 1 4 11 1 3 2 2 4 8 2 2 12 2 1 3 2 2 13 1 1 2 8 4 4 2 3 2 4 2 5 5 5 2