commit bc08f780b738b5d2ed793c0ae3e75cd633c615ae Author: s464968 Date: Sat Oct 19 20:16:04 2024 +0200 first commit diff --git a/1/.idea/.gitignore b/1/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/1/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/1/.idea/1.iml b/1/.idea/1.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/1/.idea/1.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/1/.idea/inspectionProfiles/profiles_settings.xml b/1/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/1/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/1/.idea/misc.xml b/1/.idea/misc.xml new file mode 100644 index 0000000..db8786c --- /dev/null +++ b/1/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/1/.idea/modules.xml b/1/.idea/modules.xml new file mode 100644 index 0000000..4acc4ba --- /dev/null +++ b/1/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/1/1.py b/1/1.py new file mode 100644 index 0000000..ca008a4 --- /dev/null +++ b/1/1.py @@ -0,0 +1,7 @@ +from gmpy2 import * +import random + +k = int(input()) +max_b = pow(2, k) - 1 +b = mpz(random.randint(0, max_b)) +print(b.__format__('#b')) \ No newline at end of file diff --git a/1/2.py b/1/2.py new file mode 100644 index 0000000..2bc0d4c --- /dev/null +++ b/1/2.py @@ -0,0 +1,11 @@ +#TODO: DOKOŃCZYĆ + +def nwd(a, b): + if b == 0: + return a, 1, 0 + dzielnik,x,y = nwd(b,a%b) + returned_y = x - (x//y)*y + returned_x = y + return dzielnik,returned_x,returned_y + +print(nwd(13.0,5.0)) \ No newline at end of file diff --git a/1/3.py b/1/3.py new file mode 100644 index 0000000..af93586 --- /dev/null +++ b/1/3.py @@ -0,0 +1,17 @@ +from gmpy2 import * + +a = input() +b = input() +a,b = mpz(a),mpz(b) + +wynik = 1 +baza = a + + +for i in range(0,b.bit_length()): + if b.bit_test(i): + wynik = wynik * baza + baza = baza * baza + + +print(wynik) diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29