This commit is contained in:
s473575 2024-01-07 12:16:30 +01:00
parent 8369543e6f
commit 29e223fe0d
23 changed files with 500096 additions and 0 deletions

File diff suppressed because one or more lines are too long

16
TaskF00/run.py Normal file
View File

@ -0,0 +1,16 @@
import re
import sys
def num_to_lett(match):
word = match.group(0)
letters = []
dict_mapping = {0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f', 6: 'g', 7: 'h', 8: 'i', 9: 'j'}
numbers = list(word)
for number in numbers:
letters.append(dict_mapping[int(number)])
new_word = ''.join(letters)
return new_word
for line in sys.stdin:
modified_line = re.sub(r'[0-9]{4}', num_to_lett, line)
print(modified_line.strip())

3
TaskF00/simple.out Normal file
View File

@ -0,0 +1,3 @@
dece 34 dfd gfd 5
f33sdfsdbcdedsfsdf
3r

50000
TaskF01/polish_wiki_excerpt.in Normal file

File diff suppressed because one or more lines are too long

View File

16
TaskF01/run.py Normal file
View File

@ -0,0 +1,16 @@
import re
import sys
def num_to_lett(match):
word = match.group(0)
letters = []
dict_mapping = {0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e', 5: 'f', 6: 'g', 7: 'h', 8: 'i', 9: 'j'}
numbers = list(word)
for number in numbers:
letters.append(dict_mapping[int(number)])
new_word = ''.join(letters)
return new_word
for line in sys.stdin:
modified_line = re.sub(r'[0-9]{4}', num_to_lett, line)
print(modified_line.strip())

0
TaskF01/simple.out Normal file
View File

50000
TaskF02/polish_wiki_excerpt.in Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

14
TaskF02/run.py Normal file
View File

@ -0,0 +1,14 @@
import re
import sys
def analyze_line(line):
lowercase_letters = re.findall(r'[a-ząćęłńóśźż]', line)
uppercase_letters = re.findall(r'[A-ZĄĆĘŁŃÓŚŹŻ]', line)
digits = re.findall(r'\d', line)
remaining_characters = re.findall(r'[^a-zA-ZĄ-Ż0-9\n]', line)
result = f'{len(lowercase_letters)} {len(uppercase_letters)} {len(digits)} {len(remaining_characters)}'
return result
for line in sys.stdin:
print(analyze_line(line))

3
TaskF02/simple.out Normal file
View File

@ -0,0 +1,3 @@
7 2 0 2
6 0 0 0
5 1 1 2

50000
TaskF03/polish_wiki_excerpt.in Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

13
TaskF03/run.py Normal file
View File

@ -0,0 +1,13 @@
import re
import sys
def analyze_line(line):
lowercase_words = re.findall(r'\b[a-ząćęłńóśźż]\w*\b', line)
uppercase_words = re.findall(r'\b[A-ZĄĆĘŁŃÓŚŹŻ]\w*\b', line)
result = f'{len(lowercase_words)} {len(uppercase_words)}'
return result
for line in sys.stdin:
print(analyze_line(line))

2
TaskF03/simple.out Normal file
View File

@ -0,0 +1,2 @@
2 0
1 0

50000
TaskF04/polish_wiki_excerpt.in Normal file

File diff suppressed because one or more lines are too long

View File

13
TaskF04/run.py Normal file
View File

@ -0,0 +1,13 @@
import re
""" import sys
for line in sys.stdin:
stripped_line = line.strip()
print(re.sub(r'(\D*\d+\D*)\d+', r'\1\2', stripped_line, count=1)) """
print(re.search(r'\d+ \d+', 'ala ma 41 41 kota'))
print(re.search(r' \d+ \d+', 'ala ma 41 123 kota'))
print(re.search(r' (\d+) \1', 'ala ma 41 41 kota'))
print(re.search(r' (\d+) \1', 'ala ma 41 123 kota'))

0
TaskF04/simple.out Normal file
View File

50000
TaskF05/polish_wiki_excerpt.in Normal file

File diff suppressed because one or more lines are too long

100000
TaskF05/polish_wiki_excerpt.out Normal file

File diff suppressed because one or more lines are too long

12
TaskF05/run.py Normal file
View File

@ -0,0 +1,12 @@
import re
import sys
for line in sys.stdin:
stripped_line = line.strip()
print(re.sub(r'(\b\w+\b\s+\b\w+\b\s+)(\b\w+\b)', r'\1' + 'x' * len(re.findall(r'\w', line)), line, count=1))

4
TaskF05/simple.out Normal file
View File

@ -0,0 +1,4 @@
Mam 2 xxxxxxxxxxxxxxxxxxxxxxxka i 35 banananĂłw.
WidziaĹem 2 xxxxxxxxxxxxxxxxx.