Notes taken from Rob Pike's presentation 'Google I/O 2012 - Go Concurrency Patterns'.
The code is as follows:
c := boring("boring!") // function returning a channel
for i := 0; i < 5; i++ {Notes taken from Rob Pike's presentation 'Google I/O 2012 - Go Concurrency Patterns'.
The code is as follows:
c := boring("boring!") // function returning a channel
for i := 0; i < 5; i++ {| #include <bits/stdc++.h> | |
| using namespace std; | |
| void solve(int n) | |
| { | |
| int dp[1 << n]; | |
| memset(dp, 0, sizeof(dp)); | |
| int w[1 << n]; |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| void solve() | |
| { | |
| int n, m; | |
| scanf("%d %d", &n, &m); | |
| priority_queue<int, vector<int>, greater<int>> pq; |
next_permutation() (sorting!)class Solution
{
private:
vector<int> tmp;
void dfs(vector &nums, bool used[], vector> &ans,| #include <bits/stdc++.h> | |
| using namespace std; | |
| int dp[55][55]; | |
| int dfs(int inp[], int n, int l, int r) // (l, r) | |
| { | |
| if (r - l <= 1) | |
| return 0; | |
| if (dp[l][r] != -1) |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int solve(int n) | |
| { | |
| int dp[n][3]; | |
| int inp[n]; | |
| for (int i = 0; i < n; i++) { |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| void solve() | |
| { | |
| int n; | |
| scanf("%d", &n); | |
| int par[n + 1], w[n + 1], deg[n + 1], cnt[n + 1]; |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| struct Data { | |
| int p; | |
| int w; | |
| }; | |
| typedef pair<int, int> ii; |
| #include <stdio.h> | |
| void solve() | |
| { | |
| long long int x, y, p; | |
| scanf("%lld %lld %lld", &x, &y, &p); | |
| long long int ans = 1; | |
| while (y > 0) { | |
| if (y & 1) { |
| #include <stdio.h> | |
| #include <string.h> | |
| void solve(int n) | |
| { | |
| long long int ans = 0; | |
| for (int i = 0; i < n; i++) { | |
| char inp[100]; | |
| scanf("%s", inp); | |
| int len = strlen(inp); |