a[N], bucket[N], cnt[N];
14void add(
intindex) {
16 if(cnt[a[index]] == 1)
19voidremove(
intindex) {
21 if(cnt[a[index]] == 0)
26 if(x.l / bucket_size != y.l / bucket_size)
27 returnx.l / bucket_size < y.l / bucket_size;
34 for(i = 0; i < n; i++) scanf(
"%d", &a[i]);
35bucket_size = ceil(sqrt(n));
37 for(i = 0; i < t; i++) {
38scanf(
"%d %d", &q[i].l, &q[i].r);
43sort(q, q + t, mycmp);
44 intleft = 0, right = 0;
45 for(i = 0; i < t; i++) {
46 intL = q[i].l, R = q[i].r;
59 while(right > R + 1) {
65 for(i = 0; i < t; i++) printf(
"%d\n", bucket[i]);
int main()
Main function.
std::string add(const std::string &first, const std::string &second)
Adding two string.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4