Given a tree of n vertices, count the number of ways to choose a connected subgraph of the tree so that all the vertices in that
subgraph consists of consecutive integers when sorted. Thanks!
N <= 3e5
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Given a tree of n vertices, count the number of ways to choose a connected subgraph of the tree so that all the vertices in that
subgraph consists of consecutive integers when sorted. Thanks!
N <= 3e5
Given an array of N integers. Count the number of subarrays so that every value that appears in the subarray appears an odd number of times. I think this can be solved using XOR hashing but do not know how. Can someone help? Thanks!
N, Ai <= 1e5
Given n cards, initial the ith card from left to right has a number i written on it. X shuffled it Q times: The ith shuffle
is given as (l, c, k) meaning: X takes cards from position (not number) l to l + c — 1 out of the deck. Then insert it before
position k. After Q shuffle, print the order (number) written on each card from left to right.
N, Q <= 1e5
Ex:
5 2
3 2 2
3 3 1
Initially: (1, 2, 3, 4, 5)
After 1st queries: (1, 3, 4, 2, 5)
After 2nd queries:(4, 2, 5, 1, 3)
Can someone help? Thanks in advance!
Count the number of binary string of length N that satisfies the following M conditions:
The conditions can be 1 of 2 type
1 l r: There exists that least 1 '0' in the range [l, r]
2 l r: there exists at least 1 '1' in the range [l, r]
N <= 1e18
M <= 1e5
Thanks!
Given an array of n integers. In 1 operation you can swap 2 adjacent elements a[i] and a[i + 1] if and only if a[i] + a[i + 1] <=
k. Count the number of possible arrays that can be created using a series of operations (possibly none). Two arrays a and b are
considered different if there exists an index i so that a[i] != b[i]
N <= 1e5
K <= 1e9
Ai <= 1e9
Thanks!
Given R red balls, B blue balls, and G green balls. Count ways to arrange them so that there are exactly k pair RB (red ball is
in front of blue ball).
K <= min(R, B) R, B, G, K <= 1e6
Thanks!
Given an array of n integers and k. Count the number of permutations of the array so that the sum of each adjacent element >= k. Two permutations are different if they are different as arrays (There exists an index i so that a[i] != b[i])
N <= 2e5; K, Ai <= 1e9
Given an empty graph of n vertices and q queries.
Each queries is in the form of (x, y, l) which means you add edges (x + i, y + i) for 0 <= i <= l — 1
Report the number of connected components after q queries.
If I'm not mistaken, I remember there's a trick involving creating log2(n) DSU but I can't make out the details.
Can someone help? Thanks.
N <= 1e5
Q <= 1e5
Given an N * N matrix consisting of k ones and the rest are 0s.Count the number of connected components that contains only zeros
N <= 1e9
K <= 1e5
Thanks!
Hi can someone help me with this problem? Thanks
Link: https://oj.uz/problem/view/JOI18_candies
For every k where 1 <= k <= n / 2, find out what's the maximum total value you can achieved by choosing k elements from an array of n integers, and no 2 consecutive elements are chosen.
N <= 2e5;
Given an array of N integers. Count pairs (i, j) so that (A[i] & A[j]) = 0
N <= 1e5;
Ai <= 1e9
I have been doing JOI problems lately and I really liked them! Can someone suggest me some problems to do? Thanks. It could be from open contest, finals or spring camp :))
Hi I've been looking at solutions for https://oj.uz/problem/view/NOI19_feast and I saw some kind of binary search but I don't really understand the idea behind it. Can someone help? Thanks
Given an array of n integers, split it into at most k subarray that are pair-wise disjoint so that the sum of those subarray are maximized.
N, K <= 3e5
|Ai| <= 1e9
Given two arrays a[] and w[] of n integers. The cost for a subarray [l, r] is max(w[l], w[l + 1].., w[r]) * (a[l] + a[l] +.. a[r]) Divide the array into k subarray so that the total cost is minimized. Thanks
n, k <= 2500 a[i] <= 2500 with 1 <= i <= n w[i] <= 1e9 with 1 <= i <= n
You can submit here: https://www.codechef.com/INOIPRAC/problems/INOI2301?tab=statement
Given two permutations a and b of n elements.
Find the sum of inversion for each permutation that whose lexicographical value is between a and b mod = 1e9 + 7.
N <= 200000
Thanks in advance!
Name |
---|