Hello every one :D
How to solve this problem: Hashing: 2015-2016 ACM-ICPC, NEERC, Moscow Subregional Contest.
Thanks in advance.
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 150 |
Hello every one :D
How to solve this problem: Hashing: 2015-2016 ACM-ICPC, NEERC, Moscow Subregional Contest.
Thanks in advance.
How to calculate: a ^ n mod BASE with n is a big integer, a and n are not coprimes? I have a formula: a ^ n mod BASE = a ^ (n % phi(BASE) + phi(BASE)) mod BASE. Is this correct? Can somebody prove it if correct?
Thanks. (Sorry for my bad English).
I'm trying to solve a problem !
I have a tree. Plants with N nodes (N <= 100000).
For any node, the node level 1 is the direct child node and child node level K (K> 1) that all child nodes of the node level 1 level (K-1).
Initially, all nodes have the value 0
I have two queries:
1 u k e: all child note lever k of note u should be increased by e.
2 u: note u how much value.
input:
The first line contains the number N
N-1 line followed by the pair (u, v), v is the node level 1 of u
The next line contains the number of queries M (M <= 500000).
M line followed by queries.
output:
Example
input:
6
1 2
1 3
2 4
3 5
3 6
6
2 6
1 1 2 1000
1 2 1 100
1 3 1 -100
2 4
2 5
output:
0
1100
900
Any ideal to solve it?
Thanks in advance.
(sorry if my English bad)
Name |
---|