diff options
author | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-03-03 12:24:13 +0100 |
---|---|---|
committer | Franciszek Malinka <franciszek.malinka@gmail.com> | 2021-03-03 12:24:13 +0100 |
commit | 92cb85e139f150d4560e3ddd777732d2f94bf1df (patch) | |
tree | 7f57b52f058f4d806cfc5fc8a6a444c58bd1eca7 | |
parent | 3ceb114ee9fb91f3bac1a49740f9148fa0620676 (diff) |
Kolejne rzeczy
-rw-r--r-- | Semestr 4/Pstwo/Wyklad 2.pdf | bin | 0 -> 3943486 bytes | |||
-rw-r--r-- | Semestr 4/aisd/Lista 0/Rozw L0.pdf | bin | 1964392 -> 1984913 bytes | |||
-rw-r--r-- | Semestr 4/aisd/Pracownia 1/pracownia1.pdf | bin | 0 -> 55846 bytes | |||
-rw-r--r-- | Semestr 4/aisd/Pracownia 1/rozw.cpp | 59 | ||||
-rw-r--r-- | Semestr 4/rownania rozniczkowe/RR1R-02.pdf | bin | 0 -> 100435 bytes | |||
-rw-r--r-- | Semestr 4/rownania rozniczkowe/RR1R-03.pdf | bin | 0 -> 90514 bytes |
6 files changed, 59 insertions, 0 deletions
diff --git a/Semestr 4/Pstwo/Wyklad 2.pdf b/Semestr 4/Pstwo/Wyklad 2.pdf Binary files differnew file mode 100644 index 0000000..df38730 --- /dev/null +++ b/Semestr 4/Pstwo/Wyklad 2.pdf diff --git a/Semestr 4/aisd/Lista 0/Rozw L0.pdf b/Semestr 4/aisd/Lista 0/Rozw L0.pdf Binary files differindex ab8362b..7472d55 100644 --- a/Semestr 4/aisd/Lista 0/Rozw L0.pdf +++ b/Semestr 4/aisd/Lista 0/Rozw L0.pdf diff --git a/Semestr 4/aisd/Pracownia 1/pracownia1.pdf b/Semestr 4/aisd/Pracownia 1/pracownia1.pdf Binary files differnew file mode 100644 index 0000000..2b99ba4 --- /dev/null +++ b/Semestr 4/aisd/Pracownia 1/pracownia1.pdf diff --git a/Semestr 4/aisd/Pracownia 1/rozw.cpp b/Semestr 4/aisd/Pracownia 1/rozw.cpp new file mode 100644 index 0000000..acbd711 --- /dev/null +++ b/Semestr 4/aisd/Pracownia 1/rozw.cpp @@ -0,0 +1,59 @@ +#include<bits/stdc++.h>
+using namespace std;
+typedef long long ll;
+
+vector<pair<int, pair<int, int>>> v;
+const int MAX_LEN = 85;
+int bits[100];
+
+int main() {
+ ios_base::sync_with_stdio(false);
+ cin.tie();
+ int n;
+ cin >> n;
+ for (int i = 0; i < n; i++) {
+ int d, nd;
+ cin >> d >> nd;
+ int k = 0;
+ while (d % 2 == 0) {
+ d /= 2;
+ k++;
+ }
+ v.push_back({d, {k, nd}});
+ }
+ sort(v.begin(), v.end());
+ int result = 0;
+
+ for (int i = 0; i < n; ) {
+ int h = i;
+ int d = v[i].first;
+ while (h < n && v[h].first == d) {
+ h++;
+ }
+ for (int k = 0; k < MAX_LEN; k++)
+ bits[k] = 0;
+ for (int j = i; j < h; ++j) {
+ ll x = (ll)(1LL << v[j].second.first) * (ll)v[j].second.second;
+ int k = 0;
+ while (x > 0) {
+ if (x % 2 == 1) {
+ bits[k]++;
+ }
+ x /= 2;
+ k++;
+ }
+ }
+
+ for (int k = 0; k < MAX_LEN; k++) {
+ if (bits[k] > 1) {
+ bits[k + 1] += bits[k]/2;
+ }
+ if (bits[k] % 2 == 1) {
+ result++;
+ }
+ }
+ i = h;
+ }
+
+ cout << result << "\n";
+}
\ No newline at end of file diff --git a/Semestr 4/rownania rozniczkowe/RR1R-02.pdf b/Semestr 4/rownania rozniczkowe/RR1R-02.pdf Binary files differnew file mode 100644 index 0000000..7d1a845 --- /dev/null +++ b/Semestr 4/rownania rozniczkowe/RR1R-02.pdf diff --git a/Semestr 4/rownania rozniczkowe/RR1R-03.pdf b/Semestr 4/rownania rozniczkowe/RR1R-03.pdf Binary files differnew file mode 100644 index 0000000..22c3214 --- /dev/null +++ b/Semestr 4/rownania rozniczkowe/RR1R-03.pdf |