Hi, can someone help me solve this problem:
Input consist of integer n and array a of n integers. Output number of pairs (a[i],a[j]), i<j who are adjacent or for all k (i<k<j) this equation is true: a[k]<=min(a[i],a[j]).
1<=n<=10^6
0<=a[i]<=2^31
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3839 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3612 |
7 | Geothermal | 3569 |
7 | cnnfls_csy | 3569 |
9 | ecnerwala | 3494 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | Um_nik | 164 |
2 | maomao90 | 160 |
3 | -is-this-fft- | 159 |
4 | atcoder_official | 158 |
4 | awoo | 158 |
4 | cry | 158 |
7 | adamant | 155 |
8 | nor | 154 |
9 | TheScrasse | 153 |
10 | maroonrk | 152 |
Problem from one Serbian contest
Hi, can someone help me solve this problem:
Input consist of integer n and array a of n integers. Output number of pairs (a[i],a[j]), i<j who are adjacent or for all k (i<k<j) this equation is true: a[k]<=min(a[i],a[j]).
1<=n<=10^6
0<=a[i]<=2^31
Rev. | Язык | Кто | Когда | Δ | Комментарий | |
---|---|---|---|---|---|---|
en2 | Brankonymous | 2018-10-29 23:10:57 | 50 | Tiny change: 'a[i]<=2^31' -> 'a[i]<=2^31\n\nexample:\n\n8\n\n4 1 2 3 6 5 1 2\n\nOutput: 11' | ||
en1 | Brankonymous | 2018-10-29 23:09:10 | 287 | Initial revision (published) |
Название |
---|