Can anyone help me to improve the code.. Here is my solution:3406918.
# | User | Rating |
---|---|---|
1 | tourist | 3690 |
2 | jiangly | 3647 |
3 | Benq | 3581 |
4 | orzdevinwang | 3570 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | Radewoosh | 3509 |
8 | ecnerwala | 3486 |
9 | jqdai0815 | 3474 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 174 |
2 | awoo | 164 |
3 | adamant | 163 |
4 | TheScrasse | 160 |
5 | nor | 158 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 152 |
8 | orz | 146 |
9 | pajenegod | 145 |
9 | SecondThread | 145 |
Can anyone help me to improve the code.. Here is my solution:3406918.
some somebody explain it.thanks in advance..
I know the logic is true for small numbers,but how can i prove the correctness of the algorithm for all n; here is the code:2296715
here is my solution,plz help 2269000
Your code here...
using namespace std; int main() { long long n,u=1,d=2,c=1000000007; cin>>n; while(n) { if(n%2) u=(u*d)%c; d=(d*d)%c; n/=2; } cout<<((u*u+u)/2)%c; return 0; }
i think the answer is (4^n-(1+2.....(2^n-1)))%(10^9+7);but upper bound of n is 10^18; so how to find the answer?
need tutorial on matrix exponential algorithm
Name |
---|