We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- All Contests
- HourRank 31
- Basketball tournament
- Discussions
Basketball tournament
Basketball tournament
Sort by
recency
|
13 Discussions
|
Please Login in order to post a comment
pragma GCC optimize("O3")
pragma GCC optimize("unroll-loops")
pragma GCC target("avx2")
include
using namespace std;
define rep(i,n) for(int i=0;i
define per(i,n) for(int i=n-1;i>=0;i--)
define rng(i,c,n) for(int i=c;i
define fi first
define se second
define pb push_back
define sz(a) (int)(a.size())
define all(a) a.begin(),a.end() define _3Wcdivh ios::sync_with_stdio(0),cin.tie(0)typedef long long ll; typedef vector vi; typedef pair pii;
void print() { cout << '\n'; } template void print(const h& v, const t&... u) { cout << v << ' '; print(u...); }
const int N = (int) 3e5 + 1; const ll LINF = (ll) 1e18 + 123;
struct DSU { int n; int dsu[N]; int leftmost[N]; int rightmost[N];
};
class MinTree { public: void init(int n_) { n = n_ + 1; fill(tree, tree + 4 * n, LINF); }
private: int n; ll tree[4 * N];
};
struct Query { int l, r; ll x; int id; };
int n, m; ll h[N]; ll pref[N]; Query queries[N]; MinTree tree; DSU dsu; ll ans[N];
ll get_sum(int l, int r) { return pref[r] - pref[l - 1]; }
void slv() { cin >> n >> m; vector> heights(n); tree.init(n); rng(i, 1, n + 1) { cin >> h[i]; heights[i - 1] = {h[i], i}; pref[i] = pref[i - 1] + h[i]; tree.update(i, -h[i]); }
}
int main() { _3Wcdivh; slv(); return 0; }
I love basketball very much! I have been wacthing different basketball tournaments since my school life. Now I am working as a senior and help people with having nudits chat rooms around the world so that they could find a way to have a wonderful time! Thanks for sharing this post.
Hello, the below is my solution : I get error on this line : temp_li.append(list(itertools.combinations(varying_range, r=i))) Memory Error. Please help me in resolving the same.
''' https://www.hackerrank.com/contests/hourrank-31/challenges/basketball-tournament-1/problem '''
k=2