№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
A: Security check in websites that want to prevent robots, just print "security"
B: The first 25 contests in codeforces, contests 15, 20, and 21 was unrated, so print NO if the contest was unrated, otherwise print YES
C: Every testcase will give you n numbers, where $$$n = PI_i$$$, so $$$n1 = 3$$$, $$$n2 = 1$$$, $$$n3 = 4$$$, and so on.., Print the product of numbers
D: Print any number that is guranteed that it won't come in the sequence, for example 0 or -1
E: Print any positive number (I don't know)
F: Print largest prime factor, don't calculate it, just put if
G: The image shows that he is a color blind, n is the length, s1 is what person sees, s2 is what is the real colors. Print YES if the person only sees the red color correctly.
H: Complex probabilities problem, because all the numbers are random (idk the solution)
I: Check if the bracket sequence is balanced, Consider letters "bdfhklt" as open bracket, and letters "gjpqy" as closed bracket, ignore other letters
J: Write "please" in any lettercase, and judge will give you AC
Recently, I solved 342E - Ксюша и дерево using Sqrt decomposition.
The problem have two types of queries:
I thought, what will be the solution if there is query: Color node $$$x$$$ blue?
I'm not sure if this is solvable using centroid decomposition, but is there another way?
I thought long time ago, why std
doesn't have a segment_tree
class? so I decided to create a similar one.
My template is a class in an STD-similar way, supporting lazy propagation.
A quick example on how does it look like:
#include <bits/stdc++.h>
using namespace std;
// Put the template here :)
using namespace alg;
segment_tree<int, merge_min> st;
int main() {
int n, q;
cin >> n;
st.set_out(INT_MAX);
st.resize(n);
for (int i = 0; i < n; i++)
cin >> st.values[i];
st.build();
cin >> q;
while (q--) {
int l, r;
cin >> l >> r;
l--, r--;
cout << st.get(l, r) << '\n';
}
}
Just like that!!
It's available on a GitHub gist
So, what is your opinion about it? and how can I improve it?
Название |
---|