diff options
author | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-10-05 21:49:54 +0200 |
---|---|---|
committer | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-10-05 21:49:54 +0200 |
commit | c5fcf7179a83ef65c86c6a4a390029149e518649 (patch) | |
tree | d29ffc5b86a0d257453cedcf87d91a13d8bf3b0d /Semestr 4/aisd/themis/AISDPOTEGOWANIE.cpp | |
parent | f8a88b6a4aba1f66d04711a9330eaba49a50c463 (diff) |
Duzy commit ze smieciami
Diffstat (limited to 'Semestr 4/aisd/themis/AISDPOTEGOWANIE.cpp')
-rw-r--r-- | Semestr 4/aisd/themis/AISDPOTEGOWANIE.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/Semestr 4/aisd/themis/AISDPOTEGOWANIE.cpp b/Semestr 4/aisd/themis/AISDPOTEGOWANIE.cpp deleted file mode 100644 index c1b76fe..0000000 --- a/Semestr 4/aisd/themis/AISDPOTEGOWANIE.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include <bits/stdc++.h>
-using namespace std;
-
-int fast_pow(int a, int b, int m)
-{
- if (b == 0)
- {
- return 1;
- }
- long long p = fast_pow(a, b / 2, m);
- p = (p * p) % m;
- if (b % 2 == 0)
- return (int)p;
- return (p * (long long)a) % m;
-}
-
-int main()
-{
- ios_base::sync_with_stdio(false);
- cin.tie();
- int t;
- cin >> t;
- while (t--)
- {
- int a, b, m;
- cin >> a >> b >> m;
- cout << fast_pow(a, b, m) << "\n";
- }
-}
\ No newline at end of file |