From c5fcf7179a83ef65c86c6a4a390029149e518649 Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Tue, 5 Oct 2021 21:49:54 +0200 Subject: Duzy commit ze smieciami --- semestr-4/sieci/warsztaty8/185551.cpp | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 semestr-4/sieci/warsztaty8/185551.cpp (limited to 'semestr-4/sieci/warsztaty8/185551.cpp') diff --git a/semestr-4/sieci/warsztaty8/185551.cpp b/semestr-4/sieci/warsztaty8/185551.cpp new file mode 100644 index 0000000..5d5af6a --- /dev/null +++ b/semestr-4/sieci/warsztaty8/185551.cpp @@ -0,0 +1,41 @@ +#include +using namespace std; +typedef long long ll; +#define pb push_back +#define st first +#define nd second + +const int N = 1000007; + +map M; +ll tab[N]; +vector v; +queue > q; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(0); + ll n, a=-1, b=0; + M[0]=1; + cin>>n; + for(int i=0; i>tab[i]; + } + sort(tab, tab+n); + for(int i=0; i0) q.push({u.st+a, u.nd}); + } + while(!q.empty()) M[q.front().st]+=q.front().nd, q.pop(); + v.pb(a); + } + b++; + } + cout<