-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patht3.cpp
More file actions
40 lines (37 loc) · 925 Bytes
/
t3.cpp
File metadata and controls
40 lines (37 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define nl "\n"
#define maxe(a) (*max_element(a.begin(), a.end()))
#define mine(a) (*min_element(a.begin(), a.end()))
#define all(a) a.begin(), a.end()
#define lsb(n) (n & -n)
#define msb(n) (1LL << (63 - __builtin_clzll(n)))
#define nsb(n) (__builtin_popcountll(n))
#define len(n) (to_string(n).size())
vector<vector<ll>> arr;
void work(ll n, ll id) {
for(ll i=0; i<n; i++) {
arr[id].push_back(i);
}
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
ll c = 0, n, t, i;
cin >> n >> t;
arr.resize(t);
vector<thread> th;
for(i=0; i<t; i++) {
th.push_back(thread(work, n, i));
}
for(i=0; i<t; i++) {
th[i].join();
}
for(auto v: arr) {
cout << v.size() << " ";
}
cout << nl;
return 0;
}