hdu 3074 Multiply game】的更多相关文章

Multiply game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3224    Accepted Submission(s): 1173 Problem Description Tired of playing computer games, alpc23 is planning to play a game on numbe…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=3074 Minimum Inversion Number Description Tired of playing computer games, alpc23 is planning to play a game on numbers. Because plus and subtraction is too easy for this gay, he wants to do some multipl…
Multiply game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2189    Accepted Submission(s): 783 Problem Description Tired of playing computer games, alpc23 is planning to play a game on number…
单点更新,更新时先除去 原来的数,因为有去摸,可以用乘上逆元代替. //============================================================================ // Name : A.cpp // Author : L_Ecry // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //==…
离机房关门还有十分钟,这点时间能干些什么?故作沉思地仰望星空,重新捋一下一天的学习进度,或者,砍掉一棵模板级线段树. 纯模板,就是把单点更新,区间求和改为单点更新,区间求积. 1A. #include<stdio.h> #include<string.h> #define M 1000000007 #define N 50005 struct node { int x,y; __int64 sum; }a[N*3]; void CreatTree(int t,int x,int y…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3074 题目大意:单点更新.维护序列乘法.mod 1000000007. 解题思路: 1000000007*1000000007~10^18<9*10^18(int64) 所以单步模P乘法可以直接计算. (a*b)%p=[(a%p)*(b%p)]%p,PushUp维护即可. Query的rson的时候,要先判下lson是否存在,不存在ret=Query(rson),否则ret=(Query(lson…
Multiply game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2211    Accepted Submission(s): 794 Problem Description Tired of playing computer games, alpc23 is planning to play a game on number…
Zjnu Stadium Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1744    Accepted Submission(s): 660 Problem Description In 12th Zhejiang College Students Games 2007, there was a new stadium built i…
线段树水题 #include<stdio.h> #include<string.h> #include<iostream> using namespace std; #define LL(x) (x<<1) #define RR(x) ((x<<1)|1) ]; int update(int L,int R,int pos,int k,int mark) { if(L==pos&&R==pos) { num[mark]=k; re…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5475 Problem Description One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first, X = 1. This calculator only supports two types…