Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
7d3a2613c0 | |||
0f2414627b | |||
|
08b0cfffa6 | ||
|
2c14151996 | ||
|
2679f2300d | ||
|
1448404366 | ||
|
dc85980a2d | ||
|
0334268a84 | ||
|
501fef9136 | ||
|
bdc0d9efe0 | ||
|
28ab80c864 |
8
TaskC00_TODO/solution00.py.txt
Normal file
8
TaskC00_TODO/solution00.py.txt
Normal file
@ -0,0 +1,8 @@
|
||||
import re
|
||||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
if re.match(r'^-?[1-9][0-9]*0$|^-?[1-9][0-9]*5$|^0$', line):
|
||||
print('yes')
|
||||
else:
|
||||
print('no')
|
24
TaskC21_TODO/solution21.py.txt
Normal file
24
TaskC21_TODO/solution21.py.txt
Normal file
@ -0,0 +1,24 @@
|
||||
# HORSE HEAD -> 46773 4323
|
||||
import re
|
||||
import sys
|
||||
|
||||
pattern = r'^[A-Z][A-Z][A-Z][A-Z][A-Z] [A-Z][A-Z][A-Z][A-Z]$'
|
||||
|
||||
def get_number(c):
|
||||
result = re.sub(r'[ABC]', '2', c)
|
||||
result = re.sub(r'[DEF]', '3', result)
|
||||
result = re.sub(r'[GHI]', '4', result)
|
||||
result = re.sub(r'[JKL]', '5', result)
|
||||
result = re.sub(r'[MNO]', '6', result)
|
||||
result = re.sub(r'[PQRS]', '7', result)
|
||||
result = re.sub(r'[TUV]', '8', result)
|
||||
result = re.sub(r'[WXYZ]', '9', result)
|
||||
return result
|
||||
|
||||
for line in sys.stdin:
|
||||
if not re.match(pattern, line):
|
||||
print('no')
|
||||
continue
|
||||
|
||||
num = ''.join(get_number(c) for c in line.replace(' ', ''))
|
||||
print('yes' if re.match(r'^467734323$', num) else 'no')
|
@ -25,7 +25,7 @@ podanych warunków, należy wypisać "<NONE>".
|
||||
For each string, you should extract the building number from the address.
|
||||
We assume, that the address consists of the abbreviation "ul.", "os.' or "al."
|
||||
street name, building name, and an optional number of apartment number
|
||||
(separated from building number by a slash or " m. ". The street number
|
||||
(separated from building number by a slash or " m. "). The street number
|
||||
consists of at least 2 letters (including polish letters), starting with
|
||||
the capital letter.
|
||||
If the string does not fulfill the condition, you should print "<NONE>".
|
9
TaskC38_TODO/solution38.py.txt
Normal file
9
TaskC38_TODO/solution38.py.txt
Normal file
@ -0,0 +1,9 @@
|
||||
import re
|
||||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
match = re.match(r'^(ul\.|os\.|al\.)\s[A-ZĄĘÓĆŁŃŚŹŻ][a-ząęóćłńśźż]+\s([1-9]\d*)(\/[1-9]\d*|\sm\.\s[1-9]\d*)?$', line)
|
||||
if match:
|
||||
print(match.group(2))
|
||||
else:
|
||||
print("<NONE>")
|
9
TaskC45_TODO/solution45.py.txt
Normal file
9
TaskC45_TODO/solution45.py.txt
Normal file
@ -0,0 +1,9 @@
|
||||
import re
|
||||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
match = re.match(r'^([A-ZĆŁŚŹŻ][a-ząęóćłśńźż]*[b-ząęóćłśńźż]|Kosma|Jarema)\s([A-ZĆŁŚŹŻ][a-ząęóćłśńźż]+)$', line)
|
||||
if match:
|
||||
print(match.group(2))
|
||||
else:
|
||||
print("<NONE>")
|
21
TaskD00/description.txt
Normal file
21
TaskD00/description.txt
Normal file
@ -0,0 +1,21 @@
|
||||
Napisać program, który wczytuje kolejne wiersze ze standardowego
|
||||
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
|
||||
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
|
||||
użyć negacji jako operacji w danym języku programowania, jeśli da się
|
||||
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
|
||||
użyć pojedynczego wyrażenia regularnego.
|
||||
|
||||
Write a program, which loads consecutive lines from standard input
|
||||
and analyze every line (with no newline character). You should
|
||||
use regular expressions to the greatest extent possible (e.g. you
|
||||
can not use negation in the programming language if it is
|
||||
possible to express the same in regular expression). Wherever possible,
|
||||
use one regular expression.
|
||||
|
||||
Write a program to substitute all 4-digits string to 4-characters string.
|
||||
In the substituted string "0" should change to "a", "1" should change to "b", "2" should change to "c", etc.
|
||||
E.g. "1162" should change to "bbgc".
|
||||
In this task digit means [0-9] class.
|
||||
|
||||
POINTS: 2
|
||||
DEADLINE: 2025-02-02 23:59:59
|
50000
TaskD00/polish_wiki_excerpt.exp
Normal file
50000
TaskD00/polish_wiki_excerpt.exp
Normal file
File diff suppressed because one or more lines are too long
1
TaskD00/polish_wiki_excerpt.in
Symbolic link
1
TaskD00/polish_wiki_excerpt.in
Symbolic link
@ -0,0 +1 @@
|
||||
../TaskA02/polish_wiki_excerpt.in
|
3
TaskD00/simple.exp
Normal file
3
TaskD00/simple.exp
Normal file
@ -0,0 +1,3 @@
|
||||
dece 34 dfd gfd 5
|
||||
f33sdfsdbcdedsfsdf
|
||||
3r
|
3
TaskD00/simple.in
Normal file
3
TaskD00/simple.in
Normal file
@ -0,0 +1,3 @@
|
||||
3424 34 dfd gfd 5
|
||||
f33sdfsd1234dsfsdf
|
||||
3r
|
22
TaskD01/description.txt
Normal file
22
TaskD01/description.txt
Normal file
@ -0,0 +1,22 @@
|
||||
Napisać program, który wczytuje kolejne wiersze ze standardowego
|
||||
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
|
||||
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
|
||||
użyć negacji jako operacji w danym języku programowania, jeśli da się
|
||||
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
|
||||
użyć pojedynczego wyrażenia regularnego.
|
||||
|
||||
Write a program, which loads consecutive lines from standard input
|
||||
and analyze every line (with no newline character). You should
|
||||
use regular expressions to the greatest extent possible (e.g. you
|
||||
can not use negation in the programming language if it is
|
||||
possible to express the same in regular expression). Wherever possible,
|
||||
use one regular expression.
|
||||
|
||||
For each word with at least one lower case letter and one capital letter
|
||||
change every lower case letter to capital case and change every capital case
|
||||
letter to lower. In this task word means the string of "\w" metacharacters,
|
||||
lower case letter is [a-ząćęłńóśźż] class,
|
||||
capital case letter is [A-ZĄĆĘŁŃÓŚŹŻ] class.
|
||||
|
||||
POINTS: 2
|
||||
DEADLINE: 2025-02-02 23:59:59
|
50000
TaskD01/polish_wiki_excerpt.exp
Normal file
50000
TaskD01/polish_wiki_excerpt.exp
Normal file
File diff suppressed because one or more lines are too long
1
TaskD01/polish_wiki_excerpt.in
Symbolic link
1
TaskD01/polish_wiki_excerpt.in
Symbolic link
@ -0,0 +1 @@
|
||||
../TaskA02/polish_wiki_excerpt.in
|
3
TaskD01/simple.exp
Normal file
3
TaskD01/simple.exp
Normal file
@ -0,0 +1,3 @@
|
||||
ala mA KOTa
|
||||
lallaa
|
||||
żUK
|
3
TaskD01/simple.in
Normal file
3
TaskD01/simple.in
Normal file
@ -0,0 +1,3 @@
|
||||
ala Ma kotA
|
||||
lallaa
|
||||
Żuk
|
23
TaskD02/description.txt
Normal file
23
TaskD02/description.txt
Normal file
@ -0,0 +1,23 @@
|
||||
Napisać program, który wczytuje kolejne wiersze ze standardowego
|
||||
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
|
||||
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
|
||||
użyć negacji jako operacji w danym języku programowania, jeśli da się
|
||||
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
|
||||
użyć pojedynczego wyrażenia regularnego.
|
||||
|
||||
Write a program, which loads consecutive lines from standard input
|
||||
and analyze every line (with no newline character). You should
|
||||
use regular expressions to the greatest extent possible (e.g. you
|
||||
can not use negation in the programming language if it is
|
||||
possible to express the same in regular expression). Wherever possible,
|
||||
use one regular expression.
|
||||
|
||||
For each line write 4 digits separated by space "A B C D", where
|
||||
A stands for all lower case letters, B stands for
|
||||
all capital case letters, C stand for digit,
|
||||
D stands for all remaining characters excluding newline.
|
||||
In this task, lower case letter is [a-ząćęłńóśźż] class,
|
||||
capital case letter is [A-ZĄĆĘŁŃÓŚŹŻ] class.
|
||||
|
||||
POINTS: 1
|
||||
DEADLINE: 2025-02-02 23:59:59
|
50000
TaskD02/polish_wiki_excerpt.exp
Normal file
50000
TaskD02/polish_wiki_excerpt.exp
Normal file
File diff suppressed because it is too large
Load Diff
1
TaskD02/polish_wiki_excerpt.in
Symbolic link
1
TaskD02/polish_wiki_excerpt.in
Symbolic link
@ -0,0 +1 @@
|
||||
../TaskA02/polish_wiki_excerpt.in
|
3
TaskD02/simple.exp
Normal file
3
TaskD02/simple.exp
Normal file
@ -0,0 +1,3 @@
|
||||
7 2 0 2
|
||||
6 0 0 0
|
||||
6 1 1 2
|
3
TaskD02/simple.in
Normal file
3
TaskD02/simple.in
Normal file
@ -0,0 +1,3 @@
|
||||
ala Ma kotA
|
||||
lallaa
|
||||
Mam 2 żuki
|
24
TaskD03/description.txt
Normal file
24
TaskD03/description.txt
Normal file
@ -0,0 +1,24 @@
|
||||
Napisać program, który wczytuje kolejne wiersze ze standardowego
|
||||
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
|
||||
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
|
||||
użyć negacji jako operacji w danym języku programowania, jeśli da się
|
||||
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
|
||||
użyć pojedynczego wyrażenia regularnego.
|
||||
|
||||
Write a program, which loads consecutive lines from standard input
|
||||
and analyze every line (with no newline character). You should
|
||||
use regular expressions to the greatest extent possible (e.g. you
|
||||
can not use negation in the programming language if it is
|
||||
possible to express the same in regular expression). Wherever possible,
|
||||
use one regular expression.
|
||||
|
||||
For each line write 2 digits separated by space "A B", where
|
||||
A stands for all words starting with lower case letter,
|
||||
B stands for all words starting with capital case letter,
|
||||
In this task word means a string of "\w" metacharacters,
|
||||
lower case letter is [a-ząćęłńóśźż] class,
|
||||
capital case letter is [A-ZĄĆĘŁŃÓŚŹŻ] class capital case letter is [A-ZĄĆĘŁŃÓŚŹŻ] class.
|
||||
|
||||
|
||||
POINTS: 1
|
||||
DEADLINE: 2025-02-02 23:59:59
|
50000
TaskD03/polish_wiki_excerpt.exp
Normal file
50000
TaskD03/polish_wiki_excerpt.exp
Normal file
File diff suppressed because it is too large
Load Diff
1
TaskD03/polish_wiki_excerpt.in
Symbolic link
1
TaskD03/polish_wiki_excerpt.in
Symbolic link
@ -0,0 +1 @@
|
||||
../TaskA02/polish_wiki_excerpt.in
|
2
TaskD03/simple.exp
Normal file
2
TaskD03/simple.exp
Normal file
@ -0,0 +1,2 @@
|
||||
2 1
|
||||
1 0
|
2
TaskD03/simple.in
Normal file
2
TaskD03/simple.in
Normal file
@ -0,0 +1,2 @@
|
||||
Żmija i żuk.
|
||||
3daniowy obiad
|
20
TaskD04/description.txt
Normal file
20
TaskD04/description.txt
Normal file
@ -0,0 +1,20 @@
|
||||
Napisać program, który wczytuje kolejne wiersze ze standardowego
|
||||
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
|
||||
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
|
||||
użyć negacji jako operacji w danym języku programowania, jeśli da się
|
||||
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
|
||||
użyć pojedynczego wyrażenia regularnego.
|
||||
|
||||
Write a program, which loads consecutive lines from standard input
|
||||
and analyze every line (with no newline character). You should
|
||||
use regular expressions to the greatest extent possible (e.g. you
|
||||
can not use negation in the programming language if it is
|
||||
possible to express the same in regular expression). Wherever possible,
|
||||
use one regular expression.
|
||||
|
||||
Write the input line with the second digits string deleted.
|
||||
Digit is a [0-9] class.
|
||||
|
||||
|
||||
POINTS: 1
|
||||
DEADLINE: 2025-02-02 23:59:59
|
50000
TaskD04/polish_wiki_excerpt.exp
Normal file
50000
TaskD04/polish_wiki_excerpt.exp
Normal file
File diff suppressed because one or more lines are too long
1
TaskD04/polish_wiki_excerpt.in
Symbolic link
1
TaskD04/polish_wiki_excerpt.in
Symbolic link
@ -0,0 +1 @@
|
||||
../TaskA02/polish_wiki_excerpt.in
|
3
TaskD04/simple.exp
Normal file
3
TaskD04/simple.exp
Normal file
@ -0,0 +1,3 @@
|
||||
Mam 2 jabłka i banananów.
|
||||
Mam 2 jabłka i banananów oraz 20 gruszek.
|
||||
Widziałem 2 bociany.
|
3
TaskD04/simple.in
Normal file
3
TaskD04/simple.in
Normal file
@ -0,0 +1,3 @@
|
||||
Mam 2 jabłka i 35 banananów.
|
||||
Mam 2 jabłka i 35 banananów oraz 20 gruszek.
|
||||
Widziałem 2 bociany.
|
22
TaskD05/description.txt
Normal file
22
TaskD05/description.txt
Normal file
@ -0,0 +1,22 @@
|
||||
Napisać program, który wczytuje kolejne wiersze ze standardowego
|
||||
wejścia i analizuje każdy wiersz (bez znaku końca wiersza). Należy w
|
||||
jak największym stopniu wykorzystać wyrażenia regularne (np. nie wolno
|
||||
użyć negacji jako operacji w danym języku programowania, jeśli da się
|
||||
to wyrazić w samym wyrażeniu regularnym). Tam, gdzie to możliwe należy
|
||||
użyć pojedynczego wyrażenia regularnego.
|
||||
|
||||
Write a program, which loads consecutive lines from standard input
|
||||
and analyze every line (with no newline character). You should
|
||||
use regular expressions to the greatest extent possible (e.g. you
|
||||
can not use negation in the programming language if it is
|
||||
possible to express the same in regular expression). Wherever possible,
|
||||
use one regular expression.
|
||||
|
||||
Write the input line with the third word changed to "xxx" string.
|
||||
The number of "x" in the "xxx" string should be the same as the
|
||||
the number of characters in the input string.
|
||||
In this task, a word means a string of "\w" metacharacters.
|
||||
|
||||
|
||||
POINTS: 2
|
||||
DEADLINE: 2025-02-02 23:59:59
|
50000
TaskD05/polish_wiki_excerpt.exp
Normal file
50000
TaskD05/polish_wiki_excerpt.exp
Normal file
File diff suppressed because one or more lines are too long
1
TaskD05/polish_wiki_excerpt.in
Symbolic link
1
TaskD05/polish_wiki_excerpt.in
Symbolic link
@ -0,0 +1 @@
|
||||
../TaskA02/polish_wiki_excerpt.in
|
2
TaskD05/simple.exp
Normal file
2
TaskD05/simple.exp
Normal file
@ -0,0 +1,2 @@
|
||||
Mam 2 xxxxxx i 35 banananów.
|
||||
Widziałem 2 xxxxxxx.
|
2
TaskD05/simple.in
Normal file
2
TaskD05/simple.in
Normal file
@ -0,0 +1,2 @@
|
||||
Mam 2 jabłka i 35 banananów.
|
||||
Widziałem 2 bociany.
|
72
kurwix.py
Normal file
72
kurwix.py
Normal file
@ -0,0 +1,72 @@
|
||||
import os
|
||||
|
||||
def find_tasks_to_do(indeks: int):
|
||||
tasks_to_do = []
|
||||
|
||||
for task_id in range(49):
|
||||
task_id_str = f"{task_id:02d}"
|
||||
with open(f"TaskC{task_id_str}/description.txt", "r") as file:
|
||||
description = file.read()
|
||||
for line in description.splitlines():
|
||||
if "REMAINDER" in line:
|
||||
remainder, divisor = parse_remainder(line)
|
||||
if verify_task_should_be_done(indeks, remainder, divisor):
|
||||
tasks_to_do.append(task_id)
|
||||
|
||||
return tasks_to_do
|
||||
|
||||
|
||||
|
||||
def parse_remainder(line: str):
|
||||
parts = line.split(":")[1].strip().split("/")
|
||||
remainder = int(parts[0])
|
||||
divisor = int(parts[1])
|
||||
return remainder, divisor
|
||||
|
||||
|
||||
|
||||
def verify_task_should_be_done(indeks: int, remainder: int, divisor: int):
|
||||
return indeks % divisor == remainder
|
||||
|
||||
|
||||
|
||||
|
||||
def display_tasks_to_do(task_ids):
|
||||
print("Twoje zadania to:")
|
||||
for task_id in task_ids:
|
||||
task_id_str = f"{task_id:02d}"
|
||||
old_dir = f"TaskC{task_id_str}"
|
||||
new_dir = f"{old_dir}_TODO"
|
||||
os.rename(old_dir, new_dir)
|
||||
print(f"- {task_id_str}")
|
||||
print("Foldery z zadaniamy zostały oznaczone jako TODO.\nPowodzenia!")
|
||||
|
||||
|
||||
|
||||
def run():
|
||||
RED = "\033[31m"
|
||||
RESET = "\033[39m"
|
||||
|
||||
while True:
|
||||
try:
|
||||
indeks = int(input("Podaj swój numer indeksu: "))
|
||||
break
|
||||
except ValueError:
|
||||
print(RED + "Proszę podać prawidłowy numer indeksu.\n" + RESET)
|
||||
|
||||
display_tasks_to_do(find_tasks_to_do(indeks))
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print('''----------------------------------
|
||||
_ _
|
||||
| | ___ _ _ ____ _(_)_ __
|
||||
| |/ / | | | '__\ \ /\ / / \ \/ /
|
||||
| <| |_| | | \ V V /| |> <
|
||||
|_|\_\\\\__,_|_| \_/\_/ |_/_/\_\\
|
||||
|
||||
----------------------------------\n''')
|
||||
run()
|
Loading…
Reference in New Issue
Block a user